|  | @@ -279,9 +279,9 @@
 | 
	
		
			
				|  |  |      <select id="queryPage" resultMap="Teacher" parameterType="map">
 | 
	
		
			
				|  |  |          SELECT t.id_,su.real_name_,su.lock_flag_,t.subject_id_,su.phone_,t.organ_id_ teacher_organ_id_,t.organ_id_,t.is_support_extra_practice_lesson_,
 | 
	
		
			
				|  |  |          t.job_nature_,t.is_probation_period_,t.memo_,GROUP_CONCAT(s.name_) subject_name_,su.del_flag_
 | 
	
		
			
				|  |  | -        FROM teacher t LEFT JOIN sys_user su ON t.id_ = su.id_
 | 
	
		
			
				|  |  | +        FROM teacher t
 | 
	
		
			
				|  |  | +        LEFT JOIN sys_user su ON t.id_ = su.id_
 | 
	
		
			
				|  |  |          LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)
 | 
	
		
			
				|  |  | -        WHERE su.del_flag_ = 0
 | 
	
		
			
				|  |  |          <include refid="queryPageMap"/>
 | 
	
		
			
				|  |  |          GROUP BY t.id_
 | 
	
		
			
				|  |  |          ORDER BY t.id_ DESC
 | 
	
	
		
			
				|  | @@ -291,26 +291,40 @@
 | 
	
		
			
				|  |  |      <select id="queryCount" resultType="int">
 | 
	
		
			
				|  |  |          SELECT COUNT(DISTINCT t.id_)
 | 
	
		
			
				|  |  |          FROM teacher t LEFT JOIN sys_user su ON t.id_ = su.id_
 | 
	
		
			
				|  |  | -        WHERE su.del_flag_ = 0
 | 
	
		
			
				|  |  |          <include refid="queryPageMap"/>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <sql id="queryPageMap">
 | 
	
		
			
				|  |  | -        <if test="lockFlag != null">
 | 
	
		
			
				|  |  | -            AND su.lock_flag_ = #{lockFlag}
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | -        <if test="teacherId != null">
 | 
	
		
			
				|  |  | -            AND t.id_ IN
 | 
	
		
			
				|  |  | -            <foreach collection="teacherId" separator="," open="(" close=")" item="item">
 | 
	
		
			
				|  |  | -                #{item}
 | 
	
		
			
				|  |  | -            </foreach>
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | -        <if test="search != null">
 | 
	
		
			
				|  |  | -            AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR t.id_ = #{search})
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | -        <if test="isSupportExtraPracticeLesson != null">
 | 
	
		
			
				|  |  | -            AND is_support_extra_practice_lesson_ = #{isSupportExtraPracticeLesson}
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            su.del_flag_ = 0
 | 
	
		
			
				|  |  | +            <if test="organId != null and organId != ''">
 | 
	
		
			
				|  |  | +                AND (INTE_ARRAY(#{organId},t.flow_organ_range_) OR FIND_IN_SET(t.organ_id_,#{organId}))
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="subjectId != null">
 | 
	
		
			
				|  |  | +                AND FIND_IN_SET(#{subjectId},t.subject_id_)
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="jobNature != null">
 | 
	
		
			
				|  |  | +                AND t.job_nature_ = #{jobNature}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="isProbationPeriod != null">
 | 
	
		
			
				|  |  | +                AND t.is_probation_period_ = #{isProbationPeriod}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="isSupportExtraPracticeLesson != null">
 | 
	
		
			
				|  |  | +                AND t.is_support_extra_practice_lesson_ = #{isSupportExtraPracticeLesson}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="lockFlag != null">
 | 
	
		
			
				|  |  | +                AND su.lock_flag_ = #{lockFlag}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="teacherId != null">
 | 
	
		
			
				|  |  | +                AND t.id_ IN
 | 
	
		
			
				|  |  | +                <foreach collection="teacherId" separator="," open="(" close=")" item="item">
 | 
	
		
			
				|  |  | +                    #{item}
 | 
	
		
			
				|  |  | +                </foreach>
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="search != null">
 | 
	
		
			
				|  |  | +                AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR t.id_ = #{search})
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  |      </sql>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 根据证件号查询老师 -->
 | 
	
	
		
			
				|  | @@ -361,18 +375,6 @@
 | 
	
		
			
				|  |  |          <result property="subjectNames" column="subject_names_"/>
 | 
	
		
			
				|  |  |          <result property="introduction" column="introduction_"/>
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  | -    <select id="findTeachers" resultMap="TeacherBasicDto">
 | 
	
		
			
				|  |  | -        SELECT su.id_,su.username_,su.real_name_,t.organ_id_ FROM sys_user su
 | 
	
		
			
				|  |  | -        LEFT JOIN teacher t ON su.id_=t.id_
 | 
	
		
			
				|  |  | -        <where>
 | 
	
		
			
				|  |  | -            <if test="userIds != null">
 | 
	
		
			
				|  |  | -                su.id_ IN
 | 
	
		
			
				|  |  | -                <foreach collection="userIds" separator="," open="(" close=")" item="item">
 | 
	
		
			
				|  |  | -                    #{item}
 | 
	
		
			
				|  |  | -                </foreach>
 | 
	
		
			
				|  |  | -            </if>
 | 
	
		
			
				|  |  | -        </where>
 | 
	
		
			
				|  |  | -    </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="findSimpleTeachers" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">
 | 
	
		
			
				|  |  |          SELECT su.id_ userId,su.real_name_ userName FROM sys_user su
 | 
	
	
		
			
				|  | @@ -759,23 +761,10 @@
 | 
	
		
			
				|  |  |                  and FIND_IN_SET(organ_id_,#{organId})
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | -    <select id="findByFlowOrganRange" resultMap="Teacher">
 | 
	
		
			
				|  |  | -        SELECT id_,CONCAT(IF(flow_organ_range_ IS NULL OR flow_organ_range_ = '',0,flow_organ_range_),",",
 | 
	
		
			
				|  |  | -        IF(organ_id_ IS NULL OR organ_id_ = '',0,organ_id_)) flow_organ_range_ FROM teacher t
 | 
	
		
			
				|  |  | -        <where>
 | 
	
		
			
				|  |  | -            <if test="subjectId != null">
 | 
	
		
			
				|  |  | -                AND FIND_IN_SET(#{subjectId},t.subject_id_)
 | 
	
		
			
				|  |  | -            </if>
 | 
	
		
			
				|  |  | -            <if test="jobNature != null">
 | 
	
		
			
				|  |  | -                AND t.job_nature_ = #{jobNature}
 | 
	
		
			
				|  |  | -            </if>
 | 
	
		
			
				|  |  | -            <if test="isProbationPeriod != null">
 | 
	
		
			
				|  |  | -                AND t.is_probation_period_ = #{isProbationPeriod}
 | 
	
		
			
				|  |  | -            </if>
 | 
	
		
			
				|  |  | -            <if test="isSupportExtraPracticeLesson != null">
 | 
	
		
			
				|  |  | -                AND t.is_support_extra_practice_lesson_ = #{isSupportExtraPracticeLesson}
 | 
	
		
			
				|  |  | -            </if>
 | 
	
		
			
				|  |  | -        </where>
 | 
	
		
			
				|  |  | +    <select id="findByFlowOrganRangeTeachers" resultMap="TeacherBasicDto">
 | 
	
		
			
				|  |  | +        SELECT su.id_,su.username_,su.real_name_,t.organ_id_ FROM teacher t
 | 
	
		
			
				|  |  | +        LEFT JOIN sys_user su ON t.id_ = su.id_
 | 
	
		
			
				|  |  | +        WHERE su.del_flag_ = 0 AND (INTE_ARRAY(#{organId},t.flow_organ_range_) OR FIND_IN_SET(t.organ_id_,#{organId}))
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="findByTeacherIds" resultMap="Teacher">
 | 
	
	
		
			
				|  | @@ -1212,4 +1201,5 @@
 | 
	
		
			
				|  |  |          gender_,user_type_
 | 
	
		
			
				|  |  |          FROM sys_user WHERE phone_ = #{phone}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  </mapper>
 |