From fc6f694cbc5c8d4f98bb98c51b87b4d73ac98885 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 03 Aug 2022 09:13:54 +0800
Subject: [PATCH] 首页种养品种总和保留三位小数,详情接口和种养品种接口分离
---
src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml | 34 +++++++++++++++++++++++-----------
1 files changed, 23 insertions(+), 11 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 7f30be0..446a8b8 100644
--- a/src/main/java/org/springblade/modules/lang/mapper/LandMapper.xml
+++ b/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>
@@ -163,9 +165,6 @@
<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>
<!--土地使用面积-->
<select id="selectSAre" resultType="java.util.HashMap">
@@ -176,9 +175,6 @@
<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>
<!--土地未使用面积-->
<select id="selectWAre" resultType="java.util.HashMap">
@@ -188,9 +184,6 @@
and type = 1
<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>
@@ -207,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>
--
Gitblit v1.9.3