|
@@ -9,6 +9,7 @@
|
|
|
<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"/>
|
|
@@ -25,11 +26,33 @@
|
|
|
<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 * FROM teacher WHERE user_id_ = #{userId}
|
|
|
+ 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.user_id_ = #{userId} AND o.del_flag_ = 0
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -40,11 +63,6 @@
|
|
|
|
|
|
<insert id="insert" parameterType="com.ym.mec.web.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
|
|
|
keyProperty="id">
|
|
|
-
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
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())
|
|
@@ -107,19 +125,104 @@
|
|
|
</update>
|
|
|
|
|
|
|
|
|
- <delete id="delete">
|
|
|
- DELETE FROM teacher WHERE user_id_ = #{userId}
|
|
|
- </delete>
|
|
|
+ <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 * FROM teacher ORDER BY user_id_
|
|
|
+ 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(*) FROM teacher
|
|
|
+ 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>
|
|
|
|
|
|
|