修改补考名单的上传时间,恢复考核管理的实验班级展示

master
pd 4 years ago
parent 7a19fdb90a
commit b904adc2f2
  1. 28
      src/main/java/com/yipin/liuwanr/controller/AssesmentController.java
  2. 6
      src/main/java/com/yipin/liuwanr/controller/MakeuplistController.java
  3. 613
      src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java
  4. 11
      src/main/java/com/yipin/liuwanr/service/AssesmentService.java
  5. 19
      src/main/java/com/yipin/liuwanr/service/MakeuplistService.java

@ -242,21 +242,21 @@ public class AssesmentController {
} }
return resp; return resp;
} }
/** /**
* 查询实验班级一级栏目 * 查询实验班级一级栏目
* @param schoolId * @param staffId
* @return * @return
*/ */
@GetMapping("/getExperimentalClass") @GetMapping("/getExperimentalClass")
Response getExperimentalClass(@RequestParam Integer schoolId) { Response getExperimentalClass(@RequestParam Integer staffId) {
Response resp = new Response(); Response resp = new Response();
if(StringUtils.isEmpty(schoolId)){ if(StringUtils.isEmpty(staffId)){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("学校为空!"); resp.setErrmessage("教师信息为空");
}else{ }else{
HashMap<String, Object> ret = service.queryCretionTime(schoolId); HashMap<String, Object> ret = service.queryCretionTime(staffId);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
@ -268,24 +268,24 @@ public class AssesmentController {
} }
return resp; return resp;
} }
/** /**
* 二级查询实验班级名称以及班级一下的学生 * 查询实验班级名称以及班级一下的学生
* @param creationTime * @param creationTime
* @return * @return
*/ */
@GetMapping("/getCreationTime") @GetMapping("/getCreationTime")
Response getCreationTime(@RequestParam String creationTime,@RequestParam Integer schoolId) { Response getCreationTime(@RequestParam String creationTime,@RequestParam Integer staffId) {
Response resp = new Response(); Response resp = new Response();
if(StringUtils.isEmpty(schoolId)){ if(StringUtils.isEmpty(staffId)){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("学校为空!"); resp.setErrmessage("教师信息为空");
}else if(StringUtils.isEmpty(creationTime)){ }else if(StringUtils.isEmpty(creationTime)){
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("实验班级创建时间信息为空"); resp.setErrmessage("实验班级创建时间信息为空");
}else { }else {
HashMap<String, Object> ret = service.queryCretionTime(creationTime,schoolId); HashMap<String, Object> ret = service.queryCretionTime(creationTime,staffId);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);

@ -69,7 +69,8 @@ public class MakeuplistController {
* @return * @return
*/ */
@GetMapping("/queryGetByClassName") @GetMapping("/queryGetByClassName")
Response queryGetByClassName(@RequestParam Integer staffId,@RequestParam String uploadTime,@RequestParam Integer uploadType,@RequestParam Integer schoolId) { Response queryGetByClassName(@RequestParam Integer staffId,@RequestParam long uploadTime,
@RequestParam Integer uploadType,@RequestParam Integer schoolId) {
Response resp = new Response(); Response resp = new Response();
if(StringUtils.isEmpty(staffId)) { if(StringUtils.isEmpty(staffId)) {
resp.setStatus(300); resp.setStatus(300);
@ -122,7 +123,8 @@ public class MakeuplistController {
} }
@GetMapping("/getStudent") @GetMapping("/getStudent")
Response getStudent(@RequestParam Integer staffId,@RequestParam String uploadTime,@RequestParam Integer uploadType,@RequestParam Integer schoolId){ Response getStudent(@RequestParam Integer staffId,@RequestParam long uploadTime,@RequestParam Integer uploadType,
@RequestParam Integer schoolId){
Response resp = new Response(); Response resp = new Response();
if(StringUtils.isEmpty(staffId)) { if(StringUtils.isEmpty(staffId)) {
resp.setStatus(300); resp.setStatus(300);

@ -25,303 +25,320 @@ 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 " + */
" where isdel=0 and projectPermissions=1 AND systemId in (select systemId FROM hr_course_tc where courseId=#{courseId} GROUP BY systemId)") @Select("select projectId,projectName,projectPermissions,founder,creationTime from hr_project_management " +
List<Project_Management> queryGetByAssesmentProject(Integer courseId); " where isdel=0 and projectPermissions=1 AND systemId in (select systemId FROM hr_course_tc where courseId=#{courseId} GROUP BY systemId)")
List<Project_Management> queryGetByAssesmentProject(Integer courseId);
/**
* 考核列表信息查询 /**
* @param assesment * 考核列表信息查询
* @return *
*/ * @param assesment
@Select({ "<script>", * @return
"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 " @Select({"<script>",
+ "(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 " "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,"
+ "WHERE a.staffId=#{staffId} AND a.courseId=#{courseId} ", + "a.releaseType as releaseType,a.creationTime as creationTime,a.endTime as endTime,a.assesmentState as assesmentState FROM "
" <if test='month==1'>and a.creationTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)</if>", + "(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 "
" <if test='month==3'>and a.creationTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)</if>", + "WHERE a.staffId=#{staffId} AND a.courseId=#{courseId} ",
" <if test='month==6'>and a.creationTime>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)</if>", " <if test='month==1'>and a.creationTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)</if>",
" <if test='creationTime!=null and endTime!=null and endTime!=\"\" and creationTime!=\"\" '> and a.creationTime between #{creationTime} and #{endTime}</if>", " <if test='month==3'>and a.creationTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)</if>",
" <if test='releaseType!=null'>and a.releaseType=#{releaseType} </if>", " <if test='month==6'>and a.creationTime>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)</if>",
" <if test='assesmentState!=null'>and a.assesmentState=#{assesmentState} </if>", " <if test='creationTime!=null and endTime!=null and endTime!=\"\" and creationTime!=\"\" '> and a.creationTime between #{creationTime} and #{endTime}</if>",
" <if test='className!=null and className!=\"\"'>and c.className like concat('%',#{className},'%') </if>", " <if test='releaseType!=null'>and a.releaseType=#{releaseType} </if>",
" GROUP BY a.id ORDER BY a.creationTime", " <if test='assesmentState!=null'>and a.assesmentState=#{assesmentState} </if>",
"</script> "}) " <if test='className!=null and className!=\"\"'>and c.className like concat('%',#{className},'%') </if>",
List<Assesment> getByCondition(Assesment assesment); " GROUP BY a.id ORDER BY a.creationTime",
"</script> "})
List<Assesment> getByCondition(Assesment assesment);
/**
* 查询选中的学生有哪些正在参与考核 /**
* @param studentIds * 查询选中的学生有哪些正在参与考核
* @return *
*/ * @param studentIds
@Select({"<script>", * @return
"select studentName from student where isAssess=1 and studentId in " */
+ "<foreach collection='studentIds' item='stu' open='(' separator=',' close=')'>" @Select({"<script>",
+ "#{stu}" "select studentName from student where isAssess=1 and studentId in "
+ "</foreach> ", + "<foreach collection='studentIds' item='stu' open='(' separator=',' close=')'>"
"</script>"}) + "#{stu}"
List<Student> queryStudentisAssess(@Param("studentIds") List<Integer> studentIds); + "</foreach> ",
"</script>"})
List<Student> queryStudentisAssess(@Param("studentIds") List<Integer> studentIds);
/**
* 创建考核
* @param assesment /**
*/ * 创建考核
@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})") * @param assesment
@Options(useGeneratedKeys = true,keyColumn ="id",keyProperty = "id") */
void insertAssesment(Assesment assesment); @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})")
@Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
/** void insertAssesment(Assesment assesment);
* 修改考核
* @param assesment
*/ /**
@Update("update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber}" * 修改考核
+ "experimentId=#{experimentId},assesmentState=#{assesmentState},classId=#{classId},experimentalClassId=#{experimentalClassId} where id=#{id}") *
void updateAssesment(Assesment assesment); * @param assesment
*/
@Update("update assessment set assesmentName=#{assesmentName},releaseType=#{releaseType},creationTime=#{creationTime},endTime=#{endTime},timesum=#{timesum},assessmentSize=#{assessmentSize},assessmentNumber=#{assessmentNumber}"
/** + "experimentId=#{experimentId},assesmentState=#{assesmentState},classId=#{classId},experimentalClassId=#{experimentalClassId} where id=#{id}")
* 添加考核记录 void updateAssesment(Assesment assesment);
*/
@Insert({ "<script>",
"insert into record (projectId,courseId,studentId,assesmentId) values" /**
+ "<foreach collection = 'studentIds' item='studentId' separator=','>" * 添加考核记录
+ "(#{projectId},#{courseId},#{studentId},#{assesmentId})" + "</foreach>", */
"</script>" }) @Insert({"<script>",
void insertRecore(@Param("studentIds")List<Integer> studentIds,@Param("projectId")Integer projectId,@Param("courseId")Integer courseId,@Param("assesmentId")Integer assesmentId); "insert into record (projectId,courseId,studentId,assesmentId) values"
+ "<foreach collection = 'studentIds' item='studentId' separator=','>"
+ "(#{projectId},#{courseId},#{studentId},#{assesmentId})" + "</foreach>",
/** "</script>"})
* 根据考核id查询数据 void insertRecore(@Param("studentIds") List<Integer> studentIds, @Param("projectId") Integer projectId, @Param("courseId") Integer courseId, @Param("assesmentId") Integer assesmentId);
* @param id
* @return
*/ /**
@Select("select id,experimentId,creationTime,endTime,assesmentName,releaseType,timesum,experimentalClassId,classId from assessment where id=#{id}") * 根据考核id查询数据
Assesment queryGetById(Integer id); *
* @param id
@Select("select assessmentNumber from assessment where id=#{assesmentId}") * @return
Integer getAssesmentNumber(Integer assesmentId); */
@Select("select id,experimentId,creationTime,endTime,assesmentName,releaseType,timesum,experimentalClassId,classId from assessment where id=#{id}")
/** Assesment queryGetById(Integer id);
* 查询行政班级id
* @param studentIds @Select("select assessmentNumber from assessment where id=#{assesmentId}")
* @return Integer getAssesmentNumber(Integer assesmentId);
*/
@Select({"<script>","select classId from student WHERE studentId in " /**
+ "<foreach collection='studentIds' item='stu' open='(' separator=',' close=')'>#{stu}</foreach> ", * 查询行政班级id
"GROUP BY classId", *
"</script>"}) * @param studentIds
List<String> queryClassId(@Param("studentIds")List<Integer> studentIds); * @return
*/
@Select({"<script>", "select classId from student WHERE studentId in "
/** + "<foreach collection='studentIds' item='stu' open='(' separator=',' close=')'>#{stu}</foreach> ",
* 创建考核时选中的学生 "GROUP BY classId",
* @param assesmentId "</script>"})
* @return List<String> queryClassId(@Param("studentIds") List<Integer> studentIds);
*/
@Select("SELECT stu.studentId as studentId,studentName as studentName FROM record re,student stu WHERE re.studentId=stu.studentId AND re.assesmentId=#{assesmentId}")
List<Student> queryStudent(Integer assesmentId); /**
* 创建考核时选中的学生
*
/** * @param assesmentId
* 删除多余的记录信息 * @return
* @param assesmentId */
* @param students @Select("SELECT stu.studentId as studentId,studentName as studentName FROM record re,student stu WHERE re.studentId=stu.studentId AND re.assesmentId=#{assesmentId}")
*/ List<Student> queryStudent(Integer assesmentId);
@Delete({"<script>","delete from record where assesmentId=#{assesmentId} and studentId in",
"<foreach collection='students' item='stu' open='(' separator=',' close=')'>" +
"#{stu.studentId} " /**
+ "</foreach> ", * 删除多余的记录信息
"</script>"}) *
void deleteRecord(@Param("assesmentId")Integer assesmentId,@Param("students")List<Student> students); * @param assesmentId
* @param students
*/
/** @Delete({"<script>", "delete from record where assesmentId=#{assesmentId} and studentId in",
* 正在参与考核的学生 "<foreach collection='students' item='stu' open='(' separator=',' close=')'>" +
* @return "#{stu.studentId} "
*/ + "</foreach> ",
@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") "</script>"})
List<Integer> getStudentisAssess(); void deleteRecord(@Param("assesmentId") Integer assesmentId, @Param("students") List<Student> students);
/** /**
* 修改考核状态 * 正在参与考核的学生
*/ *
@Update({"<script>", * @return
"update assessment set assesmentState=#{assesmentState} "+ */
"<if test='releaseType==0 and assesmentState==1'>,creationTime=#{creationTime},endTime=#{endTime}</if>", @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")
"<if test='assesmentState==2'>,endTime=#{endTime} </if>", List<Integer> getStudentisAssess();
"where id=#{id}" ,
"</script>"})
void updateAssesmentState(Assesment assesment); /**
* 修改考核状态
*/
@Update({"<script>",
/** "update assessment set assesmentState=#{assesmentState} " +
* 查询实验班级一级标题创建时间 "<if test='releaseType==0 and assesmentState==1'>,creationTime=#{creationTime},endTime=#{endTime}</if>",
* @param schoolId "<if test='assesmentState==2'>,endTime=#{endTime} </if>",
* @return "where id=#{id}",
*/ "</script>"})
@Select("select creationTime from experimental_class_ning WHERE isdel=0 and schoolId = #{schoolId} GROUP BY creationTime ORDER BY creationTime desc") void updateAssesmentState(Assesment assesment);
List<ExperimentalClass> queryCreationTime(Integer schoolId);
/**
/** * 查询实验班级一级标题创建时间
* 查询实验班级信息,及班级下的学生 *
* @param creationTime * @param staffId
* @return * @return
*/ */
@Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} and schoolId = #{schoolId})") @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")
@Results({ List<String> queryCreationTime(Integer staffId);
@Result(id = true,column = "experimentalClassId",property = "experimentalClassId"),
@Result(column ="experimentalClassName",property = "experimentalClassName" ),
@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); *
* @param creationTime
* @return
*/
/** @Select("select experimentalClassId,experimentalClassName from experimental_class_ning where isdel=0 and creationTime=#{creationTime} and founder=(select staffName from staff where staffId=#{staffId})")
* 考核名称创建时间结束时间教师名称考核人数实到人数 @Results({
* @param assesmentId @Result(id = true, column = "experimentalClassId", property = "experimentalClassId"),
* @return @Result(column = "experimentalClassName", property = "experimentalClassName"),
*/ @Result(column = "experimentalClassId", property = "students", many = @Many(select = "com.yipin.liuwanr.mapper.StudentMapper.queryStudent"))
@Select("SELECT ass.assesmentName as assesmentName ,ass.creationTime as creationTime,ass.endTime as endTime,ass.assessmentSize as assessmentSize,count(re.score) as actualNumber,st.staffName as staffName " })
+ " FROM (assessment ass left join staff st on ass.staffId=st.staffId) left join record re on ass.id=re.assesmentId WHERE ass.id=#{assesmentId} and re.score is not null") List<ExperimentalClass> queryExperimentalClass(@Param("creationTime") String creationTime, @Param("staffId") Integer staffId);
Assesment queryAssesmentId(Integer assesmentId);
/**
* 考核名称创建时间结束时间教师名称考核人数实到人数
/** *
* 实验班级 * @param assesmentId
* @param assesmentId * @return
* @return */
*/ @Select("SELECT ass.assesmentName as assesmentName ,ass.creationTime as creationTime,ass.endTime as endTime,ass.assessmentSize as assessmentSize,count(re.score) as actualNumber,st.staffName as staffName "
@Select("SELECT ex.experimentalClassId as experimentalClassId,ex.experimentalClassName as experimentalClassName from assessment ass left join" + " FROM (assessment ass left join staff st on ass.staffId=st.staffId) left join record re on ass.id=re.assesmentId WHERE ass.id=#{assesmentId} and re.score is not null")
+ " experimental_class_ning ex on ex.experimentalClassId=ass.experimentalClassId where ass.id=#{assesmentId}") Assesment queryAssesmentId(Integer assesmentId);
ExperimentalClass queryExperimental(Integer assesmentId);
/**
/** * 实验班级
* 行政班级 *
* @param assesmentId * @param assesmentId
* @return * @return
*/ */
@Select("SELECT c.classId as classId,c.className as className from assessment ass left join class c on FIND_IN_SET(c.classId,ass.classId) where ass.id=#{assesmentId}") @Select("SELECT ex.experimentalClassId as experimentalClassId,ex.experimentalClassName as experimentalClassName from assessment ass left join"
List<SutdentClass> queryClass(Integer assesmentId); + " experimental_class_ning ex on ex.experimentalClassId=ass.experimentalClassId where ass.id=#{assesmentId}")
ExperimentalClass queryExperimental(Integer assesmentId);
/**
* 查询成绩(升序) /**
* @param assesmentId * 行政班级
* @param experimentalClassId *
* @param classId * @param assesmentId
* @return * @return
*/ */
@Select({"<script>", @Select("SELECT c.classId as classId,c.className as className from assessment ass left join class c on FIND_IN_SET(c.classId,ass.classId) where ass.id=#{assesmentId}")
"select re.score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId " List<SutdentClass> queryClass(Integer assesmentId);
+ " where re.assesmentId=#{assesmentId} ",
" <if test=' experimentalClassId!=null '>and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId)</if>",
" <if test=' classId!=null '>" /**
+ "<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'> #{id}</foreach>" * 查询成绩(升序)
+ "</if>", *
" and re.score is not null ORDER BY re.score", * @param assesmentId
"</script>"}) * @param experimentalClassId
List<Integer> queryScore(Integer assesmentId,@Param("experimentalClassId")Integer experimentalClassId,@Param("classId") List<Integer> classId); * @param classId
* @return
*/
/** @Select({"<script>",
* 分组查询分数和对应人数 "select re.score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
* @param assesmentId + " where re.assesmentId=#{assesmentId} ",
* @param experimentalClassId " <if test=' experimentalClassId!=null '>and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId)</if>",
* @param classId " <if test=' classId!=null '>"
* @return + "<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'> #{id}</foreach>"
*/ + "</if>",
@Select({"<script>", " and re.score is not null ORDER BY re.score",
"select re.score as score,count(re.recordId) as number FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId " "</script>"})
+ " where re.assesmentId=#{assesmentId} ", List<Integer> queryScore(Integer assesmentId, @Param("experimentalClassId") Integer experimentalClassId, @Param("classId") List<Integer> classId);
" <if test=' experimentalClassId!=null '> and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId) </if>",
" <if test=' classId!=null '>"
+ "<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'>#{id}</foreach>" /**
+ "</if>", * 分组查询分数和对应人数
" and re.score is not null GROUP BY re.score", *
"</script>"}) * @param assesmentId
List<Record> queryScore2(@Param("assesmentId")Integer assesmentId,@Param("experimentalClassId")Integer experimentalClassId, * @param experimentalClassId
@Param("classId") List<Integer> classId); * @param classId
* @return
*/
/** @Select({"<script>",
* 统计某个班的总错误量 "select re.score as score,count(re.recordId) as number FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
* @param assesmentId + " where re.assesmentId=#{assesmentId} ",
* @param experimentalClassId " <if test=' experimentalClassId!=null '> and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId) </if>",
* @param classId " <if test=' classId!=null '>"
* @return + "<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'>#{id}</foreach>"
*/ + "</if>",
@Select({"<script>", " and re.score is not null GROUP BY re.score",
"select count(*) from PointRecord where rightAndWrong = -1 and assesmentId=#{assesmentId}", "</script>"})
" <if test='experimentalClassId!=null '> and experimentalClassId=#{experimentalClassId} </if>", List<Record> queryScore2(@Param("assesmentId") Integer assesmentId, @Param("experimentalClassId") Integer experimentalClassId,
" <if test='classId!=null '>" @Param("classId") List<Integer> classId);
+ "<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id}</foreach>"
+ "</if>",
"</script>"}) /**
Integer queryRight(@Param("assesmentId")Integer assesmentId,@Param("experimentalClassId")Integer experimentalClassId, * 统计某个班的总错误量
@Param("classId") List<Integer> classId); *
* @param assesmentId
* @param experimentalClassId
/** * @param classId
* 统计该项目的判分点数量 * @return
* (select experimentId from assessment where id=#{assesmentId}) */
* @return @Select({"<script>",
*/ "select count(*) from PointRecord where rightAndWrong = -1 and assesmentId=#{assesmentId}",
@Select("select count(judgmentPointsId) from hr_judgment_points where FIND_IN_SET(#{projectId},projectId)") " <if test='experimentalClassId!=null '> and experimentalClassId=#{experimentalClassId} </if>",
Integer queryPointNumber(Integer projectId); " <if test='classId!=null '>"
+ "<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id}</foreach>"
+ "</if>",
/** "</script>"})
* 错误分布 Integer queryRight(@Param("assesmentId") Integer assesmentId, @Param("experimentalClassId") Integer experimentalClassId,
* @param assesmentId @Param("classId") List<Integer> classId);
* @param experimentalClassId
* @param classId
* @return /**
*/ * 统计该项目的判分点数量
@Select({"<script>", * (select experimentId from assessment where id=#{assesmentId})
"select judgmentPointsName,count(pr.judgmentPointsId) as number from PointRecord pr left join hr_judgment_points jp on pr.judgmentPointsId=jp.judgmentPointsId where rightAndWrong=-1 and assesmentId=#{assesmentId} ", *
" <if test='experimentalClassId!=null '> and experimentalClassId=#{experimentalClassId}</if>", * @return
" <if test='classId!=null '>" */
+ "<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id} </foreach>" @Select("select count(judgmentPointsId) from hr_judgment_points where FIND_IN_SET(#{projectId},projectId)")
+ "</if>", Integer queryPointNumber(Integer projectId);
"GROUP BY pr.judgmentPointsId",
"</script>"})
List<PointRecord> queryError(@Param("assesmentId")Integer assesmentId,@Param("experimentalClassId")Integer experimentalClassId, /**
@Param("classId") List<Integer> classId); * 错误分布
*
* @param assesmentId
@Select({"<script>", * @param experimentalClassId
"select stu.studentName as studentName,re.score as score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId " * @param classId
+ " where re.assesmentId=#{assesmentId} ", * @return
" <if test=' experimentalClassId!=null '>and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId) </if>", */
" <if test=' classId!=null '>" @Select({"<script>",
+ "<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'> #{id} </foreach>" "select judgmentPointsName,count(pr.judgmentPointsId) as number from PointRecord pr left join hr_judgment_points jp on pr.judgmentPointsId=jp.judgmentPointsId where rightAndWrong=-1 and assesmentId=#{assesmentId} ",
+ "</if>", " <if test='experimentalClassId!=null '> and experimentalClassId=#{experimentalClassId}</if>",
" and re.score is not null", " <if test='classId!=null '>"
"</script>"}) + "<foreach collection='classId' item='id' open='and classId in (' separator=',' close=')'>#{id} </foreach>"
List<HashMap<String, Integer>> queryScore3(@Param("assesmentId")Integer assesmentId,@Param("experimentalClassId")Integer experimentalClassId, + "</if>",
@Param("classId") List<Integer> classId); "GROUP BY pr.judgmentPointsId",
"</script>"})
List<PointRecord> queryError(@Param("assesmentId") Integer assesmentId, @Param("experimentalClassId") Integer experimentalClassId,
//开始考核 @Param("classId") List<Integer> classId);
@Select("select id,assesmentName,timesum from assessment where courseId=#{courseId} and releaseType=0 and assesmentState=0")
List<Assesment> releaseAssesment(Integer courseId);
@Select({"<script>",
"select stu.studentName as studentName,re.score as score FROM (record re left join assessment ass on ass.id=re.assesmentId) left join student stu on re.studentId=stu.studentId "
+ " where re.assesmentId=#{assesmentId} ",
" <if test=' experimentalClassId!=null '>and FIND_IN_SET(#{experimentalClassId},stu.experimentalClassId) </if>",
" <if test=' classId!=null '>"
+ "<foreach collection='classId' item='id' open='and stu.classId in (' separator=',' close=')'> #{id} </foreach>"
+ "</if>",
" and re.score is not null",
"</script>"})
List<HashMap<String, Integer>> queryScore3(@Param("assesmentId") Integer assesmentId, @Param("experimentalClassId") Integer experimentalClassId,
@Param("classId") List<Integer> classId);
//开始考核
@Select("select id,assesmentName,timesum from assessment where courseId=#{courseId} and releaseType=0 and assesmentState=0")
List<Assesment> releaseAssesment(Integer courseId);
} }

@ -300,13 +300,13 @@ public class AssesmentService {
/** /**
* 查询实验班级一级栏目 * 查询实验班级一级栏目
* *
* @param schoolId学校id * @param staffId教师id
* @return * @return
*/ */
public HashMap<String, Object> queryCretionTime(Integer schoolId) { public HashMap<String, Object> queryCretionTime(Integer staffId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
resp.put("retvalue", mapper.queryCreationTime(schoolId)); resp.put("retvalue", mapper.queryCreationTime(staffId));
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
@ -324,10 +324,10 @@ public class AssesmentService {
* @param cretionTime * @param cretionTime
* @return * @return
*/ */
public HashMap<String, Object> queryCretionTime(String cretionTime, Integer schoolId) { public HashMap<String, Object> queryCretionTime(String cretionTime, Integer staffId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
resp.put("retvalue", mapper.queryExperimentalClass(cretionTime, schoolId)); resp.put("retvalue", mapper.queryExperimentalClass(cretionTime, staffId));
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
@ -341,7 +341,6 @@ public class AssesmentService {
/** /**
* 考核信息展示 * 考核信息展示
*
* @param assesmentId * @param assesmentId
* @return * @return
*/ */

@ -36,14 +36,15 @@ public class MakeuplistService {
* @param staffId * @param staffId
* @return * @return
*/ */
public HashMap<String, Object> queryAllMakeuplist(Integer staffId,String uploadTime,Integer uploadType,Integer schoolId) { public HashMap<String, Object> queryAllMakeuplist(Integer staffId,long uploadTime,Integer uploadType,Integer schoolId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
String time= AssesmentHelper.longPointDate(uploadTime);
try { try {
if(uploadType.equals(0)){ if(uploadType.equals(0)){
List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,uploadTime,schoolId); List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,time,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
}else if(uploadType.equals(1)){ }else if(uploadType.equals(1)){
List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,uploadTime,schoolId); List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,time,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
} }
resp.put("retcode", 200); resp.put("retcode", 200);
@ -56,10 +57,11 @@ public class MakeuplistService {
return resp; return resp;
} }
public HashMap<String, Object> getStudent(Integer staffId,String uploadTime,Integer uploadType,Integer schoolId){ public HashMap<String, Object> getStudent(Integer staffId,long uploadTime,Integer uploadType,Integer schoolId){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
String time= AssesmentHelper.longPointDate(uploadTime);
try{ try{
resp.put("retvalue",makeuplistMapper.getstudent(staffId,uploadTime,schoolId)); resp.put("retvalue",makeuplistMapper.getstudent(staffId,time,schoolId));
resp.put("retcode", 200); resp.put("retcode", 200);
}catch (RuntimeException e){ }catch (RuntimeException e){
logger.error(e.getMessage()); logger.error(e.getMessage());
@ -72,14 +74,15 @@ public class MakeuplistService {
public HashMap<String, Object> getByMakeuplist(Integer staffId,String uploadTime,Integer uploadType,Integer schoolId){ public HashMap<String, Object> getByMakeuplist(Integer staffId,long uploadTime,Integer uploadType,Integer schoolId){
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
String time= AssesmentHelper.longPointDate(uploadTime);
try{ try{
if(uploadType.equals(0)){ if(uploadType.equals(0)){
List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,uploadTime,schoolId); List<Makeuplist> makeuplists=makeuplistMapper.queryExperimentalClassMakeuplist(staffId,time,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
}else if(uploadType.equals(1)){ }else if(uploadType.equals(1)){
List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,uploadTime,schoolId); List<Makeuplist> makeuplists=makeuplistMapper.queryClassMakeuplist(staffId,time,schoolId);
resp.put("retvalue", makeuplists); resp.put("retvalue", makeuplists);
} }
resp.put("retcode", 200); resp.put("retcode", 200);

Loading…
Cancel
Save