|
@@ -51,11 +51,10 @@
|
|
|
<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_
|
|
|
+ su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_
|
|
|
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
|
|
|
+ WHERE t.id_ = #{userId} AND su.del_flag_ = 0
|
|
|
</select>
|
|
|
|
|
|
<!-- 全查询 -->
|
|
@@ -199,44 +198,36 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<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_
|
|
|
- FROM teacher t
|
|
|
- LEFT JOIN sys_user su ON t.id_ = su.id_
|
|
|
- LEFT JOIN organization o ON t.organ_id_ = o.id_
|
|
|
- LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)
|
|
|
+ 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">
|
|
|
- <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>
|
|
|
+ <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_
|
|
|
- LEFT JOIN `subject` s ON t.subject_id_ = s.id_
|
|
|
- LEFT JOIN organization o ON t.organ_id_ = o.id_
|
|
|
+ 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>
|
|
|
|