|
|
@@ -42,7 +42,7 @@
|
|
|
</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 t2.id,t2.name AS student_name,t1.student_id,t2.mobile AS phone,t5.name as teacher_name, t5.mobile AS teacher_phone,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
|
|
|
@@ -65,4 +65,69 @@
|
|
|
<if test="dto.stduyStatus != null and dto.stduyStatus != ''">,stduy_status = #{dto.stduyStatus} </if>
|
|
|
where user_id = #{id}
|
|
|
</update>
|
|
|
+
|
|
|
+ <select id="getGenderCount" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoCategoryVo">
|
|
|
+ SELECT t2.gender as category,COUNT(*) as number 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.teacherId != null">
|
|
|
+ and t4.teacher_id = #{dto.teacherId}
|
|
|
+ </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>
|
|
|
+ group by t2.gender
|
|
|
+ </select>
|
|
|
+ <select id="getStudyStatusCount" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoCategoryVo">
|
|
|
+ SELECT t3.stduy_status as category,COUNT(*) as number 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.teacherId != null">
|
|
|
+ and t4.teacher_id = #{dto.teacherId}
|
|
|
+ </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>
|
|
|
+ group by t3.stduy_status
|
|
|
+ </select>
|
|
|
</mapper>
|