Browse Source

修改sql条件

hgw 3 years ago
parent
commit
dbb0ff4ded
1 changed files with 14 additions and 12 deletions
  1. 14 12
      mec-biz/src/main/resources/config/mybatis/ImLiveBroadcastRoomMapper.xml

+ 14 - 12
mec-biz/src/main/resources/config/mybatis/ImLiveBroadcastRoomMapper.xml

@@ -209,18 +209,20 @@
         left join sys_user su on su.id_ = ilrr.user_id_
         left join organization o on o.id_ = su.organ_id_
         left join student s on s.user_id_ = su.id_
-        where ilrr.room_uid_ = #{query.roomUid}
-        <if test="query.search != null and query.search != ''">
-            and (su.id_ like concat('%',#{query.search},'%')
-            or su.phone_ like concat('%',#{query.search},'%')
-            or su.username_ like concat('%',#{query.search},'%'))
-        </if>
-        <if test="query.subjectId != null">
-            and find_in_set(#{query.subjectId},s.subject_id_list_)
-        </if>
-        <if test="query.organId != null">
-            and su.organ_id_ = #{query.organId}
-        </if>
+        <where>
+            ilrr.room_uid_ = #{query.roomUid}
+            <if test="query.search != null and query.search != ''">
+                and (su.id_ like concat('%',#{query.search},'%')
+                or su.phone_ like concat('%',#{query.search},'%')
+                or su.username_ like concat('%',#{query.search},'%'))
+            </if>
+            <if test="query.subjectId != null">
+                and find_in_set(#{query.subjectId},s.subject_id_list_)
+            </if>
+            <if test="query.organId != null">
+                and su.organ_id_ = #{query.organId}
+            </if>
+        </where>
     </select>
 
     <select id="querySchoolIds" resultType="string">