|
@@ -42,6 +42,9 @@
|
|
|
<result column="birthdate_" property="birthdate"/>
|
|
|
<result column="email_" property="email"/>
|
|
|
<result column="im_token_" property="imToken"/>
|
|
|
+ <collection property="subjectName" ofType="string">
|
|
|
+ <result column="subject_name_"/>
|
|
|
+ </collection>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -196,10 +199,11 @@
|
|
|
<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_
|
|
|
+ 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_)
|
|
|
<include refid="queryPageMap"/>
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
@@ -248,14 +252,4 @@
|
|
|
AND su.username_ LIKE CONCAT('%',#{search},'%')
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
- <resultMap id="namesDto" type="com.ym.mec.biz.dal.dto.NamesDto">
|
|
|
- <result property="id" column="id_"/>
|
|
|
- <collection property="names" javaType="list" ofType="string" column="name_"/>
|
|
|
- </resultMap>
|
|
|
- <select id="getTeacherSubNames" resultMap="namesDto">
|
|
|
- SELECT s.name_,t.id_ FROM teacher t
|
|
|
- LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)
|
|
|
- WHERE t.id_ IN (#{teacherIds})
|
|
|
- </select>
|
|
|
</mapper>
|