智慧农业后台管理
tangzy
2022-05-25 4dfbe79d4beb7457343945e0f956bc0c6dd09b78
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.lang.mapper.LandMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="landResultMap" type="org.springblade.modules.lang.entity.Land">
    <resultMap id="landResultMap" type="org.springblade.modules.lang.vo.LandVO">
        <result column="id" property="id"/>
        <result column="user_id" property="userId"/>
        <result column="land_name" property="landName"/>
@@ -16,9 +16,20 @@
    <select id="selectLandPage" resultMap="landResultMap">
        select *
        from sys_land
        where is_deleted = 0
        SELECT l.land_name,
               l.land_area ,
               ST_ASTEXT(land_range) as land_range,
               l.url,
               d.dict_value as dic,
               c.dict_value as dica
        FROM `sys_land` l
                 LEFT JOIN (SELECT dict_key, dict_value FROM blade_dict_biz WHERE CODE = 'land' AND is_deleted = 0) d
                           ON d.dict_key = l.land_type
                 LEFT JOIN (SELECT dict_key, dict_value
                            FROM blade_dict_biz
                            WHERE CODE = 'landunit'
                              AND is_deleted = 0) c ON c.dict_key = l.type
        where l.is_deleted = 0
    </select>
    <insert id="saveLandInfo">
@@ -42,7 +53,8 @@
               type,
               land_unit
        from sys_land
        where 1 = 1 and is_deleted = 0
        where 1 = 1
          and is_deleted = 0
          and id = #{land.id}
    </select>
@@ -61,18 +73,29 @@
    </update>
    <select id="selectLandList" resultType="java.util.HashMap">
      select id,land_name as landName from sys_land where user_id=#{userid} and is_deleted = 0
        select id, land_name as landName
        from sys_land
        where user_id = #{userid}
          and is_deleted = 0
    </select>
    <!--土地总面积-->
    <select id="selectZAre" resultType="java.util.HashMap">
        SELECT land_area as area,land_unit as unit FROM sys_land WHERE is_deleted=0
        SELECT land_area as area, land_unit as unit
        FROM sys_land
        WHERE is_deleted = 0
    </select>
    <!--土地使用面积-->
    <select id="selectSAre" resultType="java.util.HashMap">
        SELECT land_area as area,land_unit as unit FROM sys_land WHERE is_deleted=0 and type=0
        SELECT land_area as area, land_unit as unit
        FROM sys_land
        WHERE is_deleted = 0
          and type = 0
    </select>
    <select id="selectNum" resultType="java.util.HashMap">
        SELECT strain_id FROM `sys_farm_plant` WHERE status=1 GROUP BY strain_id
        SELECT strain_id
        FROM `sys_farm_plant`
        WHERE status = 1
        GROUP BY strain_id
    </select>
</mapper>