|
@@ -4,15 +4,40 @@
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper">
|
|
<mapper namespace="com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper">
|
|
|
<select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoPageVo">
|
|
<select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoPageVo">
|
|
|
- SELECT t2.id,t2.name AS student_name,t1.student_id,t2.mobile AS phone,t5.name AS teacher_name,t4.name AS class_name,
|
|
|
|
|
|
|
+ SELECT t2.id,t2.name AS student_name,t1.student_id,t2.mobile AS phone,concat(t5.name, ' ', t5.mobile) AS teacher_name,t4.name AS class_name,
|
|
|
(SELECT mobile FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t2.id AND is_guardian = 1) AS guardian_phone FROM base_student t1
|
|
(SELECT mobile FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t2.id AND is_guardian = 1) AS guardian_phone FROM base_student t1
|
|
|
INNER JOIN xjr_user t2 ON t1.user_id = t2.id
|
|
INNER JOIN xjr_user t2 ON t1.user_id = t2.id
|
|
|
INNER JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
|
|
INNER JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
|
|
|
LEFT JOIN base_class t4 ON t3.class_id = t4.id
|
|
LEFT JOIN base_class t4 ON t3.class_id = t4.id
|
|
|
LEFT JOIN xjr_user t5 ON t4.teacher_id = t5.id
|
|
LEFT JOIN xjr_user t5 ON t4.teacher_id = t5.id
|
|
|
WHERE t2.delete_mark = 0 AND t1.delete_mark = 0
|
|
WHERE t2.delete_mark = 0 AND t1.delete_mark = 0
|
|
|
|
|
+ <if test="dto.gradeId != null">
|
|
|
|
|
+ and t4.grade_id = #{dto.gradeId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="dto.majorSetId != null">
|
|
|
|
|
+ and t3.major_set_id = #{dto.majorSetId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="dto.classId != null">
|
|
|
|
|
+ and t4.id = #{dto.classId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="dto.keyWord != null and dto.keyWord != ''">
|
|
|
|
|
+ and (t4.name like concat('%', #{keyWord}, '%')
|
|
|
|
|
+ or t2.name like concat('%', #{keyWord}, '%')
|
|
|
|
|
+ or t5.teacher_name like concat('%', #{keyWord}, '%')
|
|
|
|
|
+ or t2.student_id like concat('%', #{keyWord}, '%')
|
|
|
|
|
+ or t2.mobile like concat('%', #{keyWord}, '%')
|
|
|
|
|
+ or (SELECT mobile FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t2.id AND is_guardian = 1 and mobile like concat('%', #{keyWord}, '%'))
|
|
|
|
|
+ )
|
|
|
|
|
+ </if>
|
|
|
</select>
|
|
</select>
|
|
|
- <!--姓名和性别,测试阶段采用姓名第一个字拼接user_id的方式脱敏-->
|
|
|
|
|
- <select id="getJianyueStudentList" resultType="com.xjrsoft.module.schedule.vo.StudentJianyuekbVo">
|
|
|
|
|
|
|
+ <select id="getInfoById" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo">
|
|
|
|
|
+ SELECT t2.id,t2.name AS student_name,t1.student_id,t2.mobile AS phone,CONCAT(t5.name, ' ', t5.mobile) AS teacher_name,t4.name AS class_name,
|
|
|
|
|
+ (SELECT mobile FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t2.id AND is_guardian = 1) AS guardian_phone,
|
|
|
|
|
+ t3.archives_status,t3.stduy_status,t3.roll_modality FROM base_student t1
|
|
|
|
|
+ INNER JOIN xjr_user t2 ON t1.user_id = t2.id
|
|
|
|
|
+ INNER JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
|
|
|
|
|
+ LEFT JOIN base_class t4 ON t3.class_id = t4.id
|
|
|
|
|
+ LEFT JOIN xjr_user t5 ON t4.teacher_id = t5.id
|
|
|
|
|
+ WHERE t2.id = #{id}
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|