From 3b58972c757734f0dc4b1ff29a0a179ed564ab64 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 17 七月 2024 11:47:42 +0800
Subject: [PATCH] 2024-07-17 朱宝民 重构命令日志表,返回结果改为text类型
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowMonitoringMapper.xml | 41 +++++++++++++++++++++++++----------------
1 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowMonitoringMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowMonitoringMapper.xml
index c0d4f0e..29835ac 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowMonitoringMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowMonitoringMapper.xml
@@ -211,43 +211,52 @@
<select id="getRecordCountOfFlowMonitoring" resultType="java.lang.Integer">
SELECT COUNT(*) AS recordCountOfFlowMonitoring
from pr_flow_monitoring pfm
- INNER JOIN ba_district country ON pfm.countyId = country.id
- INNER JOIN ba_district town ON pfm.townId = town.id
- INNER JOIN ba_district village ON pfm.villageId = village.id
- INNER JOIN pr_monitoring_flowmeter pmofl ON pmofl.monitoringId = pfm.id
+ LEFT JOIN pr_flowmeter pf ON pf.monitoringId = pfm.id
+ LEFT JOIN ba_district country ON pfm.countyId = country.id
+ LEFT JOIN ba_district town ON pfm.townId = town.id
+ LEFT JOIN ba_district village ON pfm.villageId = village.id
<where>
pfm.deleted = 0
<if test = "name != null and name !=''">
AND pfm.`name` like CONCAT('%',#{name},'%')
</if>
- <if test = "bindState != null and bindState > 0">
- AND pmofl.operateType = ${bindState}
+ <if test = "bindState ==1 ">
+ AND pf.monitoringId IS NOT NULL
+ </if>
+ <if test = "bindState ==2 or bindState =='' ">
+ AND pf.monitoringId IS NULL
</if>
</where>
</select>
<!--鏍规嵁鎸囧畾鏉′欢鑾峰彇娴侀噺鐩戞祴绔欏疄浣撹褰�-->
<select id="getPrFlowMonitoring" parameterType="map" resultType="com.dy.pipIrrGlobal.voPr.VoFlowMonitoring">
- select (@i:=@i+1) AS id,
+ select CAST(pfm.id AS char) AS id,
CONCAT(country.`name`, town.`name`, village.`name`) AS address,
pfm.`name` AS `name`,
- pmofl.operateType AS bindState
+ (CASE
+ WHEN pf.monitoringId IS NOT NULL THEN "宸茬粦瀹�"
+ WHEN pf.monitoringId IS NULL THEN "鏈粦瀹�"
+ END) AS bindState
from pr_flow_monitoring pfm
- INNER JOIN ba_district country ON pfm.countyId = country.id
- INNER JOIN ba_district town ON pfm.townId = town.id
- INNER JOIN ba_district village ON pfm.villageId = village.id
- INNER JOIN pr_monitoring_flowmeter pmofl ON pmofl.monitoringId = pfm.id,
- (SELECT @i:=0) AS itable
+ LEFT JOIN pr_flowmeter pf ON pf.monitoringId = pfm.id
+ LEFT JOIN ba_district country ON pfm.countyId = country.id
+ LEFT JOIN ba_district town ON pfm.townId = town.id
+ LEFT JOIN ba_district village ON pfm.villageId = village.id
+
<where>
pfm.deleted = 0
<if test = "name != null and name !=''">
AND pfm.`name` like CONCAT('%',#{name},'%')
</if>
- <if test = "bindState != null and bindState > 0">
- AND pmofl.operateType = ${bindState}
+ <if test = "bindState ==1 ">
+ AND pf.monitoringId IS NOT NULL
+ </if>
+ <if test = "bindState ==2 or bindState =='' ">
+ AND pf.monitoringId IS NULL
</if>
</where>
- ORDER BY pmofl.operateDt DESC
+ ORDER BY pfm.operateDt DESC
<trim prefix="limit " >
<if test="start != null and count != null">
#{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
--
Gitblit v1.8.0