1.Controller层
@ApiOperation("查询品种")
@GetMapping("/findCropById")
public ResponseResult findCropById(Integer cropId){
List<Map<String,Object>> list = taskService.findByCropId(cropId);
return new ResponseResult(list);
}
2.Service层
public List<Map<String, Object>> findByCropId(Integer cropId) {
return taskMapper.findByCropId(cropId);
}
3.XML映射
@Select("select * from crop_varieties where crop_id=#{cropId}")
List<Map<String, Object>> findByCropId(@Param("cropId")Integer cropId);