智慧农业后台管理
zengh
2022-07-19 ec09030f0730809145c97bfaa0bd0387a7d990bf
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
@@ -198,4 +198,23 @@
        GROUP BY sfp.strain_id
    </select>
    <!--查询统计地块是否有轮廓-->
    <select id="getLandIsAreaStatistic" resultType="java.lang.Integer">
        SELECT count(*) FROM sys_land where land_range is not null
        <if test="land.farmId!= null and land.farmId!=''">
            and farm_id=#{land.farmId}
        </if>
        <if test="land.deptId!= null and land.deptId!=''">
            and dept_id=#{land.deptId}
        </if>
        union all
        SELECT count(*) FROM sys_land where land_range is null
        <if test="land.farmId!= null and land.farmId!=''">
            and farm_id=#{land.farmId}
        </if>
        <if test="land.deptId!= null and land.deptId!=''">
            and dept_id=#{land.deptId}
        </if>
    </select>
</mapper>