Просмотр исходного кода

修改exists 关键字,分片不支持

wuxw лет назад: 6
Родитель
Сommit
181dc17600

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

@@ -370,6 +370,9 @@
         '审核拒绝'
         '审核拒绝'
         END) stateName
         END) stateName
         from s_community t
         from s_community t
+        <if test="memberId !=null and memberId !=''">
+            ,s_community_member cm
+        </if>
         where 1 =1
         where 1 =1
         <if test="address !=null and address != ''">
         <if test="address !=null and address != ''">
             and t.address= #{address}
             and t.address= #{address}
@@ -399,12 +402,9 @@
             and t.map_x= #{mapX}
             and t.map_x= #{mapX}
         </if>
         </if>
         <if test="memberId !=null and memberId !=''">
         <if test="memberId !=null and memberId !=''">
-            and exists(
-            select 1 from s_community_member cm
-            where cm.community_id = t.community_id
+            and cm.community_id = t.community_id
             and cm.member_id = #{memberId}
             and cm.member_id = #{memberId}
             and cm.status_cd = '0'
             and cm.status_cd = '0'
-            )
         </if>
         </if>
         <if test="page != -1 and page != null ">
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
             limit #{page}, #{row}
@@ -418,6 +418,9 @@
     <select id="queryCommunitysCount" parameterType="Map" resultType="Map">
     <select id="queryCommunitysCount" parameterType="Map" resultType="Map">
         select  count(1) count
         select  count(1) count
         from s_community t
         from s_community t
+        <if test="memberId !=null and memberId !=''">
+            ,s_community_member cm
+        </if>
         where 1 =1
         where 1 =1
         <if test="address !=null and address != ''">
         <if test="address !=null and address != ''">
             and t.address= #{address}
             and t.address= #{address}
@@ -447,12 +450,9 @@
             and t.map_x= #{mapX}
             and t.map_x= #{mapX}
         </if>
         </if>
         <if test="memberId !=null and memberId !=''">
         <if test="memberId !=null and memberId !=''">
-            and exists(
-                select 1 from s_community_member cm
-                where cm.community_id = t.community_id
+            and cm.community_id = t.community_id
                 and cm.member_id = #{memberId}
                 and cm.member_id = #{memberId}
                 and cm.status_cd = '0'
                 and cm.status_cd = '0'
-            )
         </if>
         </if>