|
@@ -264,10 +264,12 @@
|
|
|
|
|
|
<select id="findTeachers" resultMap="Teacher">
|
|
|
SELECT su.* FROM teacher t
|
|
|
- LEFT JOIN sys_user su on t.id_ = su.id_ WHERE 1=1
|
|
|
- <if test="organId != null and organId !=0">
|
|
|
- AND t.organ_id_ = #{organId}
|
|
|
- </if>
|
|
|
+ LEFT JOIN sys_user su on t.id_ = su.id_
|
|
|
+ <where>
|
|
|
+ <if test="organId != null and organId !=0">
|
|
|
+ t.organ_id_ = #{organId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
<select id="countCloses" resultType="java.lang.Integer">
|
|
|
SELECT COUNT(cs.id_)
|
|
@@ -306,19 +308,20 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findTeacherNoPay" resultType="decimal">
|
|
|
- SELECT SUM(expect_salary_) FROM course_schedule_teacher_salary csts WHERE settlement_time_ IS NULL AND user_id_ = #{teacherId}
|
|
|
+ SELECT SUM(expect_salary_) FROM course_schedule_teacher_salary csts WHERE settlement_time_ IS NULL AND user_id_
|
|
|
+ = #{teacherId}
|
|
|
</select>
|
|
|
|
|
|
<select id="findTeacherByMusicGroup" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
|
|
|
SELECT
|
|
|
- su.id_ user_id_,
|
|
|
- su.username_
|
|
|
+ su.id_ user_id_,
|
|
|
+ su.username_
|
|
|
FROM
|
|
|
- class_group_teacher_mapper cgtm
|
|
|
- LEFT JOIN class_group cg ON cg.id_=cgtm.class_group_id_
|
|
|
- LEFT JOIN sys_user su ON cgtm.user_id_=su.id_
|
|
|
- WHERE cg.music_group_id_=#{musicGroupId}
|
|
|
- GROUP BY su.id_
|
|
|
+ class_group_teacher_mapper cgtm
|
|
|
+ LEFT JOIN class_group cg ON cg.id_=cgtm.class_group_id_
|
|
|
+ LEFT JOIN sys_user su ON cgtm.user_id_=su.id_
|
|
|
+ WHERE cg.music_group_id_=#{musicGroupId}
|
|
|
+ GROUP BY su.id_
|
|
|
</select>
|
|
|
<resultMap id="MusicGroupTeachersDto" type="com.ym.mec.biz.dal.dto.MusicGroupTeachersDto">
|
|
|
<result property="teacherName" column="real_name_"/>
|
|
@@ -349,13 +352,14 @@
|
|
|
<sql id="queryMusicGroupTeachersSql">
|
|
|
<where>
|
|
|
<if test="search != null and search != ''">
|
|
|
- AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR su.id_=#{search})
|
|
|
+ AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR
|
|
|
+ su.id_=#{search})
|
|
|
</if>
|
|
|
<if test="musicGroupId != null and musicGroupId != ''">
|
|
|
AND cgtm.music_group_id_ = #{musicGroupId}
|
|
|
</if>
|
|
|
<if test="classGroupId != null">
|
|
|
- AND cg.id_ = #{classGroupId}
|
|
|
+ AND cg.id_ = #{classGroupId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
@@ -497,13 +501,14 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<select id="queryOrganTeacherNum" resultType="map">
|
|
|
- select count(*) total,sum(case when job_nature_ = 'PART_TIME' then 1 else 0 end) part_time_num_,sum(case when job_nature_ = 'FULL_TIME' then 1 else 0 end) full_time_num_ from teacher
|
|
|
- <where>
|
|
|
- <if test="organId != null">
|
|
|
- organ_id_ = #{organId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ select count(*) total,sum(case when job_nature_ = 'PART_TIME' then 1 else 0 end) part_time_num_,sum(case when
|
|
|
+ job_nature_ = 'FULL_TIME' then 1 else 0 end) full_time_num_ from teacher
|
|
|
+ <where>
|
|
|
+ <if test="organId != null">
|
|
|
+ organ_id_ = #{organId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
</mapper>
|