| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315 | 
							- <?xml version="1.0" encoding="UTF-8" ?>
 
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
- <!--
 
- 这个文件是自动生成的。
 
- 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 
- -->
 
- <mapper namespace="com.ym.mec.biz.dal.dao.TeacherDao">
 
-     <resultMap type="com.ym.mec.biz.dal.entity.Teacher" id="Teacher">
 
-         <result column="id_" property="id"/>
 
-         <result column="organ_id_" property="organId"/>
 
-         <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="education_background_" property="educationBackground"/>
 
-         <result column="graduate_school_" property="graduateSchool"/>
 
-         <result column="technical_titles_" property="technicalTitles"/>
 
-         <result column="work_unit_" property="workUnit"/>
 
-         <result column="subject_id_" property="subjectId"/>
 
-         <result column="entry_date_" property="entryDate"/>
 
-         <result column="demission_date_" property="demissionDate"/>
 
-         <result column="certificate_type_" property="certificateType"/>
 
-         <result column="certificate_num_" property="certificateNum"/>
 
-         <result column="flow_organ_range_" property="flowOrganRange"/>
 
-         <result column="introduction_" property="introduction"/>
 
-         <result column="update_time_" property="updateTime"/>
 
-         <result column="create_time_" property="createTime"/>
 
-         <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"/>
 
-         <result column="lock_flag_" property="lockFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 
-         <result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 
-         <result column="wx_openid_" property="wxOpenid"/>
 
-         <result column="qq_openid_" property="qqOpenid"/>
 
-         <result column="user_type_" property="userType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 
-         <result column="gender_" property="gender"/>
 
-         <result column="nation_" property="nation"/>
 
-         <result column="birthdate_" property="birthdate"/>
 
-         <result column="email_" property="email"/>
 
-         <result column="im_token_" property="imToken"/>
 
-         <collection property="subjectName" ofType="string" column="subject_name_"/>
 
-     </resultMap>
 
-     <!-- 根据主键查询一条记录 -->
 
-     <select id="get" resultMap="Teacher">
 
-         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_
 
-         FROM teacher t
 
-         LEFT JOIN sys_user su ON t.id_ = su.id_
 
-         WHERE t.id_ = #{userId} AND su.del_flag_ = 0
 
-     </select>
 
-     <!-- 全查询 -->
 
-     <select id="findAll" resultMap="Teacher">
 
-         SELECT *
 
-         FROM teacher
 
-         ORDER BY user_id_
 
-     </select>
 
-     <!-- 向数据库增加一条记录 -->
 
-     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
 
-             keyProperty="id">
 
-         INSERT INTO teacher
 
-         (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_)
 
-         VALUES(#{id},#{organId},#{jobType},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now())
 
-     </insert>
 
-     <insert id="addSysUser" parameterType="com.ym.mec.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
 
-             keyProperty="id">
 
-         INSERT INTO sys_user
 
-         (im_token_,id_,username_,salt_,phone_,avatar_,organ_id_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,gender_,nation_,birthdate_,email_,id_card_no_,esign_id_,wechat_id_,real_name_,password_)
 
-         VALUES(#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},#{organId},now(),now(),#{wxOpenid},#{qqOpenid},#{userType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 
-         #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{esignId},#{wechatId},#{realName},#{password})
 
-     </insert>
 
-     <!-- 根据主键查询一条记录 -->
 
-     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Teacher">
 
-         UPDATE teacher
 
-         <set>
 
-             <if test="graduateSchool != null">
 
-                 graduate_school_ = #{graduateSchool},
 
-             </if>
 
-             <if test="subjectId != null">
 
-                 subject_id_ = #{subjectId},
 
-             </if>
 
-             <if test="organId != null">
 
-                 organ_id_ = #{organId},
 
-             </if>
 
-             <if test="technicalTitles != null">
 
-                 technical_titles_ = #{technicalTitles},
 
-             </if>
 
-             <if test="entryDate != null">
 
-                 entry_date_ = #{entryDate},
 
-             </if>
 
-             <if test="demissionDate != null">
 
-                 demission_date_ = #{demissionDate},
 
-             </if>
 
-             <if test="jobType != null">
 
-                 job_type_ = #{jobType},
 
-             </if>
 
-             <if test="flowOrganRange != null">
 
-                 flow_organ_range_ = #{flowOrganRange},
 
-             </if>
 
-             <if test="certificateType != null">
 
-                 certificate_type_ = #{certificateType},
 
-             </if>
 
-             <if test="jobNature != null">
 
-                 job_nature_ = #{jobNature},
 
-             </if>
 
-             <if test="isProbationPeriod != null">
 
-                 is_probation_period_ = #{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 
-             </if>
 
-             <if test="updateTime != null">
 
-                 update_time_ = #{updateTime},
 
-             </if>
 
-             <if test="educationBackground != null">
 
-                 education_background_ = #{educationBackground},
 
-             </if>
 
-             <if test="certificateNum != null">
 
-                 certificate_num_ = #{certificateNum},
 
-             </if>
 
-             <if test="workUnit != null">
 
-                 work_unit_ = #{workUnit},
 
-             </if>
 
-             <if test="introduction != null">
 
-                 introduction_ = #{introduction},
 
-             </if>
 
-         </set>
 
-         WHERE user_id_ = #{userId}
 
-     </update>
 
-     <!-- 根据主键删除一条记录 -->
 
-     <update id="delete">
 
-         DELETE FROM teacher WHERE user_id_ = #{userId}
 
-     </update>
 
-     <update id="updateUser" parameterType="com.ym.mec.auth.api.entity.SysUser">
 
-         UPDATE sys_user
 
-         <set>
 
-             <if test="delFlag != null">
 
-                 del_flag_ = #{delFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 
-             </if>
 
-             <if test="wxOpenid != null">
 
-                 wx_openid_ = #{wxOpenid},
 
-             </if>
 
-             <if test="avatar != null">
 
-                 avatar_ = #{avatar},
 
-             </if>
 
-             <if test="email != null">
 
-                 email_ = #{email},
 
-             </if>
 
-             <if test="gender != null">
 
-                 gender_ = #{gender},
 
-             </if>
 
-             <if test="salt != null">
 
-                 salt_ = #{salt},
 
-             </if>
 
-             <if test="username != null">
 
-                 username_ = #{username},
 
-             </if>
 
-             <if test="userType != null">
 
-                 user_type_ = #{userType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 
-             </if>
 
-             <if test="updateTime != null">
 
-                 update_time_ = #{updateTime},
 
-             </if>
 
-             <if test="lockFlag != null">
 
-                 lock_flag_ = #{lockFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 
-             </if>
 
-             <if test="birthdate != null">
 
-                 birthdate_ = #{birthdate},
 
-             </if>
 
-             <if test="phone != null">
 
-                 phone_ = #{phone},
 
-             </if>
 
-             <if test="qqOpenid != null">
 
-                 qq_openid_ = #{qqOpenid},
 
-             </if>
 
-             <if test="nation != null">
 
-                 nation_ = #{nation},
 
-             </if>
 
-             <if test="organId != null">
 
-                 organ_id_ = #{organId},
 
-             </if>
 
-             <if test="imToken != null">
 
-                 im_token_ = #{imToken},
 
-             </if>
 
-         </set>
 
-         WHERE id_ = #{id}
 
-     </update>
 
-     <!-- 分页查询 -->
 
-     <select id="queryPage" resultMap="Teacher" parameterType="map">
 
-         SELECT t.id_,su.real_name_,su.lock_flag_,t.subject_id_,su.phone_,su.organ_id_,t.job_nature_,t.is_probation_period_
 
-         FROM teacher t LEFT JOIN sys_user su ON t.id_ = su.id_
 
-         WHERE su.user_type_ LIKE '%TEACHER%' AND su.del_flag_ = 0
 
-         <include refid="queryPageMap"/>
 
-         <include refid="global.limit"/>
 
-     </select>
 
-     <sql id="queryPageMap">
 
-         <if test="lockFlag != null">
 
-             AND su.lock_flag_ = #{lockFlag}
 
-         </if>
 
-         <if test="subjectId != null">
 
-             AND t.subject_id_ LIKE CONCAT('%',#{subjectId},'%')
 
-         </if>
 
-         <if test="organId != null">
 
-             AND su.organ_id_ = #{organId}
 
-         </if>
 
-         <if test="jobNature != null">
 
-             AND t.job_nature_ = #{jobNature}
 
-         </if>
 
-         <if test="isProbationPeriod != null">
 
-             AND t.is_probation_period_ = #{isProbationPeriod}
 
-         </if>
 
-     </sql>
 
-     <!-- 查询当前表的总记录数 -->
 
-     <select id="queryCount" resultType="int">
 
-         SELECT COUNT(t.id_)
 
-         FROM teacher t LEFT JOIN sys_user su ON t.id_ = su.id_
 
-         WHERE su.user_type_ LIKE '%TEACHER%' AND su.del_flag_ = 0
 
-         <include refid="queryPageMap"/>
 
-     </select>
 
-     <!-- 根据证件号查询老师 -->
 
-     <select id="findByCertificateNum" resultMap="Teacher">
 
-         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_
 
-         LEFT JOIN sys_user su ON cgsm.user_id_ = su.id_
 
-         LEFT JOIN student_registration sr ON sr.user_id_ = su.id_
 
-         LEFT JOIN `subject` s ON s.id_ = sr.actual_subject_id_
 
-         WHERE cgtm.user_id_ = #{teacherId}
 
-         <if test="search != null">
 
-             AND su.username_ LIKE CONCAT('%',#{search},'%')
 
-         </if>
 
-     </select>
 
-     <select id="queryNameByIds" resultType="java.util.Map" parameterType="list">
 
-         select id_ `key`,real_name_ `value` FROM sys_user s WHERE id_ IN
 
-         <foreach item="item" index="index" collection="userIds" open="(" separator="," close=")">
 
-             #{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>
 
-     <select id="countCloses" resultType="java.lang.Integer">
 
-         SELECT COUNT(cs.id_)
 
-         FROM course_schedule cs
 
-         LEFT JOIN course_schedule_teacher_salary csts ON cs.id_ = csts.course_schedule_id_
 
-         LEFT JOIN teacher_attendance ta ON cs.id_ = ta.course_schedule_id_
 
-         LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
 
-         <include refid="queryCloses"/>
 
-     </select>
 
-     <resultMap id="TeacherCloseDto" type="com.ym.mec.biz.dal.dto.TeacherCloseDto">
 
-         <result property="classDate" column="class_date_"/>
 
-         <result property="classTime" column="start_class_time_"/>
 
-         <result property="className" column="class_name_"/>
 
-         <result property="courseScheduleType" column="class_type_"/>
 
-         <result property="teacherRole" column="teacher_role_"/>
 
-         <result property="currentClassTimes" column="current_class_times_"/>
 
-         <result property="totalClassTimes" column="total_class_times_"/>
 
-         <result property="signInStatus" column="sign_in_status_"/>
 
-         <result property="signOutStatus" column="sign_out_status_"/>
 
-         <result property="actualSalary" column="actual_salary_"/>
 
-         <result property="subsidy" column="subsidy_"/>
 
-         <result property="settlementTime" column="settlement_time_"/>
 
-     </resultMap>
 
-     <select id="queryCloses" resultMap="TeacherCloseDto">
 
-         SELECT cs.class_date_,cs.start_class_time_,cg.name_ class_name_,cs.type_ class_type_,
 
-         csts.teacher_role_,cg.current_class_times_,cg.total_class_times_,
 
-         ta.sign_in_status_,ta.sign_out_status_,csts.actual_salary_,csts.settlement_time_,csts.subsidy_
 
-         FROM course_schedule cs
 
-         LEFT JOIN course_schedule_teacher_salary csts ON cs.id_ = csts.course_schedule_id_
 
-         LEFT JOIN teacher_attendance ta ON cs.id_ = ta.course_schedule_id_
 
-         LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
 
-         <include refid="queryCloses"/>
 
-         <include refid="global.limit"/>
 
-     </select>
 
-     <sql id="queryCloses">
 
-         <where>
 
-             <if test="teacherId != null">
 
-                 AND cs.actual_teacher_id_ = #{teacherId}
 
-             </if>
 
-             <if test="courseStartDate != null and courseStartDate != ''">
 
-                 AND cs.class_date_ >= #{courseStartDate}
 
-             </if>
 
-             <if test="courseEndDate != null and courseEndDate != ''">
 
-                 AND cs.class_date_ <= #{courseEndDate}
 
-             </if>
 
-             <if test="courseScheduleType != null and courseScheduleType != ''">
 
-                 AND cs.type_ = #{courseScheduleType}
 
-             </if>
 
-             <if test="teacherRole != null and teacherRole != ''">
 
-                 AND csts.teacher_role_ = #{teacherRole}
 
-             </if>
 
-         </where>
 
-     </sql>
 
- </mapper>
 
 
  |