|
@@ -1,232 +0,0 @@
|
|
|
-<?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.web.dal.dao.TeacherDao">
|
|
|
-
|
|
|
- <resultMap type="com.ym.mec.web.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="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" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
- <result column="nation_" property="nation"/>
|
|
|
- <result column="birthdate_" property="birthdate"/>
|
|
|
- <result column="email_" property="email"/>
|
|
|
- <result column="im_token_" property="imToken"/>
|
|
|
- </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_,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 id="findAll" resultMap="Teacher">
|
|
|
- SELECT * FROM teacher ORDER BY user_id_
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 向数据库增加一条记录 -->
|
|
|
- <insert id="insert" parameterType="com.ym.mec.web.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>
|
|
|
-
|
|
|
- <!-- 根据主键查询一条记录 -->
|
|
|
- <update id="update" parameterType="com.ym.mec.web.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, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </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.*,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_
|
|
|
- <include refid="queryPageMap"/>
|
|
|
- <include refid="global.limit"/>
|
|
|
- </select>
|
|
|
-
|
|
|
- <sql id="queryPageMap">
|
|
|
- <where>
|
|
|
- <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 o.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>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
-
|
|
|
- <!-- 查询当前表的总记录数 -->
|
|
|
- <select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(t.id_) FROM teacher t
|
|
|
- LEFT JOIN sys_user su ON t.id_ = su.id_
|
|
|
- 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 id="findByCertificateNum" resultMap="Teacher">
|
|
|
- SELECT * FROM teacher WHERE certificate_num_ = #{certificateNum}
|
|
|
- </select>
|
|
|
-</mapper>
|