From 0c90b05a7df664f8dcab2c4b330c07c7b80745a4 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 30 May 2022 16:05:53 +0800
Subject: [PATCH] 种养结束修改

---
 src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml |   52 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml b/src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
index 7bf73dd..9c3815c 100644
--- a/src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
+++ b/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,26 @@
 
 
     <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
+        <if test="land.landType!=null and land.landType != ''">
+            and l.land_type = #{land.landType}
+        </if>
+        <if test="land.landName!=null and land.landName != ''">
+            and l.land_name like concat('%', #{land.landName},'%')
+        </if>
     </select>
 
     <insert id="saveLandInfo">
@@ -42,7 +59,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,7 +79,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>
+    <!--土地使用面积-->
+    <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>
+    <select id="selectNum" resultType="java.util.HashMap">
+        SELECT strain_id
+        FROM `sys_farm_plant`
+        WHERE status = 1
+        GROUP BY strain_id
     </select>
 
 </mapper>

--
Gitblit v1.9.3