From 3f47c88e7cb4e53b3637620794420181f47b5a5e Mon Sep 17 00:00:00 2001
From: zmk <496160012@qq.com>
Date: 星期三, 23 十月 2024 16:07:13 +0800
Subject: [PATCH] 提交代码

---
 javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml
index e4801e7..060c72a 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml
+++ b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml
@@ -65,19 +65,16 @@
     </select>
 
     <select id="countTubLogDate" resultMap="TubLogResult">
-       SELECT
-            a.project_id,
-            a.tub_name,
-            b.inbound_number,
-            a.outbound_number,
-            a.unit
+        SELECT
+        a.project_id,
+        a.tub_name,
+        a.inbound_number,
+        b.outbound_number,
+        a.unit
         FROM
-            ( SELECT project_id, tub_name, SUM( number ) AS outbound_number, unit FROM js_tub_log WHERE outbound_date IS NOT NULL GROUP BY tub_name ) a
-            LEFT JOIN ( SELECT project_id, tub_name, SUM( number ) AS inbound_number, unit FROM js_tub_log WHERE inbound_date IS NOT NULL GROUP BY tub_name ) b ON a.tub_name = b.tub_name
-            AND a.project_id = b.project_id
-        <where>
-            <if test="projectId != null and projectId != ''"> and a.project_id = #{projectId}</if>
-        </where>
+        ( SELECT project_id, tub_name, SUM( number ) AS inbound_number, unit FROM js_tub_log WHERE inbound_date IS NOT NULL and project_id = #{projectId} GROUP BY tub_name ) a
+        LEFT JOIN ( SELECT project_id, tub_name, SUM( number ) AS outbound_number, unit FROM js_tub_log WHERE outbound_date IS NOT NULL and project_id = #{projectId} GROUP BY tub_name ) b ON a.tub_name = b.tub_name
+        AND a.project_id = b.project_id
     </select>
 
     <insert id="insertTubLog" parameterType="TubLog" useGeneratedKeys="true" keyProperty="id">

--
Gitblit v1.9.1