zouxuan 5 年 前
コミット
3adf0fadd2

+ 2 - 8
mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml

@@ -309,10 +309,7 @@
 		from demo_group_courses_plan dgcp left join demo_group dg on dgcp.demo_group_id_ = dg.id_
 		<where>
             <if test="organIds != null">
-                AND
-                <foreach collection="organIds" item="item" open="(" close=")" separator=" OR ">
-                    FIND_IN_SET(#{item},dg.organ_id_list_)
-                </foreach>
+                AND INTE_ARRAY(dg.organ_id_list_,#{organIds})
             </if>
     	</where> 
 	</select>
@@ -323,10 +320,7 @@
         where cs.type_ = 'DEMO'
   		and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m')
         <if test="organIds != null">
-            AND
-            <foreach collection="organIds" item="item" open="(" close=")" separator=" OR ">
-                FIND_IN_SET(#{item},vg.organ_id_list_)
-            </foreach>
+            AND INTE_ARRAY(vg.organ_id_list_,#{organIds})
         </if>
     </select>
 </mapper>

+ 2 - 8
mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -185,10 +185,7 @@
         <where>
             su.user_type_ = 'SYSTEM'
             <if test="organIds != null">
-                AND
-                <foreach collection="organIds" item="item" open="(" close=")" separator=" OR ">
-                    FIND_IN_SET(#{item},e.organ_id_list_)
-                </foreach>
+                AND INTE_ARRAY(e.organ_id_list_,#{organIds})
             </if>
             <if test="search != null">
                 AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
@@ -206,10 +203,7 @@
         <where>
             su.user_type_ = 'SYSTEM'
             <if test="organIds != null">
-                AND
-                <foreach collection="organIds" item="item" open="(" close=")" separator=" OR ">
-                    FIND_IN_SET(#{item},e.organ_id_list_)
-                </foreach>
+                AND INTE_ARRAY(e.organ_id_list_,#{organIds})
             </if>
             <if test="search != null">
                 AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))

+ 1 - 4
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -368,10 +368,7 @@
 			#{item}
 		</foreach>
 		<if test="organIds != null">
-			AND
-			<foreach collection="organIds" item="item" open="(" close=")" separator=" OR ">
-				FIND_IN_SET(#{item},e.organ_id_list_)
-			</foreach>
+			AND INTE_ARRAY(e.organ_id_list_,#{organIds})
 		</if>
 	</select>
 	<select id="queryTeacherIdMap" resultType="java.util.Map">

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -231,7 +231,7 @@
             AND FIND_IN_SET(#{subjectId},t.subject_id_)
         </if>
         <if test="organId != null">
-            AND FIND_IN_SET(su.organ_id_,#{organId})
+            AND FIND_IN_SET(t.organ_id_,#{organId})
         </if>
         <if test="search != null">
             AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))