| | |
| | | <if test="farmPlant.tenantId!=null and farmPlant.tenantId!=''"> |
| | | and sfp.tenant_id = #{farmPlant.tenantId} |
| | | </if> |
| | | <if test="farmPlant.status !=null and farmPlant.status!=''"> |
| | | and sfp.status = #{farmPlant.status} |
| | | </if> |
| | | group by sfp.strain_id,strain_name,land_unit |
| | | </select> |
| | | |
| | |
| | | |
| | | <!--小程序查询农场养殖记录数据--> |
| | | <select id="getFarmPlantStatisticsCountz" resultType="org.springblade.modules.farmplant.vo.FarmPlantVO"> |
| | | <!-- SELECT--> |
| | | <!-- sfp.strain_id,--> |
| | | <!-- ss.strain_name strainName,--> |
| | | <!-- sum( sl.land_area ) area,--> |
| | | <!-- land_unit landUnit--> |
| | | <!-- 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 where 1=1--> |
| | | <!-- <if test="farmPlant.startTime!=null and farmPlant.startTime!=''">--> |
| | | <!-- and sfp.transplan_time >= #{farmPlant.startTime}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="farmPlant.endTime!=null and farmPlant.endTime!=''">--> |
| | | <!-- and sfp.transplan_time <= #{farmPlant.endTime}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="farmPlant.farmId!=null and farmPlant.farmId!=''">--> |
| | | <!-- and sl.farm_id = #{farmPlant.farmId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="farmPlant.status!=null and farmPlant.status!=''">--> |
| | | <!-- and sfp.status = #{farmPlant.status}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="farmPlant.tenantId!=null and farmPlant.tenantId!=''">--> |
| | | <!-- and sfp.tenant_id = #{farmPlant.tenantId}--> |
| | | <!-- </if>--> |
| | | <!-- group by sfp.strain_id,strain_name,land_unit--> |
| | | SELECT |
| | | sfp.strain_id, |
| | | ss.strain_name strainName, |
| | |
| | | <if test="farmPlant.endTime!=null and farmPlant.endTime!=''"> |
| | | and sfp.transplan_time <= #{farmPlant.endTime} |
| | | </if> |
| | | <if test="farmPlant.farmId!=null and farmPlant.farmId!=''"> |
| | | and sl.farm_id = #{farmPlant.farmId} |
| | | </if> |
| | | <if test="farmPlant.status!=null and farmPlant.status!=''"> |
| | | and sfp.status = #{farmPlant.status} |
| | | </if> |
| | | <!-- 小程序端会传farmId和status的值过来,但是为了和web端统一所以不加入查询条件 --> |
| | | <!-- <if test="farmPlant.farmId!=null and farmPlant.farmId!=''">--> |
| | | <!-- and sl.farm_id = #{farmPlant.farmId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="farmPlant.status !=null and farmPlant.status!=''">--> |
| | | <!-- and sfp.status = #{farmPlant.status}--> |
| | | <!-- </if>--> |
| | | <if test="farmPlant.tenantId!=null and farmPlant.tenantId!=''"> |
| | | and sfp.tenant_id = #{farmPlant.tenantId} |
| | | </if> |
| | | <if test=" farmPlant.deptId !=null and farmPlant.deptId != ''"> |
| | | and sfp.dept_id = #{farmPlant.deptId} |
| | | </if> |
| | | group by sfp.strain_id,strain_name,land_unit |
| | | </select> |
| | | |