智慧农业后台管理
Administrator
2022-07-14 85de465560468fe08f6d846e2d6beacb20b71da3
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
@@ -144,8 +144,11 @@
    <select id="selectZAre" resultType="java.util.HashMap">
        SELECT IFNULL(land_area, 0) as area, IFNULL(land_unit, 0) as unit FROM sys_land
        WHERE is_deleted = 0
        <if test="farmId!= null and farmId!=''">
            and farm_id=#{farmId}
        <if test="land.farmId!= null and land.farmId!=''">
            and sl.farm_id=#{land.farmId}
        </if>
        <if test="land.deptId!= null and land.deptId!=''">
            and sl.dept_id=#{land.deptId}
        </if>
    </select>
    <!--土地使用面积-->
@@ -154,8 +157,11 @@
        FROM sys_land
        WHERE is_deleted = 0
        and type = 0
        <if test="farmId!= null and farmId!=''">
            and farm_id=#{farmId}
        <if test="land.farmId!= null and land.farmId!=''">
            and sl.farm_id=#{land.farmId}
        </if>
        <if test="land.deptId!= null and land.deptId!=''">
            and sl.dept_id=#{land.deptId}
        </if>
    </select>
    <!--土地未使用面积-->
@@ -164,8 +170,11 @@
        FROM sys_land
        WHERE is_deleted = 0
        and type = 1
        <if test="farmId!= null and farmId!=''">
            and farm_id=#{farmId}
        <if test="land.farmId!= null and land.farmId!=''">
            and sl.farm_id=#{land.farmId}
        </if>
        <if test="land.deptId!= null and land.deptId!=''">
            and sl.dept_id=#{land.deptId}
        </if>
    </select>
@@ -173,8 +182,11 @@
        SELECT strain_id FROM sys_farm_plant sfp
        left join sys_land sl on sl.id = sfp.land_id
        WHERE sfp.status = 1
        <if test="farmId!= null and farmId!=''">
            and sl.farm_id=#{farmId}
        <if test="land.farmId!= null and land.farmId!=''">
            and sl.farm_id=#{land.farmId}
        </if>
        <if test="land.deptId!= null and land.deptId!=''">
            and sl.dept_id=#{land.deptId}
        </if>
        GROUP BY sfp.strain_id
    </select>