Explorar o código

优化商户查询

wuxw %!s(int64=6) %!d(string=hai) anos
pai
achega
f9632031ad

+ 8 - 1
java110-db/src/main/resources/mapper/store/StoreServiceDaoImplMapper.xml

@@ -453,7 +453,7 @@
 
     <!-- 查询商户 -->
     <select id="getStores" parameterType="Map" resultType="Map">
-        select s.store_id,s.b_id,s.user_id,s.name,s.name storeName,s.address,s.tel,
+        select s.store_id,s.b_id,s.user_id,s.name,s.name storeName,s.address,s.tel,s.store_id storeId,
         s.store_type_cd,s.store_type_cd storeTypeCd, s.nearby_landmarks,s.map_x,s.map_y,s.status_cd,
         st.name storeTypeName
         from s_store s,store_type st
@@ -481,6 +481,13 @@
         <if test="storeId != null and storeId !=''">
             and s.store_id = #{storeId}
         </if>
+        <if test="storeIds !=null">
+            and t.store_id in
+            <foreach collection="storeIds" open="(" close=")"
+                     separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
         order by s.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}