| | |
| | | |
| | | <!--自定义查询农场养殖记录分页数据--> |
| | | <select id="selectFarmPlantPage" resultType="org.springblade.modules.farmplant.vo.FarmPlantVO"> |
| | | select sfp.*,ss.strain_name strainName,ss.url,sl.land_name landName,sl.land_area area,land_unit landUnit |
| | | select sfp.*,ss.strain_name strainName,ss.url,sl.land_name landName,sl.land_area area,land_unit landUnit,bdb.dict_value dica,a.farm_id AS otherFarmId |
| | | ,(SELECT IFNULL(SUM(r.weight),0) from sys_recovery r where sfp.land_id = r.land_id and sfp.strain_id = r.strain_id) as outputNum |
| | | from |
| | | sys_farm_plant sfp |
| | | left join sys_strain ss on ss.id = sfp.strain_id |
| | | left join sys_land sl on sl.id = sfp.land_id |
| | | LEFT JOIN ( |
| | | SELECT l.id,l.land_name,l.farm_id FROM sys_land l |
| | | ) a ON a.id = sfp.other_land_id |
| | | LEFT JOIN sys_farm farm ON farm.id = a.farm_id |
| | | LEFT JOIN blade_dict_biz bdb ON bdb.dict_key = sl.land_unit |
| | | where 1=1 |
| | | AND bdb.code = "landunit" |
| | | <if test="farmPlant.plant!=null and farmPlant.plant!=''"> |
| | | and sfp.plant = #{farmPlant.plant} |
| | | </if> |
| | |
| | | <if test="farmPlant.varieties!=null and farmPlant.varieties!=''"> |
| | | and sfp.varieties like concat('%',#{farmPlant.varieties},'%') |
| | | </if> |
| | | <if test="farmPlant.landName!=null and farmPlant.landName!=''"> |
| | | and sl.land_name like concat('%',#{farmPlant.landName},'%') |
| | | </if> |
| | | <if test="farmPlant.startTime!=null and farmPlant.startTime!=''"> |
| | | and sfp.transplan_time >= #{farmPlant.startTime} |
| | | </if> |
| | |
| | | <if test="farmPlant.transplanTimeEnd !=null and farmPlant.transplanTimeEnd!= ''"> |
| | | and sfp.transplan_time < #{farmPlant.transplanTimeEnd} |
| | | </if> |
| | | <if test="farmPlant.otherLandId !=null and farmPlant.otherLandId !=''"> |
| | | AND sfp.other_land_id = #{farmPlant.otherLandId} |
| | | </if> |
| | | order by sfp.id desc |
| | | </select> |
| | | |