Commit b543a2f7359bef1fb8b897edc26944b597fcac28
1 parent
e6e6895d
Exists in
master
四维诊断
Showing
27 changed files
with
468 additions
and
62 deletions
Show diff stats
src/main/java/com/jevon/controller/LearnController.java
| @@ -69,8 +69,9 @@ public class LearnController { | @@ -69,8 +69,9 @@ public class LearnController { | ||
| 69 | analyse.setCourseName(createExamReqVo.getCourseName()); | 69 | analyse.setCourseName(createExamReqVo.getCourseName()); |
| 70 | analyse.setExamName(createExamReqVo.getExamName()); | 70 | analyse.setExamName(createExamReqVo.getExamName()); |
| 71 | analyse.setExamTime(createExamReqVo.getExamTime()); | 71 | analyse.setExamTime(createExamReqVo.getExamTime()); |
| 72 | - int id = analyseService.insert(analyse); | ||
| 73 | - baseVo.setMessage(id+""); | 72 | + analyse.setCreateTime(new Date()); |
| 73 | + analyseService.insert(analyse); | ||
| 74 | + baseVo.setMessage(analyse.getId()+""); | ||
| 74 | return baseVo; | 75 | return baseVo; |
| 75 | } | 76 | } |
| 76 | 77 | ||
| @@ -179,7 +180,7 @@ public class LearnController { | @@ -179,7 +180,7 @@ public class LearnController { | ||
| 179 | analyseDimensional.setAnalyseId(analyse.getId()); | 180 | analyseDimensional.setAnalyseId(analyse.getId()); |
| 180 | analyseDimensional.setDimensionalId(dimensionalId); | 181 | analyseDimensional.setDimensionalId(dimensionalId); |
| 181 | analyseDimensional.setQuestionNumber(questionNumber); | 182 | analyseDimensional.setQuestionNumber(questionNumber); |
| 182 | - analyseDimensional.setScore(new Float(score)); | 183 | + analyseDimensional.setScore(new Double(score)); |
| 183 | analyseDimensional.setCreateTime(new Date()); | 184 | analyseDimensional.setCreateTime(new Date()); |
| 184 | analyseDimensionals.add(analyseDimensional); | 185 | analyseDimensionals.add(analyseDimensional); |
| 185 | } | 186 | } |
| @@ -197,8 +198,6 @@ public class LearnController { | @@ -197,8 +198,6 @@ public class LearnController { | ||
| 197 | 198 | ||
| 198 | private void analysisScoreExcel(InitAnalyseReqVo initAnalyseReqVo){ | 199 | private void analysisScoreExcel(InitAnalyseReqVo initAnalyseReqVo){ |
| 199 | try{ | 200 | try{ |
| 200 | - List<StudentDetail> studentDetails = new ArrayList<>(); | ||
| 201 | - List<Student> students = new ArrayList<>(); | ||
| 202 | Analyse analyse = analyseService.selectById(initAnalyseReqVo.getAnalyseId()); | 201 | Analyse analyse = analyseService.selectById(initAnalyseReqVo.getAnalyseId()); |
| 203 | String fileUrl = initAnalyseReqVo.getUrl(); | 202 | String fileUrl = initAnalyseReqVo.getUrl(); |
| 204 | File excelFile = new File(fileUrl); | 203 | File excelFile = new File(fileUrl); |
| @@ -211,47 +210,54 @@ public class LearnController { | @@ -211,47 +210,54 @@ public class LearnController { | ||
| 211 | workbook = new XSSFWorkbook(new FileInputStream(excelFile)); | 210 | workbook = new XSSFWorkbook(new FileInputStream(excelFile)); |
| 212 | } | 211 | } |
| 213 | // 获得工作表 | 212 | // 获得工作表 |
| 214 | - Sheet sheet = workbook.getSheetAt(0); | ||
| 215 | - Date date = new Date(); | ||
| 216 | - int rows = sheet.getPhysicalNumberOfRows(); | ||
| 217 | - Map<Integer , String> map = new HashMap<>(); | ||
| 218 | - for (int i = 0; i <= rows; i++) { | ||
| 219 | - // 获取第i行数据 | ||
| 220 | - Row sheetRow = sheet.getRow(i); | ||
| 221 | - if (i == 0) { | ||
| 222 | - //获取标题 | ||
| 223 | - }else if(i == 1){ | ||
| 224 | - //获取表头 | ||
| 225 | - int j = 7 ; | ||
| 226 | - while (sheetRow.getCell(j) != null){ | ||
| 227 | - Cell cell = sheetRow.getCell(j); | ||
| 228 | - cell.setCellType(CellType.STRING); | ||
| 229 | - map.put(j,cell.getStringCellValue().trim()); | ||
| 230 | - j++; | ||
| 231 | - } | ||
| 232 | - } else { | ||
| 233 | - ScoreExcelVo scoreExcelVo = new ScoreExcelVo(sheetRow); | ||
| 234 | - Student student = new Student(scoreExcelVo); | ||
| 235 | - student.setAnalyseId(analyse.getId()); | ||
| 236 | - student.setCreateTime(date); | ||
| 237 | - students.add(student); | ||
| 238 | - int j = 7 ; | ||
| 239 | - while (sheetRow.getCell(j) != null){ | ||
| 240 | - Cell cell = sheetRow.getCell(j); | ||
| 241 | - StudentDetail studentDetail = new StudentDetail(scoreExcelVo); | ||
| 242 | - studentDetail.setAnalyseId(analyse.getId()); | ||
| 243 | - studentDetail.setExamNumber(map.get(j)); | ||
| 244 | - studentDetail.setScore(new Float(cell.getNumericCellValue())); | ||
| 245 | - studentDetail.setCreateTime(date); | ||
| 246 | - studentDetails.add(studentDetail); | ||
| 247 | - j++; | 213 | + for(int number = 0 ; number < workbook.getNumberOfSheets() ; number++){ |
| 214 | + Sheet sheet = workbook.getSheetAt(number); | ||
| 215 | + List<StudentDetail> studentDetails = new ArrayList<>(); | ||
| 216 | + List<Student> students = new ArrayList<>(); | ||
| 217 | + Date date = new Date(); | ||
| 218 | + int rows = sheet.getPhysicalNumberOfRows(); | ||
| 219 | + Map<Integer , String> map = new HashMap<>(); | ||
| 220 | + for (int i = 0; i < rows; i++) { | ||
| 221 | + // 获取第i行数据 | ||
| 222 | + Row sheetRow = sheet.getRow(i); | ||
| 223 | + if (i == 0) { | ||
| 224 | + //获取标题 | ||
| 225 | + }else if(i == 1){ | ||
| 226 | + //获取表头 | ||
| 227 | + int j = 7 ; | ||
| 228 | + while (sheetRow.getCell(j) != null){ | ||
| 229 | + Cell cell = sheetRow.getCell(j); | ||
| 230 | + cell.setCellType(CellType.STRING); | ||
| 231 | + map.put(j,cell.getStringCellValue().trim()); | ||
| 232 | + j++; | ||
| 233 | + } | ||
| 234 | + } else { | ||
| 235 | + ScoreExcelVo scoreExcelVo = new ScoreExcelVo(sheetRow); | ||
| 236 | + if(StringUtils.isNotBlank(scoreExcelVo.getStudentName())){ | ||
| 237 | + Student student = new Student(scoreExcelVo); | ||
| 238 | + student.setAnalyseId(analyse.getId()); | ||
| 239 | + student.setCreateTime(date); | ||
| 240 | + students.add(student); | ||
| 241 | + int j = 7 ; | ||
| 242 | + while (sheetRow.getCell(j) != null){ | ||
| 243 | + Cell cell = sheetRow.getCell(j); | ||
| 244 | + StudentDetail studentDetail = new StudentDetail(scoreExcelVo); | ||
| 245 | + studentDetail.setAnalyseId(analyse.getId()); | ||
| 246 | + studentDetail.setExamNumber(map.get(j)); | ||
| 247 | + studentDetail.setScore(new Double(cell.getNumericCellValue())); | ||
| 248 | + studentDetail.setCreateTime(date); | ||
| 249 | + studentDetails.add(studentDetail); | ||
| 250 | + j++; | ||
| 251 | + } | ||
| 252 | + } | ||
| 248 | } | 253 | } |
| 249 | - } | 254 | + } |
| 255 | + studentService.insertBatch(students); | ||
| 256 | + studentDetailService.insertBatch(studentDetails); | ||
| 250 | } | 257 | } |
| 251 | - studentService.insertBatch(students); | ||
| 252 | - studentDetailService.insertBatch(studentDetails); | ||
| 253 | }catch (Exception e){ | 258 | }catch (Exception e){ |
| 254 | - System.out.println(e); | 259 | + e.printStackTrace(); |
| 260 | + System.out.println(e.toString()); | ||
| 255 | } | 261 | } |
| 256 | } | 262 | } |
| 257 | } | 263 | } |
src/main/java/com/jevon/controller/LearnStatController.java
| 1 | package com.jevon.controller; | 1 | package com.jevon.controller; |
| 2 | 2 | ||
| 3 | -import com.jevon.model.Analyse; | ||
| 4 | -import com.jevon.model.AnalyseDetail; | ||
| 5 | -import com.jevon.model.Student; | 3 | +import com.jevon.enums.DifficultEnums; |
| 4 | +import com.jevon.enums.DimensionalEnums; | ||
| 5 | +import com.jevon.model.*; | ||
| 6 | import com.jevon.service.*; | 6 | import com.jevon.service.*; |
| 7 | -import com.jevon.vo.BaseVo; | ||
| 8 | import com.jevon.vo.req.GetLearnReqVo; | 7 | import com.jevon.vo.req.GetLearnReqVo; |
| 9 | import com.jevon.wordDTO.second.*; | 8 | import com.jevon.wordDTO.second.*; |
| 10 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| @@ -47,6 +46,26 @@ public class LearnStatController { | @@ -47,6 +46,26 @@ public class LearnStatController { | ||
| 47 | @Autowired | 46 | @Autowired |
| 48 | StudentService studentService; | 47 | StudentService studentService; |
| 49 | 48 | ||
| 49 | + @ApiOperation("getForm1_1") | ||
| 50 | + @RequestMapping(value = "getForm1_1", method = RequestMethod.POST) | ||
| 51 | + public List<Form7> getForm1_1(@RequestBody GetLearnReqVo getLearnReqVo){ | ||
| 52 | + Analyse analyse = analyseService.selectById(getLearnReqVo.getAnalyseId()); | ||
| 53 | + List<Form7> list = new ArrayList<>(); | ||
| 54 | + Form7 form7 = new Form7(); | ||
| 55 | + form7.setName(DifficultEnums.easy.getDifficultName()); | ||
| 56 | + form7.setPercent(analyseDetailService.selectDifficult(analyse.getId(),DifficultEnums.easy.getDifficultType())/analyse.getMaxScore()*100); | ||
| 57 | + list.add(form7); | ||
| 58 | + Form7 form = new Form7(); | ||
| 59 | + form.setName(DifficultEnums.medium.getDifficultName()); | ||
| 60 | + form.setPercent(analyseDetailService.selectDifficult(analyse.getId(),DifficultEnums.medium.getDifficultType())/analyse.getMaxScore()*100); | ||
| 61 | + list.add(form); | ||
| 62 | + Form7 form2 = new Form7(); | ||
| 63 | + form2.setName(DifficultEnums.difficult.getDifficultName()); | ||
| 64 | + form2.setPercent(analyseDetailService.selectDifficult(analyse.getId(),DifficultEnums.difficult.getDifficultType())/analyse.getMaxScore()*100); | ||
| 65 | + list.add(form2); | ||
| 66 | + return list; | ||
| 67 | + } | ||
| 68 | + | ||
| 50 | @ApiOperation("getForm2_1_1") | 69 | @ApiOperation("getForm2_1_1") |
| 51 | @RequestMapping(value = "getForm2_1_1", method = RequestMethod.POST) | 70 | @RequestMapping(value = "getForm2_1_1", method = RequestMethod.POST) |
| 52 | public Form1RepVo getForm2_1_1(@RequestBody GetLearnReqVo getLearnReqVo){ | 71 | public Form1RepVo getForm2_1_1(@RequestBody GetLearnReqVo getLearnReqVo){ |
| @@ -98,7 +117,7 @@ public class LearnStatController { | @@ -98,7 +117,7 @@ public class LearnStatController { | ||
| 98 | Analyse analyse = analyseService.selectById(getLearnReqVo.getAnalyseId()); | 117 | Analyse analyse = analyseService.selectById(getLearnReqVo.getAnalyseId()); |
| 99 | List<Student> allStudents = studentService.selectBySchoolName(getLearnReqVo.getAnalyseId(),null); | 118 | List<Student> allStudents = studentService.selectBySchoolName(getLearnReqVo.getAnalyseId(),null); |
| 100 | List<Student> students = studentService.selectBySchoolName(getLearnReqVo.getAnalyseId(),getLearnReqVo.getSchoolName()); | 119 | List<Student> students = studentService.selectBySchoolName(getLearnReqVo.getAnalyseId(),getLearnReqVo.getSchoolName()); |
| 101 | - //先算高分段的分数 再去人数 | 120 | + //先算高分段的分数 |
| 102 | int highNumber = (int) Math.floor(allStudents.size()*0.27); | 121 | int highNumber = (int) Math.floor(allStudents.size()*0.27); |
| 103 | double highScore = allStudents.get(highNumber).getScore(); | 122 | double highScore = allStudents.get(highNumber).getScore(); |
| 104 | int lowNumber = allStudents.size()-highNumber; | 123 | int lowNumber = allStudents.size()-highNumber; |
| @@ -290,6 +309,7 @@ public class LearnStatController { | @@ -290,6 +309,7 @@ public class LearnStatController { | ||
| 290 | Double schoolSumScore = studentDetailService.selectSumScore(analyse.getId(),getLearnReqVo.getSchoolName(),analyseDetail.getQuestionNumber()); | 309 | Double schoolSumScore = studentDetailService.selectSumScore(analyse.getId(),getLearnReqVo.getSchoolName(),analyseDetail.getQuestionNumber()); |
| 291 | from5.setExamNumber(analyseDetail.getQuestionNumber()); | 310 | from5.setExamNumber(analyseDetail.getQuestionNumber()); |
| 292 | from5.setScore(analyseDetail.getScore()); | 311 | from5.setScore(analyseDetail.getScore()); |
| 312 | + from5.setDifficultName(DifficultEnums.getDifficultName(analyseDetail.getDifficult())); | ||
| 293 | from5.setAllRate(allSumScore/new Double(allStudents.size()) / analyseDetail.getScore()); | 313 | from5.setAllRate(allSumScore/new Double(allStudents.size()) / analyseDetail.getScore()); |
| 294 | from5.setSchoolRate(schoolSumScore/new Double(students.size()) / analyseDetail.getScore()); | 314 | from5.setSchoolRate(schoolSumScore/new Double(students.size()) / analyseDetail.getScore()); |
| 295 | from5.setAllAvg(allSumScore / new Double(allStudents.size())); | 315 | from5.setAllAvg(allSumScore / new Double(allStudents.size())); |
| @@ -304,4 +324,110 @@ public class LearnStatController { | @@ -304,4 +324,110 @@ public class LearnStatController { | ||
| 304 | } | 324 | } |
| 305 | return list; | 325 | return list; |
| 306 | } | 326 | } |
| 327 | + | ||
| 328 | + @ApiOperation("getForm2_2_4") | ||
| 329 | + @RequestMapping(value = "getForm2_2_4", method = RequestMethod.POST) | ||
| 330 | + public List<Form8> getForm2_2_4(@RequestBody GetLearnReqVo getLearnReqVo){ | ||
| 331 | + Analyse analyse = analyseService.selectById(getLearnReqVo.getAnalyseId()); | ||
| 332 | + List<Form8> list = new ArrayList<>(); | ||
| 333 | + List<Student> allStudents = studentService.selectBySchoolName(analyse.getId(),null); | ||
| 334 | + List<Student> students = studentService.selectBySchoolName(analyse.getId(),getLearnReqVo.getSchoolName()); | ||
| 335 | + for(DifficultEnums enums : DifficultEnums.values()){ | ||
| 336 | + Form8 form8 = new Form8(); | ||
| 337 | + form8.setDifficultName(enums.getDifficultName()); | ||
| 338 | + form8.setScore(analyseDetailService.selectDifficult(analyse.getId(),enums.getDifficultType())); | ||
| 339 | + List<AnalyseDetail> analyseDetails = analyseDetailService.selectDifficultDetail(analyse.getId(),enums.getDifficultType()); | ||
| 340 | + Double allSumScore = 0d , schoolSumScore = 0d , score = 0d; | ||
| 341 | + for(AnalyseDetail analyseDetail : analyseDetails){ | ||
| 342 | + allSumScore = allSumScore + studentDetailService.selectSumScore(analyse.getId(),null,analyseDetail.getQuestionNumber()); | ||
| 343 | + schoolSumScore = schoolSumScore + studentDetailService.selectSumScore(analyse.getId(),getLearnReqVo.getSchoolName(),analyseDetail.getQuestionNumber()); | ||
| 344 | + score = score + analyseDetail.getScore() ; | ||
| 345 | + } | ||
| 346 | + form8.setAllRate(allSumScore / new Double(allStudents.size()) / score ); | ||
| 347 | + form8.setSchoolRate(schoolSumScore / new Double(students.size()) / score); | ||
| 348 | + list.add(form8); | ||
| 349 | + } | ||
| 350 | + return list; | ||
| 351 | + } | ||
| 352 | + | ||
| 353 | + @ApiOperation("getForm3_1") | ||
| 354 | + @RequestMapping(value = "getForm3_1", method = RequestMethod.POST) | ||
| 355 | + public List<Form6> getForm3_1(@RequestBody GetLearnReqVo getLearnReqVo){ | ||
| 356 | + return initDimensional(getLearnReqVo,DimensionalEnums.knowledge.getDimensionalType()); | ||
| 357 | + } | ||
| 358 | + | ||
| 359 | + @ApiOperation("getForm3_2") | ||
| 360 | + @RequestMapping(value = "getForm3_2", method = RequestMethod.POST) | ||
| 361 | + public List<Form6> getForm3_2(@RequestBody GetLearnReqVo getLearnReqVo){ | ||
| 362 | + return initDimensional(getLearnReqVo,DimensionalEnums.skill.getDimensionalType()); | ||
| 363 | + } | ||
| 364 | + | ||
| 365 | + @ApiOperation("getForm3_3") | ||
| 366 | + @RequestMapping(value = "getForm3_3", method = RequestMethod.POST) | ||
| 367 | + public List<Form6> getForm3_3(@RequestBody GetLearnReqVo getLearnReqVo){ | ||
| 368 | + return initDimensional(getLearnReqVo,DimensionalEnums.ability.getDimensionalType()); | ||
| 369 | + } | ||
| 370 | + | ||
| 371 | + @ApiOperation("getForm3_4") | ||
| 372 | + @RequestMapping(value = "getForm3_4", method = RequestMethod.POST) | ||
| 373 | + public List<Form6> getForm3_4(@RequestBody GetLearnReqVo getLearnReqVo){ | ||
| 374 | + return initDimensional(getLearnReqVo,DimensionalEnums.think.getDimensionalType()); | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + private List<Form6> initDimensional(GetLearnReqVo getLearnReqVo , int dimensionalType){ | ||
| 378 | + List<Form6> list = new ArrayList<>(); | ||
| 379 | + Analyse analyse = analyseService.selectById(getLearnReqVo.getAnalyseId()); | ||
| 380 | + List<Student> allStudents = studentService.selectBySchoolName(analyse.getId(),null); | ||
| 381 | + int allNumber = (int) Math.floor(allStudents.size()*0.27) ; | ||
| 382 | + List<String> allHighStudent = new ArrayList<>(); | ||
| 383 | + List<String> allLowStudent = new ArrayList<>(); | ||
| 384 | + for (int i = 0; i < allNumber ; i++) { | ||
| 385 | + allHighStudent.add(allStudents.get(i).getStudentNumber()); | ||
| 386 | + } | ||
| 387 | + for(int i =allStudents.size()-allNumber ; i < allStudents.size() ; i++){ | ||
| 388 | + allLowStudent.add(allStudents.get(i).getStudentNumber()); | ||
| 389 | + } | ||
| 390 | + List<Student> students = studentService.selectBySchoolName(analyse.getId(),getLearnReqVo.getSchoolName()); | ||
| 391 | + int number = (int) Math.floor(students.size()*0.27) ; | ||
| 392 | + List<String> highStudent = new ArrayList<>(); | ||
| 393 | + List<String> lowStudent = new ArrayList<>(); | ||
| 394 | + for (int i = 0; i < number ; i++) { | ||
| 395 | + highStudent.add(students.get(i).getStudentNumber()); | ||
| 396 | + } | ||
| 397 | + for(int i =students.size()-number ; i < students.size() ; i++){ | ||
| 398 | + lowStudent.add(students.get(i).getStudentNumber()); | ||
| 399 | + } | ||
| 400 | + List<Dimensional> knowledgeList = dimensionalService.selectByAnalyse(analyse.getId(),dimensionalType); | ||
| 401 | + for(Dimensional dimensional : knowledgeList){ | ||
| 402 | + Form6 form6 = new Form6(); | ||
| 403 | + form6.setKnowledge(dimensional.getDimensionalName()); | ||
| 404 | + List<AnalyseDimensional> analyseDimensionals = analyseDimensionalService.selectByDimensional(analyse.getId(),dimensional.getId()); | ||
| 405 | + Double score = 0d; | ||
| 406 | + Double allSumScore = 0d ; | ||
| 407 | + Double schoolSumScore = 0d ; | ||
| 408 | + int allHigh = 0 , allLow = 0 , high = 0 , low = 0 ; | ||
| 409 | + StringBuffer examNumber = new StringBuffer(); | ||
| 410 | + for(AnalyseDimensional analyseDimensional :analyseDimensionals){ | ||
| 411 | + score = score + analyseDimensional.getScore() ; | ||
| 412 | + allSumScore = allSumScore + studentDetailService.selectSumScore(analyse.getId(),null,analyseDimensional.getQuestionNumber()); | ||
| 413 | + schoolSumScore = schoolSumScore + studentDetailService.selectSumScore(analyse.getId(),getLearnReqVo.getSchoolName(),analyseDimensional.getQuestionNumber()); | ||
| 414 | + allHigh = allHigh + studentDetailService.selectTrueByExamNumber(analyse.getId(),null ,analyseDimensional.getQuestionNumber(),allHighStudent,analyseDimensional.getScore()); | ||
| 415 | + allLow = allLow + studentDetailService.selectTrueByExamNumber(analyse.getId(),null ,analyseDimensional.getQuestionNumber(),allLowStudent,analyseDimensional.getScore()); | ||
| 416 | + high = high + studentDetailService.selectTrueByExamNumber(analyse.getId(),getLearnReqVo.getSchoolName() ,analyseDimensional.getQuestionNumber(),highStudent,analyseDimensional.getScore()); | ||
| 417 | + low = low + studentDetailService.selectTrueByExamNumber(analyse.getId(),getLearnReqVo.getSchoolName() ,analyseDimensional.getQuestionNumber(),lowStudent,analyseDimensional.getScore()); | ||
| 418 | + examNumber.append(analyseDimensional.getQuestionNumber()).append(","); | ||
| 419 | + } | ||
| 420 | + form6.setScore(score); | ||
| 421 | + form6.setAllRate(allSumScore / new Double(allStudents.size()) / score ); | ||
| 422 | + form6.setAllAvg(allSumScore / new Double(allStudents.size())); | ||
| 423 | + form6.setSchoolRate(schoolSumScore / new Double(students.size()) / score); | ||
| 424 | + form6.setSchoolAvg(schoolSumScore / new Double(students.size())); | ||
| 425 | + form6.setAllDist(new Double(allHigh-allLow) / new Double(allNumber * analyseDimensionals.size())); | ||
| 426 | + form6.setSchoolDist(new Double(high-low) / new Double(number * analyseDimensionals.size())); | ||
| 427 | + form6.setExamNumber(examNumber.toString().substring(0,examNumber.toString().length()-1)); | ||
| 428 | + list.add(form6); | ||
| 429 | + } | ||
| 430 | + return list; | ||
| 431 | + } | ||
| 432 | + | ||
| 307 | } | 433 | } |
src/main/java/com/jevon/enums/DifficultEnums.java
| @@ -43,4 +43,13 @@ public enum DifficultEnums { | @@ -43,4 +43,13 @@ public enum DifficultEnums { | ||
| 43 | } | 43 | } |
| 44 | return 0 ; | 44 | return 0 ; |
| 45 | } | 45 | } |
| 46 | + | ||
| 47 | + public static String getDifficultName(int difficultType){ | ||
| 48 | + for (DifficultEnums difficultEnums : DifficultEnums.values()) { | ||
| 49 | + if (difficultEnums.getDifficultType() == difficultType) { | ||
| 50 | + return difficultEnums.getDifficultName(); | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + return "" ; | ||
| 54 | + } | ||
| 46 | } | 55 | } |
src/main/java/com/jevon/mapper/AnalyseDetailMapper.java
| @@ -14,4 +14,10 @@ public interface AnalyseDetailMapper { | @@ -14,4 +14,10 @@ public interface AnalyseDetailMapper { | ||
| 14 | int insertBatch(List<AnalyseDetail> list); | 14 | int insertBatch(List<AnalyseDetail> list); |
| 15 | 15 | ||
| 16 | List<AnalyseDetail> selectByAnalyseId(int analyseId); | 16 | List<AnalyseDetail> selectByAnalyseId(int analyseId); |
| 17 | + | ||
| 18 | + Double selectDifficult(AnalyseDetail analyseDetail); | ||
| 19 | + | ||
| 20 | + List<AnalyseDetail> selectDifficultDetail(AnalyseDetail analyseDetail); | ||
| 21 | + | ||
| 22 | + List<String> selectQuestionType(int analyseId); | ||
| 17 | } | 23 | } |
src/main/java/com/jevon/mapper/AnalyseDimensionalMapper.java
| @@ -12,4 +12,6 @@ import java.util.List; | @@ -12,4 +12,6 @@ import java.util.List; | ||
| 12 | public interface AnalyseDimensionalMapper { | 12 | public interface AnalyseDimensionalMapper { |
| 13 | 13 | ||
| 14 | int insertBatch(List<AnalyseDimensional> list); | 14 | int insertBatch(List<AnalyseDimensional> list); |
| 15 | + | ||
| 16 | + List<AnalyseDimensional> selectByDimensional(AnalyseDimensional analyseDimensional); | ||
| 15 | } | 17 | } |
src/main/java/com/jevon/mapper/DimensionalMapper.java
| @@ -14,4 +14,6 @@ public interface DimensionalMapper { | @@ -14,4 +14,6 @@ public interface DimensionalMapper { | ||
| 14 | int insert(Dimensional dimensional); | 14 | int insert(Dimensional dimensional); |
| 15 | 15 | ||
| 16 | List<Dimensional> select(Dimensional dimensional); | 16 | List<Dimensional> select(Dimensional dimensional); |
| 17 | + | ||
| 18 | + List<Dimensional> selectByAnalyse(Dimensional dimensional); | ||
| 17 | } | 19 | } |
src/main/java/com/jevon/model/AnalyseDimensional.java
| @@ -13,7 +13,7 @@ public class AnalyseDimensional { | @@ -13,7 +13,7 @@ public class AnalyseDimensional { | ||
| 13 | private int analyseId ; | 13 | private int analyseId ; |
| 14 | private String questionNumber ; | 14 | private String questionNumber ; |
| 15 | private int dimensionalId ; | 15 | private int dimensionalId ; |
| 16 | - private float score ; | 16 | + private Double score ; |
| 17 | private Date createTime ; | 17 | private Date createTime ; |
| 18 | 18 | ||
| 19 | public int getId() { | 19 | public int getId() { |
| @@ -48,11 +48,11 @@ public class AnalyseDimensional { | @@ -48,11 +48,11 @@ public class AnalyseDimensional { | ||
| 48 | this.dimensionalId = dimensionalId; | 48 | this.dimensionalId = dimensionalId; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | - public float getScore() { | 51 | + public Double getScore() { |
| 52 | return score; | 52 | return score; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | - public void setScore(float score) { | 55 | + public void setScore(Double score) { |
| 56 | this.score = score; | 56 | this.score = score; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -63,4 +63,5 @@ public class AnalyseDimensional { | @@ -63,4 +63,5 @@ public class AnalyseDimensional { | ||
| 63 | public void setCreateTime(Date createTime) { | 63 | public void setCreateTime(Date createTime) { |
| 64 | this.createTime = createTime; | 64 | this.createTime = createTime; |
| 65 | } | 65 | } |
| 66 | + | ||
| 66 | } | 67 | } |
src/main/java/com/jevon/model/Dimensional.java
| @@ -13,6 +13,8 @@ public class Dimensional { | @@ -13,6 +13,8 @@ public class Dimensional { | ||
| 13 | private int dimensionalType ; | 13 | private int dimensionalType ; |
| 14 | private String dimensionalName; | 14 | private String dimensionalName; |
| 15 | private Date createTime ; | 15 | private Date createTime ; |
| 16 | + //查询用 | ||
| 17 | + private int analyseId ; | ||
| 16 | 18 | ||
| 17 | public int getId() { | 19 | public int getId() { |
| 18 | return id; | 20 | return id; |
| @@ -45,4 +47,12 @@ public class Dimensional { | @@ -45,4 +47,12 @@ public class Dimensional { | ||
| 45 | public void setCreateTime(Date createTime) { | 47 | public void setCreateTime(Date createTime) { |
| 46 | this.createTime = createTime; | 48 | this.createTime = createTime; |
| 47 | } | 49 | } |
| 50 | + | ||
| 51 | + public int getAnalyseId() { | ||
| 52 | + return analyseId; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public void setAnalyseId(int analyseId) { | ||
| 56 | + this.analyseId = analyseId; | ||
| 57 | + } | ||
| 48 | } | 58 | } |
src/main/java/com/jevon/model/Student.java
| @@ -18,7 +18,7 @@ public class Student { | @@ -18,7 +18,7 @@ public class Student { | ||
| 18 | private String studentName ; | 18 | private String studentName ; |
| 19 | private String studentNumber ; | 19 | private String studentNumber ; |
| 20 | private int analyseId ; | 20 | private int analyseId ; |
| 21 | - private float score ; | 21 | + private double score ; |
| 22 | private Date createTime ; | 22 | private Date createTime ; |
| 23 | 23 | ||
| 24 | private double begin ; | 24 | private double begin ; |
| @@ -29,7 +29,7 @@ public class Student { | @@ -29,7 +29,7 @@ public class Student { | ||
| 29 | this.className = scoreExcelVo.getClassName(); | 29 | this.className = scoreExcelVo.getClassName(); |
| 30 | this.studentName = scoreExcelVo.getStudentName(); | 30 | this.studentName = scoreExcelVo.getStudentName(); |
| 31 | this.studentNumber = scoreExcelVo.getStudentNumber(); | 31 | this.studentNumber = scoreExcelVo.getStudentNumber(); |
| 32 | - this.score =new Float(scoreExcelVo.getScore()); | 32 | + this.score = new Double(scoreExcelVo.getScore()); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | public Student() { | 35 | public Student() { |
| @@ -91,11 +91,11 @@ public class Student { | @@ -91,11 +91,11 @@ public class Student { | ||
| 91 | this.analyseId = analyseId; | 91 | this.analyseId = analyseId; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | - public float getScore() { | 94 | + public double getScore() { |
| 95 | return score; | 95 | return score; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | - public void setScore(float score) { | 98 | + public void setScore(double score) { |
| 99 | this.score = score; | 99 | this.score = score; |
| 100 | } | 100 | } |
| 101 | 101 |
src/main/java/com/jevon/model/StudentDetail.java
| @@ -20,7 +20,7 @@ public class StudentDetail { | @@ -20,7 +20,7 @@ public class StudentDetail { | ||
| 20 | private String studentNumber ; | 20 | private String studentNumber ; |
| 21 | private int analyseId ; | 21 | private int analyseId ; |
| 22 | private String examNumber ; | 22 | private String examNumber ; |
| 23 | - private float score ; | 23 | + private Double score ; |
| 24 | private Date createTime ; | 24 | private Date createTime ; |
| 25 | 25 | ||
| 26 | //查询用 高分段 低分段学生考号 | 26 | //查询用 高分段 低分段学生考号 |
| @@ -100,11 +100,11 @@ public class StudentDetail { | @@ -100,11 +100,11 @@ public class StudentDetail { | ||
| 100 | this.examNumber = examNumber; | 100 | this.examNumber = examNumber; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | - public float getScore() { | 103 | + public Double getScore() { |
| 104 | return score; | 104 | return score; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | - public void setScore(float score) { | 107 | + public void setScore(Double score) { |
| 108 | this.score = score; | 108 | this.score = score; |
| 109 | } | 109 | } |
| 110 | 110 |
src/main/java/com/jevon/service/AnalyseDetailService.java
| @@ -15,5 +15,10 @@ public interface AnalyseDetailService { | @@ -15,5 +15,10 @@ public interface AnalyseDetailService { | ||
| 15 | 15 | ||
| 16 | List<AnalyseDetail> selectByAnalyseId(int analyseId); | 16 | List<AnalyseDetail> selectByAnalyseId(int analyseId); |
| 17 | 17 | ||
| 18 | + Double selectDifficult(int analyseId , int difficult); | ||
| 19 | + | ||
| 20 | + List<AnalyseDetail> selectDifficultDetail(int analyseId , int difficult); | ||
| 21 | + | ||
| 22 | + List<String> selectQuestionType(int analyseId); | ||
| 18 | 23 | ||
| 19 | } | 24 | } |
src/main/java/com/jevon/service/AnalyseDimensionalService.java
| @@ -13,4 +13,6 @@ public interface AnalyseDimensionalService { | @@ -13,4 +13,6 @@ public interface AnalyseDimensionalService { | ||
| 13 | 13 | ||
| 14 | int insertBatch(List<AnalyseDimensional> list); | 14 | int insertBatch(List<AnalyseDimensional> list); |
| 15 | 15 | ||
| 16 | + List<AnalyseDimensional> selectByDimensional(int analyseId ,int dimensionalId); | ||
| 17 | + | ||
| 16 | } | 18 | } |
src/main/java/com/jevon/service/DimensionalService.java
| @@ -16,4 +16,7 @@ public interface DimensionalService { | @@ -16,4 +16,7 @@ public interface DimensionalService { | ||
| 16 | List<Dimensional> select(Dimensional dimensional); | 16 | List<Dimensional> select(Dimensional dimensional); |
| 17 | 17 | ||
| 18 | Dimensional selectByTypeAndName(int type , String name); | 18 | Dimensional selectByTypeAndName(int type , String name); |
| 19 | + | ||
| 20 | + List<Dimensional> selectByAnalyse(int analyseId , int dimensionalType); | ||
| 21 | + | ||
| 19 | } | 22 | } |
src/main/java/com/jevon/service/StudentDetailService.java
| @@ -16,5 +16,4 @@ public interface StudentDetailService { | @@ -16,5 +16,4 @@ public interface StudentDetailService { | ||
| 16 | Double selectSumScore(int analyseId , String schoolName , String examNumber); | 16 | Double selectSumScore(int analyseId , String schoolName , String examNumber); |
| 17 | 17 | ||
| 18 | int selectTrueByExamNumber(int analyseId , String schoolName , String examNumber , List<String> studentNumbers ,Double score); | 18 | int selectTrueByExamNumber(int analyseId , String schoolName , String examNumber , List<String> studentNumbers ,Double score); |
| 19 | - | ||
| 20 | } | 19 | } |
src/main/java/com/jevon/service/impl/AnalyseDetailServiceImpl.java
| @@ -40,4 +40,25 @@ public class AnalyseDetailServiceImpl implements AnalyseDetailService { | @@ -40,4 +40,25 @@ public class AnalyseDetailServiceImpl implements AnalyseDetailService { | ||
| 40 | public List<AnalyseDetail> selectByAnalyseId(int analyseId) { | 40 | public List<AnalyseDetail> selectByAnalyseId(int analyseId) { |
| 41 | return analyseDetailMapper.selectByAnalyseId(analyseId); | 41 | return analyseDetailMapper.selectByAnalyseId(analyseId); |
| 42 | } | 42 | } |
| 43 | + | ||
| 44 | + @Override | ||
| 45 | + public Double selectDifficult(int analyseId, int difficult) { | ||
| 46 | + AnalyseDetail analyseDetail = new AnalyseDetail(); | ||
| 47 | + analyseDetail.setDifficult(difficult); | ||
| 48 | + analyseDetail.setAnalyseId(analyseId); | ||
| 49 | + return analyseDetailMapper.selectDifficult(analyseDetail); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + @Override | ||
| 53 | + public List<AnalyseDetail> selectDifficultDetail(int analyseId, int difficult) { | ||
| 54 | + AnalyseDetail analyseDetail = new AnalyseDetail(); | ||
| 55 | + analyseDetail.setDifficult(difficult); | ||
| 56 | + analyseDetail.setAnalyseId(analyseId); | ||
| 57 | + return analyseDetailMapper.selectDifficultDetail(analyseDetail); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Override | ||
| 61 | + public List<String> selectQuestionType(int analyseId) { | ||
| 62 | + return analyseDetailMapper.selectQuestionType(analyseId); | ||
| 63 | + } | ||
| 43 | } | 64 | } |
src/main/java/com/jevon/service/impl/AnalyseDimensionalServiceImpl.java
| @@ -35,4 +35,12 @@ public class AnalyseDimensionalServiceImpl implements AnalyseDimensionalService | @@ -35,4 +35,12 @@ public class AnalyseDimensionalServiceImpl implements AnalyseDimensionalService | ||
| 35 | analyseDimensionalMapper.insertBatch(result); | 35 | analyseDimensionalMapper.insertBatch(result); |
| 36 | return 1 ; | 36 | return 1 ; |
| 37 | } | 37 | } |
| 38 | + | ||
| 39 | + @Override | ||
| 40 | + public List<AnalyseDimensional> selectByDimensional(int analyseId, int dimensionalId) { | ||
| 41 | + AnalyseDimensional analyseDimensional = new AnalyseDimensional(); | ||
| 42 | + analyseDimensional.setAnalyseId(analyseId); | ||
| 43 | + analyseDimensional.setDimensionalId(dimensionalId); | ||
| 44 | + return analyseDimensionalMapper.selectByDimensional(analyseDimensional); | ||
| 45 | + } | ||
| 38 | } | 46 | } |
src/main/java/com/jevon/service/impl/DimensionalServiceImpl.java
| @@ -41,4 +41,12 @@ public class DimensionalServiceImpl implements DimensionalService { | @@ -41,4 +41,12 @@ public class DimensionalServiceImpl implements DimensionalService { | ||
| 41 | } | 41 | } |
| 42 | return null; | 42 | return null; |
| 43 | } | 43 | } |
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public List<Dimensional> selectByAnalyse(int analyseId, int dimensionalType) { | ||
| 47 | + Dimensional dimensional = new Dimensional(); | ||
| 48 | + dimensional.setDimensionalType(dimensionalType); | ||
| 49 | + dimensional.setAnalyseId(analyseId); | ||
| 50 | + return dimensionalMapper.selectByAnalyse(dimensional); | ||
| 51 | + } | ||
| 44 | } | 52 | } |
src/main/java/com/jevon/service/impl/StudentDetailServiceImpl.java
| @@ -51,7 +51,7 @@ public class StudentDetailServiceImpl implements StudentDetailService { | @@ -51,7 +51,7 @@ public class StudentDetailServiceImpl implements StudentDetailService { | ||
| 51 | studentDetail.setAnalyseId(analyseId); | 51 | studentDetail.setAnalyseId(analyseId); |
| 52 | studentDetail.setSchoolName(schoolName); | 52 | studentDetail.setSchoolName(schoolName); |
| 53 | studentDetail.setExamNumber(examNumber); | 53 | studentDetail.setExamNumber(examNumber); |
| 54 | - studentDetail.setScore(new Float(score)); | 54 | + studentDetail.setScore(score); |
| 55 | studentDetail.setStudentNumbers(studentNumbers); | 55 | studentDetail.setStudentNumbers(studentNumbers); |
| 56 | return studentDetailMapper.selectTrueByExamNumber(studentDetail); | 56 | return studentDetailMapper.selectTrueByExamNumber(studentDetail); |
| 57 | } | 57 | } |
| @@ -0,0 +1,91 @@ | @@ -0,0 +1,91 @@ | ||
| 1 | +package com.jevon.wordDTO.second; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @author chen | ||
| 5 | + * @version 1.0 | ||
| 6 | + * @date 2019/10/21 0021 11:25 | ||
| 7 | + */ | ||
| 8 | +public class Form6 { | ||
| 9 | + private String knowledge ; | ||
| 10 | + private Double score ; | ||
| 11 | + private Double allRate ; | ||
| 12 | + private Double schoolRate ; | ||
| 13 | + private Double allAvg ; | ||
| 14 | + private Double schoolAvg ; | ||
| 15 | + private Double allDist ; | ||
| 16 | + private Double schoolDist ; | ||
| 17 | + | ||
| 18 | + private String examNumber ; | ||
| 19 | + | ||
| 20 | + public String getKnowledge() { | ||
| 21 | + return knowledge; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + public void setKnowledge(String knowledge) { | ||
| 25 | + this.knowledge = knowledge; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + public Double getScore() { | ||
| 29 | + return score; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public void setScore(Double score) { | ||
| 33 | + this.score = score; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public Double getAllRate() { | ||
| 37 | + return allRate; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + public void setAllRate(Double allRate) { | ||
| 41 | + this.allRate = allRate; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + public Double getSchoolRate() { | ||
| 45 | + return schoolRate; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public void setSchoolRate(Double schoolRate) { | ||
| 49 | + this.schoolRate = schoolRate; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public Double getAllAvg() { | ||
| 53 | + return allAvg; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public void setAllAvg(Double allAvg) { | ||
| 57 | + this.allAvg = allAvg; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public Double getSchoolAvg() { | ||
| 61 | + return schoolAvg; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public void setSchoolAvg(Double schoolAvg) { | ||
| 65 | + this.schoolAvg = schoolAvg; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public Double getAllDist() { | ||
| 69 | + return allDist; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public void setAllDist(Double allDist) { | ||
| 73 | + this.allDist = allDist; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public Double getSchoolDist() { | ||
| 77 | + return schoolDist; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public void setSchoolDist(Double schoolDist) { | ||
| 81 | + this.schoolDist = schoolDist; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public String getExamNumber() { | ||
| 85 | + return examNumber; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public void setExamNumber(String examNumber) { | ||
| 89 | + this.examNumber = examNumber; | ||
| 90 | + } | ||
| 91 | +} |
| @@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
| 1 | +package com.jevon.wordDTO.second; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @author chen | ||
| 5 | + * @version 1.0 | ||
| 6 | + * @date 2019/10/21 0021 14:58 | ||
| 7 | + */ | ||
| 8 | +public class Form7 { | ||
| 9 | + | ||
| 10 | + private String name ; | ||
| 11 | + private Double percent ; | ||
| 12 | + | ||
| 13 | + public String getName() { | ||
| 14 | + return name; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + public void setName(String name) { | ||
| 18 | + this.name = name; | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public Double getPercent() { | ||
| 22 | + return percent; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public void setPercent(Double percent) { | ||
| 26 | + this.percent = percent; | ||
| 27 | + } | ||
| 28 | +} |
| @@ -0,0 +1,46 @@ | @@ -0,0 +1,46 @@ | ||
| 1 | +package com.jevon.wordDTO.second; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @author chen | ||
| 5 | + * @version 1.0 | ||
| 6 | + * @date 2019/10/21 0021 15:14 | ||
| 7 | + */ | ||
| 8 | +public class Form8 { | ||
| 9 | + | ||
| 10 | + private String difficultName ; | ||
| 11 | + private Double score ; | ||
| 12 | + private Double allRate ; | ||
| 13 | + private Double schoolRate ; | ||
| 14 | + | ||
| 15 | + public String getDifficultName() { | ||
| 16 | + return difficultName; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + public void setDifficultName(String difficultName) { | ||
| 20 | + this.difficultName = difficultName; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public Double getScore() { | ||
| 24 | + return score; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void setScore(Double score) { | ||
| 28 | + this.score = score; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public Double getAllRate() { | ||
| 32 | + return allRate; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void setAllRate(Double allRate) { | ||
| 36 | + this.allRate = allRate; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public Double getSchoolRate() { | ||
| 40 | + return schoolRate; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public void setSchoolRate(Double schoolRate) { | ||
| 44 | + this.schoolRate = schoolRate; | ||
| 45 | + } | ||
| 46 | +} |
src/main/java/com/jevon/wordDTO/second/From5.java
| @@ -8,6 +8,7 @@ package com.jevon.wordDTO.second; | @@ -8,6 +8,7 @@ package com.jevon.wordDTO.second; | ||
| 8 | public class From5 { | 8 | public class From5 { |
| 9 | 9 | ||
| 10 | private String examNumber ; | 10 | private String examNumber ; |
| 11 | + private String difficultName ; | ||
| 11 | private Double score ; | 12 | private Double score ; |
| 12 | private Double allRate ; | 13 | private Double allRate ; |
| 13 | private Double schoolRate ; | 14 | private Double schoolRate ; |
| @@ -79,4 +80,12 @@ public class From5 { | @@ -79,4 +80,12 @@ public class From5 { | ||
| 79 | public void setSchoolDist(Double schoolDist) { | 80 | public void setSchoolDist(Double schoolDist) { |
| 80 | this.schoolDist = schoolDist; | 81 | this.schoolDist = schoolDist; |
| 81 | } | 82 | } |
| 83 | + | ||
| 84 | + public String getDifficultName() { | ||
| 85 | + return difficultName; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public void setDifficultName(String difficultName) { | ||
| 89 | + this.difficultName = difficultName; | ||
| 90 | + } | ||
| 82 | } | 91 | } |
src/main/resources/mapping/AnalyseDetailMapper.xml
| @@ -22,4 +22,17 @@ | @@ -22,4 +22,17 @@ | ||
| 22 | <select id="selectByAnalyseId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | 22 | <select id="selectByAnalyseId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> |
| 23 | select * from sz_learn_analyse_detail where analyse_id = #{analyseId} order by id | 23 | select * from sz_learn_analyse_detail where analyse_id = #{analyseId} order by id |
| 24 | </select> | 24 | </select> |
| 25 | + | ||
| 26 | + <select id="selectDifficult" parameterType="com.jevon.model.AnalyseDetail" resultType="java.lang.Double"> | ||
| 27 | + select sum(score) from sz_learn_analyse_detail where analyse_id = #{analyseId} and difficult =#{difficult} | ||
| 28 | + </select> | ||
| 29 | + | ||
| 30 | + <select id="selectDifficultDetail" parameterType="com.jevon.model.AnalyseDetail" resultMap="BaseResultMap"> | ||
| 31 | + select * from sz_learn_analyse_detail where analyse_id = #{analyseId} and difficult =#{difficult} | ||
| 32 | + </select> | ||
| 33 | + | ||
| 34 | + <select id="selectQuestionType" parameterType="java.lang.Integer" resultType="java.lang.String"> | ||
| 35 | + select DISTINCT questionType from sz_learn_analyse_detail where analyse_id = #{analyseId} | ||
| 36 | + </select> | ||
| 37 | + | ||
| 25 | </mapper> | 38 | </mapper> |
| 26 | \ No newline at end of file | 39 | \ No newline at end of file |
src/main/resources/mapping/AnalyseDimensionalMapper.xml
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | <id column="id" property="id" jdbcType="INTEGER" /> | 5 | <id column="id" property="id" jdbcType="INTEGER" /> |
| 6 | <result column="analyse_id" property="analyseId" jdbcType="INTEGER" /> | 6 | <result column="analyse_id" property="analyseId" jdbcType="INTEGER" /> |
| 7 | <result column="question_number" property="questionNumber" jdbcType="VARCHAR" /> | 7 | <result column="question_number" property="questionNumber" jdbcType="VARCHAR" /> |
| 8 | - <result column="dimensional_id" property="questionType" jdbcType="INTEGER" /> | 8 | + <result column="dimensional_id" property="dimensionalId" jdbcType="INTEGER" /> |
| 9 | <result column="score" property="score" jdbcType="FLOAT" /> | 9 | <result column="score" property="score" jdbcType="FLOAT" /> |
| 10 | <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> | 10 | <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| 11 | </resultMap> | 11 | </resultMap> |
| @@ -17,4 +17,9 @@ | @@ -17,4 +17,9 @@ | ||
| 17 | (#{emp.analyseId},#{emp.questionNumber},#{emp.dimensionalId},#{emp.score},#{emp.createTime}) | 17 | (#{emp.analyseId},#{emp.questionNumber},#{emp.dimensionalId},#{emp.score},#{emp.createTime}) |
| 18 | </foreach> | 18 | </foreach> |
| 19 | </insert> | 19 | </insert> |
| 20 | + | ||
| 21 | + <select id="selectByDimensional" parameterType="com.jevon.model.AnalyseDimensional" resultMap="BaseResultMap"> | ||
| 22 | + select * from sz_learn_analyse_dimensional | ||
| 23 | + where analyse_id = #{analyseId} and dimensional_id = #{dimensionalId} | ||
| 24 | + </select> | ||
| 20 | </mapper> | 25 | </mapper> |
| 21 | \ No newline at end of file | 26 | \ No newline at end of file |
src/main/resources/mapping/AnalyseMapper.xml
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | <result column="max_score" property="maxScore" jdbcType="FLOAT" /> | 10 | <result column="max_score" property="maxScore" jdbcType="FLOAT" /> |
| 11 | </resultMap> | 11 | </resultMap> |
| 12 | 12 | ||
| 13 | - <insert id="insert" parameterType="com.jevon.model.Analyse" useGeneratedKeys="true" keyColumn="id" keyProperty="id"> | 13 | + <insert id="insert" parameterType="com.jevon.model.Analyse" useGeneratedKeys="true" keyProperty="id"> |
| 14 | insert into sz_learn_analyse (exam_name, exam_time,course_name,create_time) | 14 | insert into sz_learn_analyse (exam_name, exam_time,course_name,create_time) |
| 15 | values (#{examName},#{examTime},#{courseName},#{createTime}) | 15 | values (#{examName},#{examTime},#{courseName},#{createTime}) |
| 16 | </insert> | 16 | </insert> |
src/main/resources/mapping/DimensionalMapper.xml
| @@ -22,4 +22,9 @@ | @@ -22,4 +22,9 @@ | ||
| 22 | and dimensional_name = #{dimensionalName} | 22 | and dimensional_name = #{dimensionalName} |
| 23 | </if> | 23 | </if> |
| 24 | </select> | 24 | </select> |
| 25 | + | ||
| 26 | + <select id="selectByAnalyse" parameterType="com.jevon.model.Dimensional" resultMap="BaseResultMap"> | ||
| 27 | + select * from sz_learn_dimensional where dimensional_type = #{dimensionalType} and id in( | ||
| 28 | + select dimensional_id from sz_learn_analyse_dimensional where analyse_id = #{analyseId} ) | ||
| 29 | + </select> | ||
| 25 | </mapper> | 30 | </mapper> |
| 26 | \ No newline at end of file | 31 | \ No newline at end of file |