From 781c2e20a4bb844dae3f4eafbf5f0e494b942ea8 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 25 五月 2023 18:07:08 +0800
Subject: [PATCH] optimize

---
 java110-db/src/main/resources/mapper/store/StoreServiceDaoImplMapper.xml |  103 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 65 insertions(+), 38 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/store/StoreServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/store/StoreServiceDaoImplMapper.xml
index af3b2b7..6610d8c 100755
--- a/java110-db/src/main/resources/mapper/store/StoreServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/store/StoreServiceDaoImplMapper.xml
@@ -6,25 +6,27 @@
 
     <!-- 淇濆瓨鍟嗘埛淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessStoreInfo" parameterType="Map">
-        insert into
-        business_store(store_id,b_id,user_id,name,address,tel,store_type_cd,nearby_landmarks,map_x,map_y,month,operate)
-        values(#{storeId},#{bId},#{userId},#{name},#{address},#{tel},#{storeTypeCd},#{nearByLandmarks},#{mapX},#{mapY},#{month},#{operate})
+        insert into business_store(store_id, b_id, user_id, name, address, tel, store_type_cd, nearby_landmarks, map_x,
+                                   map_y, month, operate)
+        values (#{storeId}, #{bId}, #{userId}, #{name}, #{address}, #{tel}, #{storeTypeCd}, #{nearByLandmarks}, #{mapX},
+                #{mapY}, #{month}, #{operate})
     </insert>
     <!-- 淇濆瓨鍟嗘埛灞炴�т俊鎭�  add by wuxw 2018-07-03 -->
     <insert id="saveBusinessStoreAttr" parameterType="Map">
-        insert into business_store_attr(b_id,attr_id,store_id,spec_cd,value,month,operate)
-        values(#{bId},#{attrId},#{storeId},#{specCd},#{value},#{month},#{operate})
+        insert into business_store_attr(b_id, attr_id, store_id, spec_cd, value, month, operate)
+        values (#{bId}, #{attrId}, #{storeId}, #{specCd}, #{value}, #{month}, #{operate})
     </insert>
     <!-- 淇濆瓨鍟嗘埛鐓х墖淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessStorePhoto" parameterType="Map">
-        insert into business_store_photo(store_photo_id,b_id,store_id,store_photo_type_cd,photo,month,operate)
-        values(#{storePhotoId},#{bId},#{storeId},#{storePhotoTypeCd},#{photo},#{month},#{operate})
+        insert into business_store_photo(store_photo_id, b_id, store_id, store_photo_type_cd, photo, month, operate)
+        values (#{storePhotoId}, #{bId}, #{storeId}, #{storePhotoTypeCd}, #{photo}, #{month}, #{operate})
     </insert>
     <!-- 淇濆瓨鍟嗘埛璇佷欢淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessStoreCerdentials" parameterType="Map">
-        insert into
-        business_store_cerdentials(store_cerdentials_id,b_id,store_id,credentials_cd,value,validity_period,positive_photo,negative_photo,month,operate)
-        values(#{storeCerdentialsId},#{bId},#{storeId},#{credentialsCd},#{value},#{validityPeriod},#{positivePhoto},#{negativePhoto},#{month},#{operate})
+        insert into business_store_cerdentials(store_cerdentials_id, b_id, store_id, credentials_cd, value,
+                                               validity_period, positive_photo, negative_photo, month, operate)
+        values (#{storeCerdentialsId}, #{bId}, #{storeId}, #{credentialsCd}, #{value}, #{validityPeriod},
+                #{positivePhoto}, #{negativePhoto}, #{month}, #{operate})
     </insert>
 
     <!-- 鏌ヨ鍟嗘埛淇℃伅锛圔usiness锛� add by wuxw 2018-07-03 -->
@@ -95,35 +97,57 @@
 
     <!-- 淇濆瓨鍟嗘埛淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
     <insert id="saveStoreInfoInstance" parameterType="Map">
-        insert into s_store(store_id,b_id,user_id,name,address,tel,store_type_cd,nearby_landmarks,map_x,map_y,status_cd)
-        select s.store_id,s.b_id,s.user_id,s.name,s.address,s.tel,s.store_type_cd,s.nearby_landmarks,s.map_x,s.map_y,'0'
-        from business_store s where
-        s.operate = 'ADD' and s.b_id=#{bId}
+        insert into s_store(store_id, b_id, user_id, name, address, tel, store_type_cd, nearby_landmarks, map_x, map_y,
+                            status_cd)
+        select s.store_id,
+               s.b_id,
+               s.user_id,
+               s.name,
+               s.address,
+               s.tel,
+               s.store_type_cd,
+               s.nearby_landmarks,
+               s.map_x,
+               s.map_y,
+               '0'
+        from business_store s
+        where s.operate = 'ADD'
+          and s.b_id = #{bId}
     </insert>
 
     <!-- 淇濆瓨鍟嗘埛灞炴�т俊鎭埌 instance add by wuxw 2018-07-03 -->
     <insert id="saveStoreAttrsInstance" parameterType="Map">
-        insert into s_store_attr(b_id,attr_id,store_id,spec_cd,value,status_cd)
-        select sa.b_id,sa.attr_id,sa.store_id,sa.spec_cd,sa.value,'0'
+        insert into s_store_attr(b_id, attr_id, store_id, spec_cd, value, status_cd)
+        select sa.b_id, sa.attr_id, sa.store_id, sa.spec_cd, sa.value, '0'
         from business_store_attr sa
-        where sa.operate = 'ADD' and sa.b_id=#{bId}
+        where sa.operate = 'ADD'
+          and sa.b_id = #{bId}
     </insert>
 
     <!-- 淇濆瓨 鍟嗘埛鐓х墖淇℃伅 instance add by wuxw 2018-07-03 -->
     <insert id="saveStorePhotoInstance" parameterType="Map">
-        insert into s_store_photo(store_photo_id,b_id,store_id,store_photo_type_cd,photo,status_cd)
-        select sp.store_photo_id,sp.b_id,sp.store_id,sp.store_photo_type_cd,sp.photo,'0'
+        insert into s_store_photo(store_photo_id, b_id, store_id, store_photo_type_cd, photo, status_cd)
+        select sp.store_photo_id, sp.b_id, sp.store_id, sp.store_photo_type_cd, sp.photo, '0'
         from business_store_photo sp
-        where sp.operate = 'ADD' and sp.b_id=#{bId}
+        where sp.operate = 'ADD'
+          and sp.b_id = #{bId}
     </insert>
     <!-- 淇濆瓨 鍟嗘埛璇佷欢淇℃伅 instance add by wuxw 2018-07-03 -->
     <insert id="saveStoreCerdentialsInstance" parameterType="Map">
-        insert into
-        s_store_cerdentials(store_cerdentials_id,b_id,store_id,credentials_cd,value,validity_period,positive_photo,negative_photo,status_cd)
-        select
-        sc.store_cerdentials_id,sc.b_id,sc.store_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,'0'
+        insert into s_store_cerdentials(store_cerdentials_id, b_id, store_id, credentials_cd, value, validity_period,
+                                        positive_photo, negative_photo, status_cd)
+        select sc.store_cerdentials_id,
+               sc.b_id,
+               sc.store_id,
+               sc.credentials_cd,
+               sc.value,
+               sc.validity_period,
+               sc.positive_photo,
+               sc.negative_photo,
+               '0'
         from business_store_cerdentials sc
-        where sc.operate = 'ADD' and sc.b_id=#{bId}
+        where sc.operate = 'ADD'
+          and sc.b_id = #{bId}
     </insert>
 
     <!-- 鏌ヨ鍟嗘埛淇℃伅 add by wuxw 2018-07-03 -->
@@ -341,16 +365,17 @@
 
     <!--鍟嗘埛鎴愬憳鍔犲叆 add by wuxw 2018-10-27 saveBusinessMemberStore-->
     <insert id="saveBusinessMemberStore" parameterType="Map">
-        insert into business_member_store(member_store_id,b_id,store_id,member_id,month,operate)
-        values(#{memberStoreId},#{bId},#{storeId},#{memberId},#{month},#{operate})
+        insert into business_member_store(member_store_id, b_id, store_id, member_id, month, operate)
+        values (#{memberStoreId}, #{bId}, #{storeId}, #{memberId}, #{month}, #{operate})
     </insert>
 
     <!-- 鍟嗘埛鎴愬憳鍔犲叆 instance琛ㄤ腑 add by wuxw 2018-10-27 -->
     <insert id="saveMemberStoreInstance" parameterType="Map">
-        insert into s_member_store(member_store_id,b_id,store_id,member_id,status_cd)
-        select ms.member_store_id,ms.b_id,ms.store_id,ms.member_id,'0'
-        from business_member_store ms where
-        ms.operate = 'ADD' and ms.b_id=#{bId}
+        insert into s_member_store(member_store_id, b_id, store_id, member_id, status_cd)
+        select ms.member_store_id, ms.b_id, ms.store_id, ms.member_id, '0'
+        from business_member_store ms
+        where ms.operate = 'ADD'
+          and ms.b_id = #{bId}
     </insert>
 
     <!-- 鏌ヨ鍟嗘埛鎴愬憳 add by wuxw 2018-10-27 getBusinessMemberStore-->
@@ -404,8 +429,8 @@
 
     <!-- 淇濆瓨鐗╀笟鐢ㄦ埛淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessStoreUser" parameterType="Map">
-        insert into business_store_user(store_user_id,b_id,store_id,user_id,rel_cd,month,operate)
-        values(#{storeUserId},#{bId},#{storeId},#{userId},#{relCd},#{month},#{operate})
+        insert into business_store_user(store_user_id, b_id, store_id, user_id, rel_cd, month, operate)
+        values (#{storeUserId}, #{bId}, #{storeId}, #{userId}, #{relCd}, #{month}, #{operate})
     </insert>
 
     <!-- 鏌ヨ鐗╀笟 鐢ㄦ埛淇℃伅 add by wuxw 2018-07-03 -->
@@ -425,10 +450,11 @@
 
     <!-- 淇濆瓨 鍟嗘埛鐢ㄦ埛淇℃伅 instance add by wuxw 2018-07-03 -->
     <insert id="saveStoreUserInstance" parameterType="Map">
-        insert into s_store_user(store_user_id,b_id,store_id,user_id,rel_cd,status_cd)
-        select sc.store_user_id,sc.b_id,sc.store_id,sc.user_id,sc.rel_cd,'0'
+        insert into s_store_user(store_user_id, b_id, store_id, user_id, rel_cd, status_cd)
+        select sc.store_user_id, sc.b_id, sc.store_id, sc.user_id, sc.rel_cd, '0'
         from business_store_user sc
-        where sc.operate = 'ADD' and sc.b_id=#{bId}
+        where sc.operate = 'ADD'
+          and sc.b_id = #{bId}
     </insert>
 
     <!-- 鏌ヨ鍟嗘埛璇佷欢淇℃伅 add by wuxw 2018-07-03 -->
@@ -490,7 +516,6 @@
         from s_store s,store_type st
         where s.status_cd = '0'
         and s.store_type_cd = st.store_type_cd
-
         <if test="userId != null and userId != ''">
             and s.user_id = #{userId}
         </if>
@@ -565,9 +590,11 @@
     <select id="getStoreUserInfo" parameterType="Map" resultType="Map">
         select s.store_id,s.store_id storeId,s.b_id,s.user_id,s.user_id
         userId,s.name,s.address,s.tel,s.store_type_cd,s.store_type_cd storeTypeCd,
-        s.nearby_landmarks,s.map_x,s.map_y,s.create_time,su.store_user_id,su.rel_cd,s.state
+        s.nearby_landmarks,s.map_x,s.map_y,s.create_time,su.store_user_id,su.rel_cd,s.state,
+        uu.`name` staffName
         from s_store s
         left join s_store_user su on s.store_id=su.store_id and su.status_cd = '0'
+        LEFT JOIN u_user uu on su.user_id = uu.user_id and uu.status_cd = '0'
         where
         s.status_cd = '0'
         <if test="userId != null and userId != ''">

--
Gitblit v1.8.0