| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper">
- <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,
- CONCAT(t5.name, ' ', t5.mobile) AS teacher_name,
- t4.name AS class_name,
- t6.mobile AS guardian_phone
- 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
- LEFT JOIN base_student_family_member t6 ON t6.user_id = t2.id AND t6.delete_mark = 0 AND t6.is_guardian = 1
- 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('%', #{dto.keyWord}, '%')
- or t2.name like concat('%', #{dto.keyWord}, '%')
- or t5.name like concat('%', #{dto.keyWord}, '%')
- or t1.student_id like concat('%', #{dto.keyWord}, '%')
- or t2.mobile like concat('%', #{dto.keyWord}, '%')
- or t6.mobile LIKE concat('%', #{dto.keyWord}, '%')
- )
- </if>
- </select>
- <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,
- t8.name AS archives_status,t7.name AS stduy_status,t9.name AS roll_modality,t2.birth_date, t2.gender,t2.avatar,
- t6.name AS nation,t10.name AS major_set_name,t3.archives_status as archivesStatusCode,t3.stduy_status as stduyStatusCode,t3.roll_modality as rollModalityCode
- 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
- LEFT JOIN xjr_dictionary_detail t6 ON t6.code = t1.nation AND t6.item_id = 2023000000000000008
- LEFT JOIN xjr_dictionary_detail t7 ON t7.code = t3.stduy_status AND t7.item_id = 2023000000000000030
- LEFT JOIN xjr_dictionary_detail t8 ON t8.code = t3.archives_status AND t8.item_id = 2023000000000000029
- LEFT JOIN xjr_dictionary_detail t9 ON t9.code = t3.roll_modality AND t9.item_id = 1762024751192084482
- LEFT JOIN base_major_set t10 ON t3.major_set_id = t10.id
- WHERE t2.id = #{id}
- </select>
- <update id="updateInfoByUserId" parameterType="com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto">
- UPDATE base_student_school_roll SET delete_mark = delete_mark
- <if test="dto.rollModality != null and dto.rollModality != ''">,roll_modality = #{dto.rollModality} </if>
- <if test="dto.archivesStatus != null and dto.archivesStatus != ''">,archives_status = #{dto.archivesStatus} </if>
- <if test="dto.stduyStatus != null and dto.stduyStatus != ''">,stduy_status = #{dto.stduyStatus} </if>
- where user_id = #{id}
- </update>
- </mapper>
|