|
|
@@ -0,0 +1,113 @@
|
|
|
+<?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.BaseNewStudentMapper">
|
|
|
+ <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
|
|
|
+ SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
|
|
|
+ t1.score,t1.graduate_class,t1.source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t1.first_ambition,
|
|
|
+ t1.second_ambition,t1.is_adjust,t1.status FROM base_new_student t1
|
|
|
+ LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
|
|
|
+ LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
|
|
|
+ WHERE t1.delete_mark = 0
|
|
|
+ <if test="dto.name != null and dto.name != ''">
|
|
|
+ and t1.name like concat('%', #{dto.name}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
|
|
|
+ and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="dto.isImportScore != null">
|
|
|
+ <if test="dto.isImportScore == 1">
|
|
|
+ and t1.score is not null
|
|
|
+ </if>
|
|
|
+ <if test="dto.isImportScore == 0">
|
|
|
+ and t1.score is null
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
|
|
|
+ and t1.first_ambition = #{dto.firstAmbition}
|
|
|
+ </if>
|
|
|
+ <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
|
|
|
+ and t1.second_ambition = #{dto.secondAmbition}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="dto.startDate != null and dto.endDate != null">
|
|
|
+ AND t1.create_date between #{dto.startDate} and #{dto.endDate}
|
|
|
+ </if>
|
|
|
+ <if test="dto.gender != null and dto.gender != ''">
|
|
|
+ AND t1.gender = #{dto.gender}
|
|
|
+ </if>
|
|
|
+ <if test="dto.status != null">
|
|
|
+ AND t1.status = #{dto.status}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getInfo" resultType="com.xjrsoft.module.student.vo.BaseStudentBehaviorManageVo">
|
|
|
+ SELECT t.id, t2.score_type, t1.sort_code,
|
|
|
+ t.file_id, t.assessment_address, t3.name AS semester_name,
|
|
|
+ t.assessment_date, t.score, t.score_number, t.total_score, t4.name AS grade_name,
|
|
|
+ t.is_affect, t1.name AS behaviorCategoryName, t2.name AS behaviorProjectName,
|
|
|
+ (
|
|
|
+ SELECT GROUP_CONCAT(b.name) FROM base_student_behavior_class_relation a
|
|
|
+ LEFT JOIN base_class b ON a.class_id = b.id
|
|
|
+ WHERE a.base_student_behavior_manage_id = t.id GROUP BY a.base_student_behavior_manage_id
|
|
|
+ ) AS asbinarysessment_class_names,
|
|
|
+ (
|
|
|
+ SELECT name FROM xjr_user WHERE id = t.assessment_user_id
|
|
|
+ ) AS assessment_user_name
|
|
|
+ FROM base_student_behavior_manage t
|
|
|
+ LEFT JOIN base_student_behavior_category t1 ON t1.id = t.base_student_behavior_category_id
|
|
|
+ LEFT JOIN base_student_behavior_project t2 ON t2.id = t.base_student_behavior_project_id
|
|
|
+ LEFT JOIN base_semester t3 ON t3.id = t.base_semester_id
|
|
|
+ LEFT JOIN base_grade t4 ON t.grade_id = t4.id
|
|
|
+ WHERE t.delete_mark = 0 AND t1.delete_mark = 0 AND t2.delete_mark = 0 AND t.status = 1
|
|
|
+ AND t.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentBehaviorManageMobilePageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentBehaviorManageMobilePageVo">
|
|
|
+ SELECT t1.sort_code,t1.name,t1.class_name,t.assessment_date,
|
|
|
+ t3.name AS categoryName,t4.name AS projectName,t.score,t4.score_type,
|
|
|
+ t2.name AS assessmentUserName,
|
|
|
+ t.assessment_address,
|
|
|
+ t3.name AS behaviorCategoryName,
|
|
|
+ t4.name AS behaviorProjectName
|
|
|
+ FROM base_student_behavior_manage t
|
|
|
+ INNER JOIN base_student_behavior_student_relation t1 ON t1.base_student_behavior_manage_id = t.id
|
|
|
+ <if test="dto.studentName != null and dto.studentName != ''">
|
|
|
+ and t1.name like concat('%',#{dto.studentName},'%')
|
|
|
+ </if>
|
|
|
+ LEFT JOIN xjr_user t2 ON t2.id = t.assessment_user_id
|
|
|
+ LEFT JOIN base_student_behavior_category t3 ON t3.id = t.base_student_behavior_category_id
|
|
|
+ LEFT JOIN base_student_behavior_project t4 ON t4.id = t.base_student_behavior_project_id
|
|
|
+ LEFT JOIN base_student_school_roll t5 ON t1.user_id = t5.user_id
|
|
|
+ WHERE t.status = 1 AND t.delete_mark = 0 AND t3.delete_mark = 0
|
|
|
+ AND t5.class_id IN (
|
|
|
+ SELECT id FROM base_class WHERE teacher_id = #{dto.teacherId}
|
|
|
+ )
|
|
|
+ <if test="dto.gradeIds != null and dto.gradeIds.size() > 0">
|
|
|
+ AND t5.grade_id in
|
|
|
+ <foreach item="gradeId" index="index" collection="dto.gradeIds" open="(" close=")" separator=",">
|
|
|
+ #{gradeId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="dto.classIds != null and dto.classIds.size() > 0">
|
|
|
+ AND t5.class_id in
|
|
|
+ <foreach item="classId" index="index" collection="dto.classIds" open="(" close=")" separator=",">
|
|
|
+ #{classId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="dto.assessmentUserIds != null and dto.assessmentUserIds.size() > 0">
|
|
|
+ AND t.assessment_user_id in
|
|
|
+ <foreach item="assessmentUserId" index="index" collection="dto.assessmentUserIds" open="(" close=")" separator=",">
|
|
|
+ #{assessmentUserId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="dto.startDate != null and dto.startDate != ''">
|
|
|
+ and t.assessment_date >= #{dto.startDate}
|
|
|
+ </if>
|
|
|
+ <if test="dto.endDate != null and dto.endDate != ''">
|
|
|
+ and t.assessment_date <= #{dto.endDate}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|