From d95f78488e734c1defcad4af8b7e79c712937111 Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期二, 15 八月 2023 16:00:26 +0800
Subject: [PATCH] 多表联查改为用join on

---
 src/main/resources/com/job/zsc/mapper/AnalysisDataMapper.xml |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/com/job/zsc/mapper/AnalysisDataMapper.xml b/src/main/resources/com/job/zsc/mapper/AnalysisDataMapper.xml
index 27e68c5..54d1bc3 100644
--- a/src/main/resources/com/job/zsc/mapper/AnalysisDataMapper.xml
+++ b/src/main/resources/com/job/zsc/mapper/AnalysisDataMapper.xml
@@ -120,21 +120,19 @@
 
     <!-- 鍘婚噸-->
     <select id="search" resultType="Integer">
-        select count(*) from fm_web_analysis_data
+        select count(*)
+        from fm_web_analysis_data as a join ea_t_device_info as b on a.fume_dev_id = b.DI_Code
         <where>
             <if test="shopname != null and shopname != '' ">
-                fume_dev_id=(select fume_dev_id
-                from shopname_data
-                where shop_name like concat('%',#{shopname},'%'))
+                a.fume_dev_id like concat('%',#{shopname},'%')
             </if>
             <if test="value != null and value != null">
-                or shop_name like concat('%',#{value},'%')
+                and b.DI_Name = #{value}
             </if>
 
             <if test="begin != null and end != null">
-                and (fume_date between #{begin} and #{end})
+                and a.fume_date between #{begin} and #{end}
             </if>
         </where>
-        group by fume_dev_id
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3