Kaynağa Gözat

优化根据小区查询商户group by 商户判断

java110 6 yıl önce
ebeveyn
işleme
71b5bebbe8

+ 1 - 1
Api/src/main/java/com/java110/api/listener/store/ListStoresByCommunityListener.java

@@ -29,7 +29,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * 保存商户信息
+ * 查询商户信息
  * Created by Administrator on 2019/3/29.
  */
 @Java110Listener("listStoresByCommunityListener")

+ 7 - 2
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

@@ -339,7 +339,9 @@
         <if test="communityName != null and communityName != '' and needCommunityInfo == true">
             and sc.name like concat('%',#{communityName},'%')
         </if>
-        group by ms.community_id
+        <if test="needCommunityInfo == true">
+            group by ms.community_id
+        </if>
         order by ms.create_time desc
         <if test="page != -1 and page != null">
             limit #{page},#{row}
@@ -425,7 +427,10 @@
         <if test="communityName != null and communityName != '' and needCommunityInfo == true">
             and sc.name like concat('%',#{communityName},'%')
         </if>
-        group by ms.community_id
+        <if test="needCommunityInfo == true">
+            group by ms.community_id
+        </if>
+
     </select>
 
     <!-- 查询小区信息 add by wuxw 2018-07-03 -->