wangyunpeng пре 4 недеља
родитељ
комит
50927c091b

+ 24 - 28
api-module/src/main/resources/mapper/wecom/thirdpart/ext/ThirdPartWeComRoomMapperExt.xml

@@ -9,20 +9,18 @@
         join third_part_we_com_corp corp on staff.corp_id = corp.id
         left join third_part_we_com_room_config room_config on room.id = room_config.room_id and room_config.status = 1
         where room.is_delete = 0
-        <trim prefixOverrides="and">
-            <if test="param.corpName != null">
-                and corp.name like concat('%', #{param.corpName}, '%')
-            </if>
-            <if test="param.groupLeaderName != null">
-                and staff.name like concat('%', #{param.groupLeaderName}, '%')
-            </if>
-            <if test="pushAccountIds != null and pushAccountIds.size() > 0">
-                and (room_config.primary_push_account_id in
-                <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>
-                or room_config.secondary_push_account_id in
-                <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>)
-            </if>
-        </trim>
+        <if test="param.corpName != null">
+            and corp.name like concat('%', #{param.corpName}, '%')
+        </if>
+        <if test="param.groupLeaderName != null">
+            and staff.name like concat('%', #{param.groupLeaderName}, '%')
+        </if>
+        <if test="pushAccountIds != null and pushAccountIds.size() > 0">
+            and (room_config.primary_third_staff_id in
+            <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>
+            or room_config.second_third_staff_id in
+            <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>)
+        </if>
     </select>
 
     <select id="getRoomList"
@@ -33,20 +31,18 @@
         join third_part_we_com_corp corp on staff.corp_id = corp.id
         left join third_part_we_com_room_config room_config on room.id = room_config.room_id and room_config.status = 1
         where room.is_delete = 0
-        <trim prefixOverrides="and">
-            <if test="param.corpName != null">
-                and corp.name like concat('%', #{param.corpName}, '%')
-            </if>
-            <if test="param.groupLeaderName!= null">
-                and staff.name like concat('%', #{param.groupLeaderName}, '%')
-            </if>
-            <if test="pushAccountIds != null and pushAccountIds.size() > 0">
-                and (room_config.primary_push_account_id in
-                <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>
-                or room_config.secondary_push_account_id in
-                <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>)
-            </if>
-        </trim>
+        <if test="param.corpName != null">
+            and corp.name like concat('%', #{param.corpName}, '%')
+        </if>
+        <if test="param.groupLeaderName!= null">
+            and staff.name like concat('%', #{param.groupLeaderName}, '%')
+        </if>
+        <if test="pushAccountIds != null and pushAccountIds.size() > 0">
+            and (room_config.primary_third_staff_id in
+            <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>
+            or room_config.second_third_staff_id in
+            <foreach collection="pushAccountIds" item="item" open="(" close=")" separator=",">#{item}</foreach>)
+        </if>
         order by staff.id desc
         limit #{offset}, #{pageSize}
     </select>