From b63eef2cfb054b1ead234ab93e05a2aa28775d91 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 17 四月 2025 14:54:26 +0800
Subject: [PATCH] 优化灌溉计划发布前判断条件
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
index 71d988d..e580bd8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -405,6 +405,13 @@
</select>
<!--鏍规嵁鏉慖D鑾峰彇鍏ㄩ儴鍦板潃-->
+ <select id="getNameById" resultType="java.lang.String">
+ select name
+ from pr_intake
+ where id = #{intakeId, jdbcType=BIGINT}
+ </select>
+
+ <!--鏍规嵁鏉慖D鑾峰彇鍏ㄩ儴鍦板潃-->
<select id="getAddressByVillageId" parameterType="_long" resultType="java.lang.String">
select CONCAT(dis_province.`name`, dis_city.`name`, dis_county.`name`, dis_town.`name`,
dis_village.`name`) AS address
@@ -589,6 +596,7 @@
inta.name AS intakeNum,
inta.lng,
inta.lat,
+ IFNULL(hou.instant_amount, 0) AS instantAmount,
IFNULL(hou.total_amount, 0) AS totalAmount,
<if test="onLineMap != null and onLineMap !='' and isOnLine != null">
rtus.isOnLine,
@@ -720,10 +728,41 @@
<if test="lat != null">
lat = #{lat,jdbcType=DOUBLE},
</if>
+ <if test="operator != null">
+ `operator` = #{operator,jdbcType=BIGINT},
+ </if>
<if test="operateDt != null">
operateDt = #{operateDt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
+
+ <!--鑾峰彇鏈粦瀹氬埌杞亴缁勭殑鍙栨按鍙e垪琛�-->
+ <select id="getFreeIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntakeSimple">
+ SELECT
+ id AS intakeId,
+ name AS intakeName
+ FROM pr_intake inta
+ <where>
+ AND inta.deleted = 0
+ AND NOT EXISTS (SELECT 1 FROM ir_group_intake gi WHERE gi.intake_id = inta.id)
+ <if test="intakeName != null and intakeName != ''">
+ AND LOWER(inta.name) LIKE CONCAT('%', #{intakeName}, '%')
+ </if>
+ </where>
+ </select>
+
+ <!--鑾峰彇鏈粦瀹氳櫄鎷熷崱鐨勫彇姘村彛鍒楄〃锛岀粰鍙栨按鍙g粦铏氭嫙鍗′娇鐢�-->
+ <select id="getNotLinkVcIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntakeSimple">
+ SELECT
+ id AS intakeId,
+ name AS intakeName
+ FROM pr_intake inta
+ WHERE NOT EXISTS (
+ SELECT 1
+ FROM pr_intake_vc iv
+ WHERE iv.intake_id = inta.id
+ ) AND inta.deleted = 0
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0