123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <?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.BaseStudentAssessmentInspectionMapper">
- <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo">
- select t.id,t.score,t.score_type,t.assessment_date,t.reason,t1.name as assessment_category_name,t2.name as assessment_project_name,t3.name as semester_name,t4.name as grade_name,t5.name as assessment_user_name,t6.name as score_type_cn,
- (
- select group_concat(b.name) from base_student_assessment_class_relation a
- left join base_class b on a.class_id=b.id
- where a.base_student_assessment_inspection_id=t.id group by a.base_student_assessment_inspection_id
- ) as assessment_class_names,
- (
- SELECT count(*) FROM base_student_assessment_student_relation WHERE base_student_assessment_inspection_id = t.id
- ) as student_count
- from base_student_assessment_inspection t
- left join base_student_assessment_category t1 on (t1.id = t.base_student_assessment_category_id)
- left join base_student_assessment_project t2 on (t2.id = t.base_student_assessment_project_id)
- left join base_semester t3 on t.base_semester_id=t3.id
- left join base_grade t4 on t.grade_id=t4.id
- left join xjr_user t5 on t.assessment_user_id=t5.id
- left join xjr_dictionary_detail t6 on t6.code=t.score_type
- where t.delete_mark=0 and t1.delete_mark=0 and t2.delete_mark=0 and t3.delete_mark=0 and t.status=1
- <if test="dto.projectIds != null and dto.projectIds.size() > 0">
- and t.base_student_assessment_project_id in
- <foreach item="projectId" index="index" collection="dto.projectIds" open="(" close=")" separator=",">
- #{projectId}
- </foreach>
- </if>
- <if test="dto.gradeId != null">
- and t.grade_id = #{dto.gradeId}
- </if>
- <if test="dto.semesterId != null">
- and t.base_semester_id = #{dto.semesterId}
- </if>
- <if test="dto.startDate != null">
- and t.assessment_date >= #{dto.startDate}
- </if>
- <if test="dto.endDate != null">
- and t.assessment_date <= #{dto.endDate}
- </if>
- <if test="dto.assessmentUserName != null and dto.assessmentUserName != ''">
- and t5.name like concat('%',#{dto.assessmentUserName},'%')
- </if>
- </select>
- <select id="getInfo" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionVo">
- select t.id,t.score,t.score_type,t.assessment_date,t.reason,t1.name as assessment_category_name,t2.name as assessment_project_name,
- t3.name as semester_name,t4.name as grade_name,t5.name as assessment_user_name,t6.name as score_type_cn,t.file_id,t7.name as create_user_name
- from base_student_assessment_inspection t
- left join base_student_assessment_category t1 on (t1.id = t.base_student_assessment_category_id)
- left join base_student_assessment_project t2 on (t2.id = t.base_student_assessment_project_id)
- left join base_semester t3 on t.base_semester_id=t3.id
- left join base_grade t4 on t.grade_id=t4.id
- left join xjr_user t5 on t.assessment_user_id=t5.id
- left join xjr_dictionary_detail t6 on t6.code=t.score_type
- left join xjr_user t7 on t.create_user_id=t7.id
- where t.id=#{id} and t.delete_mark=0 and t1.delete_mark=0 and t2.delete_mark=0 and t3.delete_mark=0 and t.status=1;
- </select>
- <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionMobilePageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo">
- select t.id,t1.assessment_date,t2.name as assessment_category_name,t3.name as assessment_project_name,t5.name as
- assessment_class_name,t1.reason,t1.score,t1.score_type,t4.name as score_type_cn,
- (
- SELECT count(*) FROM base_student_assessment_student_relation WHERE base_student_assessment_inspection_id =
- t1.id and class_id=t.class_id
- ) as student_count
- from base_student_assessment_class_relation t
- left join base_student_assessment_inspection t1 on t1.id=t.base_student_assessment_inspection_id
- left join base_student_assessment_category t2 on (t2.id = t1.base_student_assessment_category_id)
- left join base_student_assessment_project t3 on (t3.id = t1.base_student_assessment_project_id)
- left join xjr_dictionary_detail t4 on t4.code=t1.score_type
- left join base_class t5 on t5.id=t.class_id
- where t1.delete_mark=0 and t1.status=1 and t.class_id in
- <foreach item="classId" index="index" collection="dto.classIds" open="(" close=")" separator=",">
- #{classId}
- </foreach>
- <if test="dto.projectIds != null and dto.projectIds.size() > 0">
- and t1.base_student_assessment_project_id in
- <foreach item="projectId" index="index" collection="dto.projectIds" open="(" close=")" separator=",">
- #{projectId}
- </foreach>
- </if>
- <if test="dto.startDate != null and dto.startDate != ''">
- and t1.assessment_date >= #{dto.startDate}
- </if>
- <if test="dto.endDate != null and dto.endDate != ''">
- and t1.assessment_date <= #{dto.endDate}
- </if>
- </select>
- <select id="getMobileInfo" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobileVo">
- select t.id,t.class_id,t.base_student_assessment_inspection_id,t1.score,t5.name as assessment_class_name,t2.name as assessment_category_name,t3.name as assessment_project_name,t1.assessment_date,t1.reason,
- t6.name as assessment_user_name,t7.name as create_user_name,t1.create_date,t1.file_id,t1.score_type,t4.name as score_type_cn
- from base_student_assessment_class_relation t
- left join base_student_assessment_inspection t1 on t1.id=t.base_student_assessment_inspection_id
- left join base_student_assessment_category t2 on (t2.id = t1.base_student_assessment_category_id)
- left join base_student_assessment_project t3 on (t3.id = t1.base_student_assessment_project_id)
- left join xjr_dictionary_detail t4 on t4.code=t1.score_type
- left join base_class t5 on t5.id=t.class_id
- left join xjr_user t6 on t1.assessment_user_id=t6.id
- left join xjr_user t7 on t1.create_user_id=t7.id
- where t.id=#{id};
- </select>
- <select id="getStudentIndividualBehaviorExcelVoList" parameterType="com.xjrsoft.module.student.dto.QuantitativeAssessmentExcelDto" resultType="com.xjrsoft.module.student.vo.QuantitativeAssessmentSubTableExcelVo">
- with total_score as (
- select
- t.user_id as studentUserId,
- sum(if(t1.score_type = 'score_add', t1.score, -1 * t1.score)) as finalScore
- from base_student_assessment_student_relation t
- left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
- where t1.delete_mark = 0
- <if test="dto.yearAndMonth != null and dto.yearAndMonth != ''">
- and date_format(t1.assessment_date, '%Y-%m') = #{dto.yearAndMonth}
- </if>
- group by t.user_id
- )
- select
- t4.id as headTeacherUserId,
- t4.user_name as headTeacherUserName,
- t4.name as headTeacherName,
- t.class_id as classId,
- t.class_name as className,
- t.user_id as studentUserId,
- t.student_id as studentId,
- t.name as studentName,
- t5.base_score as baseScore,
- t2.id as baseStudentAssessmentProjectId,
- t2.name as baseStudentAssessmentProjectIdCN,
- t1.assessment_date as assessmentDate,
- if(t1.score_type = 'score_add', t1.score, -1 * t1.score) as projectScore,
- t5.base_score + t6.finalScore as finalScore
- from base_student_assessment_student_relation t
- left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
- left join base_student_assessment_project t2 on t2.id = t1.base_student_assessment_project_id
- left join base_class t3 on t3.id = t.class_id
- left join xjr_user t4 on t4.id = t3.teacher_id
- left join base_student_assessment_base_score t5 on t5.base_semester_id = t1.base_semester_id
- left join total_score t6 on t6.studentUserId = t.user_id
- where t1.delete_mark = 0
- <if test="dto.yearAndMonth != null and dto.yearAndMonth != ''">
- and date_format(t1.assessment_date, '%Y-%m') = #{dto.yearAndMonth}
- </if>
- order by t.class_id, t.user_id
- </select>
- <select id="getQuantitativeAssessmentSubTableExcelVoList" parameterType="com.xjrsoft.module.student.dto.QuantitativeAssessmentExcelDto" resultType="com.xjrsoft.module.student.vo.QuantitativeAssessmentSubTableExcelVo">
- with total_score as (select t.user_id as studentUserId,
- sum(if(t1.score_type = 'score_add', t1.score, -1 * t1.score)) as finalScore
- from base_student_assessment_student_relation t
- left join base_student_assessment_inspection t1
- on t1.id = t.base_student_assessment_inspection_id
- where t1.delete_mark = 0
- and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
- <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
- and t1.class_ids in
- <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
- #{classId}
- </foreach>
- </if>
- <if test="dto.baseStudentAssessmentCategoryId != null and dto.baseStudentAssessmentCategoryId > 0">
- and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
- </if>
- <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
- and t1.base_semester_id > #{dto.baseSemesterId}
- </if>
- <if test="dto.startTime != null">
- and t1.create_date > #{dto.startTime}
- </if>
- <if test="dto.endTime != null">
- and t1.create_date < #{dto.endTime}
- </if>
- group by t.user_id)
- select t4.id as headTeacherUserId,
- t4.user_name as headTeacherUserName,
- t4.name as headTeacherName,
- t.class_id as classId,
- t.class_name as className,
- t.user_id as studentUserId,
- t.student_id as studentId,
- t.name as studentName,
- t5.base_score as baseScore,
- t2.id as baseStudentAssessmentProjectId,
- t2.name as baseStudentAssessmentProjectIdCN,
- t1.assessment_date as assessmentDate,
- if(t1.score_type = 'score_add', t1.score, -1 * t1.score) as projectScore,
- t5.base_score + t6.finalScore as finalScore
- from base_student_assessment_student_relation t
- left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
- left join base_student_assessment_project t2 on t2.id = t1.base_student_assessment_project_id
- left join base_class t3 on t3.id = t.class_id
- left join xjr_user t4 on t4.id = t3.teacher_id
- left join base_student_assessment_base_score t5 on t5.base_semester_id = t1.base_semester_id
- left join total_score t6 on t6.studentUserId = t.user_id
- where t1.delete_mark = 0
- and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
- <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
- and t1.class_ids in
- <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
- #{classId}
- </foreach>
- </if>
- <if test="dto.baseStudentAssessmentCategoryId != null and dto.baseStudentAssessmentCategoryId > 0">
- and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
- </if>
- <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
- and t1.base_semester_id > #{dto.baseSemesterId}
- </if>
- <if test="dto.startTime != null">
- and t1.create_date > #{dto.startTime}
- </if>
- <if test="dto.endTime != null">
- and t1.create_date < #{dto.endTime}
- </if>
- order by t.class_id, t.user_id
- </select>
- <select id="getAssessmentInspectionByClassIdList" parameterType="com.xjrsoft.module.student.dto.QuantitativeAssessmentSingleScoreDto" resultType="com.xjrsoft.module.student.vo.QuantitativeAssessmentSingleScoreVo">
- select
- t.class_ids as class_id,
- sum(t.score) as sumScore
- from base_student_assessment_inspection t
- where t.delete_mark = 0
- <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
- and t.class_ids in
- <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
- #{classId}
- </foreach>
- </if>
- <if test="dto.baseStudentAssessmentCategoryId != null and dto.baseStudentAssessmentCategoryId > 0">
- and t.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
- </if>
- <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
- and t.base_semester_id > #{dto.baseSemesterId}
- </if>
- <if test="dto.startTime != null">
- and t.create_date > #{dto.startTime}
- </if>
- <if test="dto.endTime != null">
- and t.create_date < #{dto.endTime}
- </if>
- group by t.class_ids;
- </select>
- <select id="getConventionalManagementList" parameterType="com.xjrsoft.module.student.dto.QuantitativeAssessmentSingleScoreDto" resultType="com.xjrsoft.module.student.vo.QuantitativeAssessmentSingleScoreVo">
- select
- t.class_id as classId,
- sum(t1.score) as score
- from base_student_assessment_class_relation t
- left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
- left join base_student_assessment_category t2 on t2.id = t1.base_student_assessment_category_id
- where t1.base_student_assessment_category_id = 1754411705233838080
- and t.class_id in
- <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
- #{classId}
- </foreach>
- <if test="dto.startTime != null">
- and t1.create_date > #{dto.startTime}
- </if>
- <if test="dto.endTime != null">
- and t1.create_date < #{dto.endTime}
- </if>
- group by t.class_id;
- </select>
- <select id="getAwardsAndHonorList" parameterType="com.xjrsoft.module.student.dto.QuantitativeAssessmentSingleScoreDto" resultType="com.xjrsoft.module.student.vo.QuantitativeAssessmentSingleScoreVo">
- select
- t.class_id as classId,
- sum(t1.score) as score
- from base_student_assessment_student_relation t
- left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
- left join base_student_assessment_category t2 on t2.id = t1.base_student_assessment_category_id
- where t1.base_student_assessment_category_id = 1754412347985760256
- and t.class_id in
- <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
- #{classId}
- </foreach>
- <if test="dto.startTime != null">
- and t1.create_date > #{dto.startTime}
- </if>
- <if test="dto.endTime != null">
- and t1.create_date < #{dto.endTime}
- </if>
- group by t.class_id;
- </select>
- <select id="getParamilitaryList" parameterType="com.xjrsoft.module.student.dto.QuantitativeAssessmentSingleScoreDto" resultType="com.xjrsoft.module.student.vo.QuantitativeAssessmentSingleScoreVo">
- select
- t.class_id as classId,
- sum(t1.score) as score
- from base_student_assessment_student_relation t
- left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
- left join base_student_assessment_category t2 on t2.id = t1.base_student_assessment_category_id
- where t1.base_student_assessment_category_id = 1754412347985760256
- and t.class_id in
- <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
- #{classId}
- </foreach>
- <if test="dto.startTime != null">
- and t1.create_date > #{dto.startTime}
- </if>
- <if test="dto.endTime != null">
- and t1.create_date < #{dto.endTime}
- </if>
- group by t.class_id;
- </select>
- </mapper>
|