| | |
| | | * 根据品种id查询对应地块 |
| | | */ |
| | | @GetMapping("/selcetByStrainId") |
| | | public R selcetByStrainId(String strainId) { |
| | | List<Land> list = landService.selectByStrainId(strainId); |
| | | public R selcetByStrainId(String strainId,String farmId) { |
| | | List<Land> list = landService.selectByStrainId(strainId,farmId); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | * @param strainId 品种id |
| | | * @return |
| | | */ |
| | | List<Land> selectByStrainId(String strainId); |
| | | List<Land> selectByStrainId(@Param("strainId") String strainId,@Param("farmId") String farmId); |
| | | } |
| | |
| | | </select> |
| | | |
| | | <select id="selectByStrainId" resultType="org.springblade.modules.lang.entity.Land"> |
| | | SELECT land.id,land.land_name |
| | | SELECT land.id,land.land_name,land.url,land.farm_id |
| | | FROM sys_land land |
| | | LEFT JOIN sys_farm_product_stock fps ON fps.land_id = land.id |
| | | WHERE fps.strain_id = #{strainId} |
| | | <if test="farmId !=null and farmId != '' "> |
| | | AND land.farm_id = #{farmId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | /** |
| | | * 根据品种id查询地块 |
| | | * @param strainId 品种id |
| | | * @param farmId 农场id |
| | | * @return |
| | | */ |
| | | List<Land> selectByStrainId(String strainId); |
| | | List<Land> selectByStrainId(String strainId,String farmId); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Land> selectByStrainId(String strainId) { |
| | | return baseMapper.selectByStrainId(strainId); |
| | | public List<Land> selectByStrainId(String strainId,String farmId) { |
| | | return baseMapper.selectByStrainId(strainId,farmId); |
| | | } |
| | | } |