智慧农业后台管理
guoshilong
2022-08-03 fc6f694cbc5c8d4f98bb98c51b87b4d73ac98885
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
@@ -24,7 +24,9 @@
        l.url,
        d.dict_value as dic,
        c.dict_value as dica,
        v.farm_name as deptname
        v.farm_name as deptname,
        l.farm_id as farmId,
        l.land_type
        FROM `sys_land` l
        LEFT JOIN (SELECT dict_key, dict_value FROM blade_dict_biz WHERE CODE = 'land' AND is_deleted = 0 <if
        test="land.tenantId!=null and land.tenantId != ''">
@@ -136,7 +138,7 @@
        type = #{land.type},
        land_unit = #{land.landUnit},
        farm_id = #{land.farmId},
        url = #{land.url},
        url = #{land.url}
        where id = #{land.id}
    </update>
@@ -198,4 +200,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>