|
@@ -12,7 +12,8 @@
|
|
|
<result column="organ_name_" property="organName"/>
|
|
|
<result column="job_type_" property="jobType"/>
|
|
|
<result column="job_nature_" property="jobNature"/>
|
|
|
- <result column="is_probation_period_" property="isProbationPeriod" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="is_probation_period_" property="isProbationPeriod"
|
|
|
+ typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="education_background_" property="educationBackground"/>
|
|
|
<result column="graduate_school_" property="graduateSchool"/>
|
|
|
<result column="technical_titles_" property="technicalTitles"/>
|
|
@@ -29,6 +30,7 @@
|
|
|
|
|
|
<result column="username_" property="username"/>
|
|
|
<result column="password_" property="password"/>
|
|
|
+ <result column="real_name_" property="realName"/>
|
|
|
<result column="salt_" property="salt"/>
|
|
|
<result column="phone_" property="phone"/>
|
|
|
<result column="avatar_" property="avatar"/>
|
|
@@ -47,19 +49,21 @@
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<select id="get" resultMap="Teacher">
|
|
|
- SELECT t.*,su.username_,su.password_,su.salt_,su.phone_,su.avatar_,
|
|
|
+ SELECT t.*,su.username_,su.password_,su.salt_,su.phone_,su.avatar_,
|
|
|
su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
|
|
|
su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,t.subject_id_,t.organ_id_,o.name_ organ_name_
|
|
|
FROM teacher t
|
|
|
LEFT JOIN sys_user su ON t.id_ = su.id_
|
|
|
LEFT JOIN organization o ON t.organ_id_ = o.id_
|
|
|
WHERE t.id_ = #{userId} AND o.del_flag_ = 0
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="Teacher">
|
|
|
- SELECT * FROM teacher ORDER BY user_id_
|
|
|
- </select>
|
|
|
+ SELECT *
|
|
|
+ FROM teacher
|
|
|
+ ORDER BY user_id_
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
|
|
@@ -135,8 +139,8 @@
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<update id="delete">
|
|
|
- DELETE FROM teacher WHERE user_id_ = #{userId}
|
|
|
- </update>
|
|
|
+ DELETE FROM teacher WHERE user_id_ = #{userId}
|
|
|
+ </update>
|
|
|
|
|
|
<update id="updateUser" parameterType="com.ym.mec.auth.api.entity.SysUser">
|
|
|
UPDATE sys_user
|
|
@@ -197,7 +201,8 @@
|
|
|
<select id="queryPage" resultMap="Teacher" parameterType="map">
|
|
|
SELECT t.*,su.username_,su.password_,su.salt_,su.phone_,su.avatar_,
|
|
|
su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
|
|
|
- su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,t.subject_id_,t.organ_id_,o.name_ organ_name_,s.name_ subject_name_
|
|
|
+ su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,t.subject_id_,t.organ_id_,o.name_ organ_name_,s.name_
|
|
|
+ subject_name_
|
|
|
FROM teacher t
|
|
|
LEFT JOIN sys_user su ON t.id_ = su.id_
|
|
|
LEFT JOIN organization o ON t.organ_id_ = o.id_
|
|
@@ -233,12 +238,12 @@
|
|
|
LEFT JOIN `subject` s ON t.subject_id_ = s.id_
|
|
|
LEFT JOIN organization o ON t.organ_id_ = o.id_
|
|
|
<include refid="queryPageMap"/>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 根据证件号查询老师 -->
|
|
|
<select id="findByCertificateNum" resultMap="Teacher">
|
|
|
- SELECT * FROM teacher WHERE certificate_num_ = #{certificateNum}
|
|
|
- </select>
|
|
|
+ SELECT * FROM teacher WHERE certificate_num_ = #{certificateNum}
|
|
|
+ </select>
|
|
|
<select id="queryGroupStudents" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
|
|
|
SELECT su.username_,su.id_ user_id_,su.avatar_ head_url_,su.gender_,s.name_ FROM class_group_teacher_mapper cgtm
|
|
|
LEFT JOIN class_group_student_mapper cgsm ON cgtm.class_group_id_ = cgsm.class_group_id_
|
|
@@ -256,4 +261,12 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+
|
|
|
+ <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>
|
|
|
+ </select>
|
|
|
</mapper>
|