@ -25,11 +25,13 @@ import com.yipin.liuwanr.entity.Student;
*
*
* /
* /
import com.yipin.liuwanr.entity.SutdentClass ;
import com.yipin.liuwanr.entity.SutdentClass ;
public interface AssesmentMapper {
public interface AssesmentMapper {
/ * *
/ * *
* 查询项目权限为考核的项目
* 查询项目权限为考核的项目
*
* @return
* @return
* /
* /
@Select ( "select projectId,projectName,projectPermissions,founder,creationTime from hr_project_management " +
@Select ( "select projectId,projectName,projectPermissions,founder,creationTime from hr_project_management " +
@ -39,10 +41,11 @@ public interface AssesmentMapper {
/ * *
/ * *
* 考核列表信息查询
* 考核列表信息查询
*
* @param assesment
* @param assesment
* @return
* @return
* /
* /
@Select ( { "<script>" ,
@Select ( { "<script>" ,
"SELECT a.id,a.assesmentName as assesmentName,a.assessmentSize as assessmentSize,p.projectName as projectName,a.timeSum as timeSum,GROUP_CONCAT(c.className) as className,"
"SELECT a.id,a.assesmentName as assesmentName,a.assessmentSize as assessmentSize,p.projectName as projectName,a.timeSum as timeSum,GROUP_CONCAT(c.className) as className,"
+ "a.releaseType as releaseType,a.creationTime as creationTime,a.endTime as endTime,a.assesmentState as assesmentState FROM "
+ "a.releaseType as releaseType,a.creationTime as creationTime,a.endTime as endTime,a.assesmentState as assesmentState FROM "
+ "(assessment a left join hr_project_management p on a.experimentId=p.projectId ) left join class c on FIND_IN_SET(c.classId,a.classId )>0 "
+ "(assessment a left join hr_project_management p on a.experimentId=p.projectId ) left join class c on FIND_IN_SET(c.classId,a.classId )>0 "
@ -59,9 +62,9 @@ public interface AssesmentMapper {
List < Assesment > getByCondition ( Assesment assesment ) ;
List < Assesment > getByCondition ( Assesment assesment ) ;
/ * *
/ * *
* 查询选中的学生 , 有哪些正在参与考核
* 查询选中的学生 , 有哪些正在参与考核
*
* @param studentIds
* @param studentIds
* @return
* @return
* /
* /
@ -76,16 +79,18 @@ public interface AssesmentMapper {
/ * *
/ * *
* 创建考核
* 创建考核
*
* @param assesment
* @param assesment
* /
* /
@Insert ( "insert into assessment (assesmentName,releaseType,creationTime,endTime,timesum,experimentId,classId,assesmentState,assessmentSize,experimentalClassId,staffId,courseId,assessmentNumber)"
@Insert ( "insert into assessment (assesmentName,releaseType,creationTime,endTime,timesum,experimentId,classId,assesmentState,assessmentSize,experimentalClassId,staffId,courseId,assessmentNumber)"
+ " values (#{assesmentName},#{releaseType},#{creationTime},#{endTime},#{timesum},#{experimentId},#{classId},#{assesmentState},#{assessmentSize},#{experimentalClassId},#{staffId},#{courseId},#{assessmentNumber})" )
+ " values (#{assesmentName},#{releaseType},#{creationTime},#{endTime},#{timesum},#{experimentId},#{classId},#{assesmentState},#{assessmentSize},#{experimentalClassId},#{staffId},#{courseId},#{assessmentNumber})" )
@Options ( useGeneratedKeys = true , keyColumn = "id" , keyProperty = "id" )
@Options ( useGeneratedKeys = true , keyColumn = "id" , keyProperty = "id" )
void insertAssesment ( Assesment assesment ) ;
void insertAssesment ( Assesment assesment ) ;
/ * *
/ * *
* 修改考核
* 修改考核
*
* @param assesment
* @param assesment
* /
* /
@Update ( "update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber}"
@Update ( "update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber}"
@ -96,16 +101,17 @@ public interface AssesmentMapper {
/ * *
/ * *
* 添加考核记录
* 添加考核记录
* /
* /
@Insert ( { "<script>" ,
@Insert ( { "<script>" ,
"insert into record (projectId,courseId,studentId,assesmentId) values"
"insert into record (projectId,courseId,studentId,assesmentId) values"
+ "<foreach collection = 'studentIds' item='studentId' separator=','>"
+ "<foreach collection = 'studentIds' item='studentId' separator=','>"
+ "(#{projectId},#{courseId},#{studentId},#{assesmentId})" + "</foreach>" ,
+ "(#{projectId},#{courseId},#{studentId},#{assesmentId})" + "</foreach>" ,
"</script>" } )
"</script>" } )
void insertRecore ( @Param ( "studentIds" ) List < Integer > studentIds , @Param ( "projectId" ) Integer projectId , @Param ( "courseId" ) Integer courseId , @Param ( "assesmentId" ) Integer assesmentId ) ;
void insertRecore ( @Param ( "studentIds" ) List < Integer > studentIds , @Param ( "projectId" ) Integer projectId , @Param ( "courseId" ) Integer courseId , @Param ( "assesmentId" ) Integer assesmentId ) ;
/ * *
/ * *
* 根据考核id查询数据
* 根据考核id查询数据
*
* @param id
* @param id
* @return
* @return
* /
* /
@ -117,18 +123,20 @@ public interface AssesmentMapper {
/ * *
/ * *
* 查询行政班级id
* 查询行政班级id
*
* @param studentIds
* @param studentIds
* @return
* @return
* /
* /
@Select ( { "<script>" , "select classId from student WHERE studentId in "
@Select ( { "<script>" , "select classId from student WHERE studentId in "
+ "<foreach collection='studentIds' item='stu' open='(' separator=',' close=')'>#{stu}</foreach> " ,
+ "<foreach collection='studentIds' item='stu' open='(' separator=',' close=')'>#{stu}</foreach> " ,
"GROUP BY classId" ,
"GROUP BY classId" ,
"</script>" } )
"</script>" } )
List < String > queryClassId ( @Param ( "studentIds" ) List < Integer > studentIds ) ;
List < String > queryClassId ( @Param ( "studentIds" ) List < Integer > studentIds ) ;
/ * *
/ * *
* 创建考核时选中的学生
* 创建考核时选中的学生
*
* @param assesmentId
* @param assesmentId
* @return
* @return
* /
* /
@ -138,19 +146,21 @@ public interface AssesmentMapper {
/ * *
/ * *
* 删除多余的记录信息
* 删除多余的记录信息
*
* @param assesmentId
* @param assesmentId
* @param students
* @param students
* /
* /
@Delete ( { "<script>" , "delete from record where assesmentId=#{assesmentId} and studentId in" ,
@Delete ( { "<script>" , "delete from record where assesmentId=#{assesmentId} and studentId in" ,
"<foreach collection='students' item='stu' open='(' separator=',' close=')'>" +
"<foreach collection='students' item='stu' open='(' separator=',' close=')'>" +
"#{stu.studentId} "
"#{stu.studentId} "
+ "</foreach> " ,
+ "</foreach> " ,
"</script>" } )
"</script>" } )
void deleteRecord ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "students" ) List < Student > students ) ;
void deleteRecord ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "students" ) List < Student > students ) ;
/ * *
/ * *
* 正在参与考核的学生
* 正在参与考核的学生
*
* @return
* @return
* /
* /
@Select ( "select studentId from record re left join assessment ass on re.assesmentId=ass.id where ass.assesmentState=1 and re.assesmentId is not null" )
@Select ( "select studentId from record re left join assessment ass on re.assesmentId=ass.id where ass.assesmentState=1 and re.assesmentId is not null" )
@ -161,41 +171,41 @@ public interface AssesmentMapper {
* 修改考核状态
* 修改考核状态
* /
* /
@Update ( { "<script>" ,
@Update ( { "<script>" ,
"update assessment set assesmentState=#{assesmentState} " +
"update assessment set assesmentState=#{assesmentState} " +
"<if test='releaseType==0 and assesmentState==1'>,creationTime=#{creationTime},endTime=#{endTime}</if>" ,
"<if test='releaseType==0 and assesmentState==1'>,creationTime=#{creationTime},endTime=#{endTime}</if>" ,
"<if test='assesmentState==2'>,endTime=#{endTime} </if>" ,
"<if test='assesmentState==2'>,endTime=#{endTime} </if>" ,
"where id=#{id}" ,
"where id=#{id}" ,
"</script>" } )
"</script>" } )
void updateAssesmentState ( Assesment assesment ) ;
void updateAssesmentState ( Assesment assesment ) ;
/ * *
/ * *
* 查询实验班级一级标题 : 创建时间
* 查询实验班级一级标题 : 创建时间
* @param schoolId
*
* @param staffId
* @return
* @return
* /
* /
@Select ( "select creationTime from experimental_class_ning WHERE isdel=0 and schoolId = #{schoolId} GROUP BY creationTime ORDER BY creationTime desc" )
@Select ( "select creationTime from experimental_class_ning WHERE isdel=0 and founder=(select staffName from staff where staffId=#{staffId}) GROUP BY creationTime ORDER BY creationTime desc" )
List < ExperimentalClass > queryCreationTime ( Integer school Id ) ;
List < String > queryCreationTime ( Integer staff Id ) ;
/ * *
/ * *
* 查询实验班级信息 , 及班级下的学生
* 查询实验班级信息 , 及班级下的学生
*
* @param creationTime
* @param creationTime
* @return
* @return
* /
* /
@Select ( "select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} and schoolId = #{school Id})" )
@Select ( "select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} and founder=(select staffName from staff where staffId=#{staff Id})" )
@Results ( {
@Results ( {
@Result ( id = true , column = "experimentalClassId" , property = "experimentalClassId" ) ,
@Result ( id = true , column = "experimentalClassId" , property = "experimentalClassId" ) ,
@Result ( column = "experimentalClassName" , property = "experimentalClassName" ) ,
@Result ( column = "experimentalClassName" , property = "experimentalClassName" ) ,
@Result ( column = "experimentalClassId" , property = "students" , many = @Many ( select = "com.yipin.liuwanr.mapper.StudentMapper.queryStudent" ) )
@Result ( column = "experimentalClassId" , property = "students" , many = @Many ( select = "com.yipin.liuwanr.mapper.StudentMapper.queryStudent" ) )
} )
} )
List < ExperimentalClass > queryExperimentalClass ( @Param ( "creationTime" ) String creationTime , @Param ( "schoolId" ) Integer schoolId ) ;
List < ExperimentalClass > queryExperimentalClass ( @Param ( "creationTime" ) String creationTime , @Param ( "staffId" ) Integer staffId ) ;
/ * *
/ * *
* 考核名称 、 创建时间 、 结束时间 、 教师名称 、 考核人数 、 实到人数
* 考核名称 、 创建时间 、 结束时间 、 教师名称 、 考核人数 、 实到人数
*
* @param assesmentId
* @param assesmentId
* @return
* @return
* /
* /
@ -206,6 +216,7 @@ public interface AssesmentMapper {
/ * *
/ * *
* 实验班级
* 实验班级
*
* @param assesmentId
* @param assesmentId
* @return
* @return
* /
* /
@ -216,6 +227,7 @@ public interface AssesmentMapper {
/ * *
/ * *
* 行政班级
* 行政班级
*
* @param assesmentId
* @param assesmentId
* @return
* @return
* /
* /
@ -225,6 +237,7 @@ public interface AssesmentMapper {
/ * *
/ * *
* 查询成绩 ( 升序 )
* 查询成绩 ( 升序 )
*
* @param assesmentId
* @param assesmentId
* @param experimentalClassId
* @param experimentalClassId
* @param classId
* @param classId
@ -239,11 +252,12 @@ public interface AssesmentMapper {
+ "</if>" ,
+ "</if>" ,
" and re.score is not null ORDER BY re.score" ,
" and re.score is not null ORDER BY re.score" ,
"</script>" } )
"</script>" } )
List < Integer > queryScore ( Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId , @Param ( "classId" ) List < Integer > classId ) ;
List < Integer > queryScore ( Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId , @Param ( "classId" ) List < Integer > classId ) ;
/ * *
/ * *
* 分组查询分数和对应人数
* 分组查询分数和对应人数
*
* @param assesmentId
* @param assesmentId
* @param experimentalClassId
* @param experimentalClassId
* @param classId
* @param classId
@ -258,12 +272,13 @@ public interface AssesmentMapper {
+ "</if>" ,
+ "</if>" ,
" and re.score is not null GROUP BY re.score" ,
" and re.score is not null GROUP BY re.score" ,
"</script>" } )
"</script>" } )
List < Record > queryScore2 ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
List < Record > queryScore2 ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
@Param ( "classId" ) List < Integer > classId ) ;
@Param ( "classId" ) List < Integer > classId ) ;
/ * *
/ * *
* 统计某个班的总错误量
* 统计某个班的总错误量
*
* @param assesmentId
* @param assesmentId
* @param experimentalClassId
* @param experimentalClassId
* @param classId
* @param classId
@ -276,13 +291,14 @@ public interface AssesmentMapper {
+ "<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id}</foreach>"
+ "<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id}</foreach>"
+ "</if>" ,
+ "</if>" ,
"</script>" } )
"</script>" } )
Integer queryRight ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
Integer queryRight ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
@Param ( "classId" ) List < Integer > classId ) ;
@Param ( "classId" ) List < Integer > classId ) ;
/ * *
/ * *
* 统计该项目的判分点数量
* 统计该项目的判分点数量
* ( select experimentId from assessment where id = # { assesmentId } )
* ( select experimentId from assessment where id = # { assesmentId } )
*
* @return
* @return
* /
* /
@Select ( "select count(judgmentPointsId) from hr_judgment_points where FIND_IN_SET(#{projectId},projectId)" )
@Select ( "select count(judgmentPointsId) from hr_judgment_points where FIND_IN_SET(#{projectId},projectId)" )
@ -291,6 +307,7 @@ public interface AssesmentMapper {
/ * *
/ * *
* 错误分布
* 错误分布
*
* @param assesmentId
* @param assesmentId
* @param experimentalClassId
* @param experimentalClassId
* @param classId
* @param classId
@ -304,7 +321,7 @@ public interface AssesmentMapper {
+ "</if>" ,
+ "</if>" ,
"GROUP BY pr.judgmentPointsId" ,
"GROUP BY pr.judgmentPointsId" ,
"</script>" } )
"</script>" } )
List < PointRecord > queryError ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
List < PointRecord > queryError ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
@Param ( "classId" ) List < Integer > classId ) ;
@Param ( "classId" ) List < Integer > classId ) ;
@ -317,7 +334,7 @@ public interface AssesmentMapper {
+ "</if>" ,
+ "</if>" ,
" and re.score is not null" ,
" and re.score is not null" ,
"</script>" } )
"</script>" } )
List < HashMap < String , Integer > > queryScore3 ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
List < HashMap < String , Integer > > queryScore3 ( @Param ( "assesmentId" ) Integer assesmentId , @Param ( "experimentalClassId" ) Integer experimentalClassId ,
@Param ( "classId" ) List < Integer > classId ) ;
@Param ( "classId" ) List < Integer > classId ) ;