智慧农业后台管理
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
@@ -127,18 +127,23 @@
    <!--详情信息(自定义查询)-->
    <select id="getLandInfo" resultType="org.springblade.modules.lang.vo.LandVO">
        select user_id,
               land_name,
               land_type,
               land_area,
               ST_ASTEXT(land_range) as landRange,
               type,
               land_unit,
               url
        from sys_land
        select DISTINCT
               l.user_id,
               l.land_name,
               l.land_type,
               l.land_area,
               ST_ASTEXT(l.land_range) as landRange,
               l.type,
               l.land_unit,
               l.url,
               bdb.dict_value dica
        from sys_land l
        LEFT JOIN blade_dict_biz bdb ON bdb.dict_key =l.land_unit
        where 1 = 1
          and is_deleted = 0
          and id = #{land.id}
          and l.is_deleted = 0
          AND bdb.code = 'landunit'
          and l.id = #{land.id}
        GROUP BY l.user_id,l.land_name,l.land_type,l.land_area,landRange,l.type,l.land_unit,l.url,dica
    </select>
    <!--自定义地块数据-->
@@ -252,7 +257,7 @@
        SELECT DISTINCT land.id,land.land_name,land.url,land.farm_id
        FROM sys_land land
        LEFT JOIN sys_farm_plant sfp ON sfp.land_id = land.id
        WHERE land.is_deleted = 0
        WHERE land.is_deleted = 0 AND sfp.planting_way !=2
        <if test="land.strainId !=null and land.strainId !=''">
            AND sfp.strain_id = #{land.strainId}
        </if>
@@ -270,5 +275,16 @@
        WHERE land.is_deleted = 0  AND sfp.status = 1
        AND land.id = #{ids}
    </select>
    <select id="selectRecoveryLandList" resultType="org.springblade.modules.lang.vo.LandVO">
        SELECT
            DISTINCT l.id,l.land_name AS landName
        FROM
            sys_recovery r
        LEFT JOIN sys_land l ON r.land_id = l.id
        WHERE l.is_deleted = 0
        <if test="farmId !=null and farmId !=''">
            AND r.dept_id = #{farmId}
        </if>
    </select>
</mapper>