Commit 262a2f41 authored by YangZhaoJun1's avatar YangZhaoJun1

aa

parent f617328e
...@@ -203,16 +203,17 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -203,16 +203,17 @@ public class BChapterController extends PaginationController<BChapter> {
scoreInfoList); scoreInfoList);
} }
@ApiOperation(value="重新打分", notes="重新打分") @ApiOperation(value="打回重做", notes="打回重做")
@ApiImplicitParam(name = "id", value = "businessId", required = true, dataType = "varchar") @ApiImplicitParams({@ApiImplicitParam(name = "chapterId", value = "章节ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "studentCode", value = "学号", required = true, dataType = "varchar")})
@PreAuthorize("hasRole('ROLE_1002')") @PreAuthorize("hasRole('ROLE_1002')")
@PostMapping(value = "/reMark") @PostMapping(value = "/reMark")
public Result reMark(String id) { public Result reMark(String chapterId, String studentCode) {
bChapterService.deleteScoerInfo(id); bChapterService.deleteScoerInfo(chapterId,studentCode);
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
id); studentCode);
} }
@ApiOperation(value="完成学习", notes="完成学习") @ApiOperation(value="完成学习", notes="完成学习")
...@@ -343,4 +344,15 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -343,4 +344,15 @@ public class BChapterController extends PaginationController<BChapter> {
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
studentCode); studentCode);
} }
@ApiOperation(value="成绩评定", notes="成绩评定")
@ApiImplicitParam(name = "slId", value = "开课id", required = false, dataType = "varchar")
@GetMapping(value = "/scoreReport")
public Result scoreReport(String slId) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bChapterService.scoreReport(slId));
}
} }
...@@ -3,6 +3,7 @@ package org.rcisoft.business.bchapter.dao; ...@@ -3,6 +3,7 @@ package org.rcisoft.business.bchapter.dao;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.rcisoft.business.bchapter.dto.QueryScoreListDTO; import org.rcisoft.business.bchapter.dto.QueryScoreListDTO;
import org.rcisoft.business.bchapter.dto.ScoreInfoDTO; import org.rcisoft.business.bchapter.dto.ScoreInfoDTO;
import org.rcisoft.business.bchapter.dto.ScoreReportDto;
import org.rcisoft.business.bchapter.dto.StuScoreDTO; import org.rcisoft.business.bchapter.dto.StuScoreDTO;
import org.rcisoft.business.bchapter.entity.BChapter; import org.rcisoft.business.bchapter.entity.BChapter;
import org.rcisoft.business.bchapter.vo.StudentChapterScoreVO; import org.rcisoft.business.bchapter.vo.StudentChapterScoreVO;
...@@ -148,11 +149,12 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -148,11 +149,12 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
/** /**
* 删除分数记录 * 删除分数记录
* @param id * @param chapterId
* @param studentId
* @return * @return
*/ */
@Update("<script>update b_r_student_chapter set score = -1 where business_id = #{businessId}</script>") @Update("<script>delete from b_r_student_chapter where chapter_id = #{chapterId} and student_id = #{studentId}</script>")
int deleteScoerInfo(String id); int deleteScoerInfo(@Param("chapterId") String chapterId, @Param("studentId") String studentId);
@Select("<script>select * from b_chapter " + @Select("<script>select * from b_chapter " +
"where del_flag = 0 and flag = 1 " + "where del_flag = 0 and flag = 1 " +
...@@ -288,5 +290,13 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -288,5 +290,13 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"values (" + "values (" +
"#{businessId},#{studentId},#{chapterId},'1',#{slId},#{score})</script>") "#{businessId},#{studentId},#{chapterId},'1',#{slId},#{score})</script>")
int insertStudentScore(String businessId, String chapterId, String slId, String studentId, String score); int insertStudentScore(String businessId, String chapterId, String slId, String studentId, String score);
@Select("<script>select * from b_chapter " +
"where del_flag = 0 and flag = 1 and pid = -1 " +
"and sl_id = #{slId} " +
"order by sort asc</script>")
@ResultMap(value = "ScoreReportResultMap" )
List<ScoreReportDto> queryBChaptersBySlId(String slId);
} }
package org.rcisoft.business.bchapter.dto;
import lombok.Data;
import org.rcisoft.business.bchapter.entity.BChapter;
/**
* Created by Administrator on 2018/1/23.
*/
@Data
public class ScoreReportDto extends BChapter{
private static final long serialVersionUID = 4999424838992449124L;
// private String businessId;
// private String chapterName;
// private String automatic;
private String average;
private String maxScore;
private String minScore;
private String waitingMark;
private String submit;
private String allStudent;
}
...@@ -3,6 +3,7 @@ package org.rcisoft.business.bchapter.service; ...@@ -3,6 +3,7 @@ package org.rcisoft.business.bchapter.service;
import org.rcisoft.business.bchapter.dto.QueryScoreListDTO; import org.rcisoft.business.bchapter.dto.QueryScoreListDTO;
import org.rcisoft.business.bchapter.dto.ScoreInfoDTO; import org.rcisoft.business.bchapter.dto.ScoreInfoDTO;
import org.rcisoft.business.bchapter.dto.ScoreReportDto;
import org.rcisoft.business.bchapter.dto.StuScoreDTO; import org.rcisoft.business.bchapter.dto.StuScoreDTO;
import org.rcisoft.business.bchapter.entity.BChapter; import org.rcisoft.business.bchapter.entity.BChapter;
import org.rcisoft.business.bchapter.vo.StudentChapterScoreVO; import org.rcisoft.business.bchapter.vo.StudentChapterScoreVO;
...@@ -80,11 +81,13 @@ public interface BChapterService{ ...@@ -80,11 +81,13 @@ public interface BChapterService{
*/ */
List<StuScoreDTO> queryScoreListBySlIdAndStuId(String slid, String stuid); List<StuScoreDTO> queryScoreListBySlIdAndStuId(String slid, String stuid);
/** /**
* 删除分数记录 * 打回重做
* @param id * @param chapterId
* @param studentCode
*/ */
void deleteScoerInfo(String id); void deleteScoerInfo(String chapterId, String studentCode);
/** /**
* 更新已经完成状态 * 更新已经完成状态
...@@ -110,7 +113,5 @@ public interface BChapterService{ ...@@ -110,7 +113,5 @@ public interface BChapterService{
int Mark(String chapterId, String slId, String studentCode, String score); int Mark(String chapterId, String slId, String studentCode, String score);
List<ScoreReportDto> scoreReport(String slId);
} }
...@@ -4,6 +4,7 @@ import org.apache.commons.io.FileUtils; ...@@ -4,6 +4,7 @@ import org.apache.commons.io.FileUtils;
import org.rcisoft.business.bchapter.dao.BChapterRepository; import org.rcisoft.business.bchapter.dao.BChapterRepository;
import org.rcisoft.business.bchapter.dto.QueryScoreListDTO; import org.rcisoft.business.bchapter.dto.QueryScoreListDTO;
import org.rcisoft.business.bchapter.dto.ScoreInfoDTO; import org.rcisoft.business.bchapter.dto.ScoreInfoDTO;
import org.rcisoft.business.bchapter.dto.ScoreReportDto;
import org.rcisoft.business.bchapter.dto.StuScoreDTO; import org.rcisoft.business.bchapter.dto.StuScoreDTO;
import org.rcisoft.business.bchapter.entity.BChapter; import org.rcisoft.business.bchapter.entity.BChapter;
import org.rcisoft.business.bchapter.enums.AutomaticEnum; import org.rcisoft.business.bchapter.enums.AutomaticEnum;
...@@ -29,6 +30,7 @@ import org.rcisoft.core.model.PersistModel; ...@@ -29,6 +30,7 @@ import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.ResultServiceEnums; import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.IdGen; import org.rcisoft.core.util.IdGen;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.rcisoft.sys.user.dao.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
...@@ -54,7 +56,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -54,7 +56,7 @@ public class BChapterServiceImpl implements BChapterService {
@Autowired @Autowired
private BStudentRepository bStudentRepository; private BStudentRepository bStudentRepository;
@Autowired @Autowired
private BRSlStudentRepository brSlStudentRepository; private SysUserMapper sysUserMapper;
@Autowired @Autowired
private BLessonRepository bLessonRepository; private BLessonRepository bLessonRepository;
@Autowired @Autowired
...@@ -187,8 +189,9 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -187,8 +189,9 @@ public class BChapterServiceImpl implements BChapterService {
@Transactional(propagation = Propagation.REQUIRED,readOnly = false) @Transactional(propagation = Propagation.REQUIRED,readOnly = false)
@Override @Override
public void deleteScoerInfo(String id) { public void deleteScoerInfo(String chapterId, String studentCode) {
int result = bChapterRepository.deleteScoerInfo(id); String studentId = bStudentRepository.queryStudentIdByCode(studentCode);
int result = bChapterRepository.deleteScoerInfo(chapterId,studentId);
if(result<1) if(result<1)
throw new ServiceException(ResultServiceEnums.SCORE_INFO_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.SCORE_INFO_NOT_EXISTS);
} }
...@@ -497,7 +500,10 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -497,7 +500,10 @@ public class BChapterServiceImpl implements BChapterService {
return line; return line;
} }
@Override
public List<ScoreReportDto> scoreReport(String slId) {
return bChapterRepository.queryBChaptersBySlId(slId);
}
} }
...@@ -239,6 +239,9 @@ public class BFileServiceImpl implements BFileService { ...@@ -239,6 +239,9 @@ public class BFileServiceImpl implements BFileService {
// 截取上传文件的后缀 // 截取上传文件的后缀
String uploadFileSuffix = uploadFile.substring(uploadFile.lastIndexOf('.') + 1, uploadFile.length()); String uploadFileSuffix = uploadFile.substring(uploadFile.lastIndexOf('.') + 1, uploadFile.length());
if(uploadFileSuffix.equals("pptx")){
uploadFileSuffix = "ppt";
}
// 设置文件名为乱码 // 设置文件名为乱码
String uploadFileName = IdGen.uuid(); String uploadFileName = IdGen.uuid();
...@@ -252,13 +255,13 @@ public class BFileServiceImpl implements BFileService { ...@@ -252,13 +255,13 @@ public class BFileServiceImpl implements BFileService {
+ path + bFile.getChapterId() + File.separator + path + bFile.getChapterId() + File.separator
+ pathName + File.separator; + pathName + File.separator;
if(uploadFileSuffix.equals("ppt")||uploadFileSuffix.equals("pptx")){//ppt转pdf if(uploadFileSuffix.equals("ppt")){//ppt转pdf
String inputFile = global.getBASE_UPLOAD_SERVER_LOCATION() + File.separator String inputFile = global.getBASE_UPLOAD_SERVER_LOCATION() + File.separator
+ newPath+ filename; + newPath+ filename;
String outputFile = global.getBASE_UPLOAD_SERVER_LOCATION() + File.separator String outputFile = global.getBASE_UPLOAD_SERVER_LOCATION() + File.separator
+ newPath + uploadFileName + ".pdf"; + newPath + uploadFileName + ".pdf";
PptToPdf pptToPdf = new PptToPdf(); PptToPdf pptToPdf = new PptToPdf();
//pptToPdf.pptToPdf(inputFile,outputFile); pptToPdf.pptToPdf(inputFile,outputFile);
} }
bFile.setVideoName(name+ "." +uploadFileSuffix);//文件名 bFile.setVideoName(name+ "." +uploadFileSuffix);//文件名
......
...@@ -157,5 +157,9 @@ public interface BStudentRepository extends BaseMapper<BStudent> { ...@@ -157,5 +157,9 @@ public interface BStudentRepository extends BaseMapper<BStudent> {
"where FIND_IN_SET(su.business_id,#{studentId}) " + "where FIND_IN_SET(su.business_id,#{studentId}) " +
"and su.del_flag != 1 and su.glag = 1</script>") "and su.del_flag != 1 and su.glag = 1</script>")
List<BStudentDto> queryStudentByBusinessId(String studentId); List<BStudentDto> queryStudentByBusinessId(String studentId);
@Select("<script>select business_id from b_student where code = #{studentCode} and del_flag != 1 and flag = 1</script>")
String queryStudentIdByCode(String studentCode);
} }
...@@ -42,12 +42,17 @@ public class TQuestionController extends PaginationController<TQuestion> { ...@@ -42,12 +42,17 @@ public class TQuestionController extends PaginationController<TQuestion> {
private TQuestionService tQuestionServiceImpl; private TQuestionService tQuestionServiceImpl;
@ApiOperation(value="添加", notes="添加") @ApiOperation(value="新增试题", notes="新增试题")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "sl_id", value = "课程ID", required = false, dataType = "varchar"),
@PostMapping @ApiImplicitParam(name = "chap_id", value = "章ID", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "qtype", value = "1 选择题 2 多选题 3 判断题", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "qtitle", value = "题干", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "qdesc", value = "解析", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "qanswer", value = "单选从0开始;判断:0错误 1正确;多选 0,1,2", required = true, dataType = "varchar")})
@PostMapping("/add")
@PreAuthorize("hasRole('ROLE_1002')") @PreAuthorize("hasRole('ROLE_1002')")
public Result add(TQuestion tQuestion, List<Map<String,Object>> questionOptions) { public Result add(TQuestion tQuestion) {
PersistModel data = tQuestionServiceImpl.save(tQuestion,questionOptions); PersistModel data = tQuestionServiceImpl.save(tQuestion);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
...@@ -143,7 +148,7 @@ public class TQuestionController extends PaginationController<TQuestion> { ...@@ -143,7 +148,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@GetMapping(value = "/queryTQestions") @GetMapping(value = "/queryTQestions")
@PreAuthorize("hasRole('ROLE_1002')") @PreAuthorize("hasRole('ROLE_1002')")
public Result queryTQestion(TQuestion tQuestion) { public Result queryTQestion(TQuestion tQuestion) {
tQuestion.setCreateBy(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID)); //tQuestion.setCreateBy(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID));
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
......
...@@ -9,6 +9,7 @@ import java.math.BigInteger; ...@@ -9,6 +9,7 @@ import java.math.BigInteger;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created with yangzhaojun on 2018-1-15 19:49:07. * Created with yangzhaojun on 2018-1-15 19:49:07.
...@@ -21,7 +22,7 @@ import java.util.List; ...@@ -21,7 +22,7 @@ import java.util.List;
public class TQuestion extends IdEntity<TQuestion> { public class TQuestion extends IdEntity<TQuestion> {
private static final long serialVersionUID = 4926963786636914161L;
private String slId; private String slId;
private String chapId; private String chapId;
...@@ -34,13 +35,14 @@ public class TQuestion extends IdEntity<TQuestion> { ...@@ -34,13 +35,14 @@ public class TQuestion extends IdEntity<TQuestion> {
private String qanswer; private String qanswer;
@Transient /*private String qid;
private String qid;
@Transient
private String alias; private String alias;
private String desc; private String desc;*/
@Transient
List<Map<String,Object>> questionOptions;
} }
......
...@@ -18,7 +18,7 @@ public interface TQuestionService { ...@@ -18,7 +18,7 @@ public interface TQuestionService {
* @param tQuestion * @param tQuestion
* @return * @return
*/ */
PersistModel save(TQuestion tQuestion, List<Map<String,Object>> questionOptions); PersistModel save(TQuestion tQuestion);
/** /**
* 逻辑删除 * 逻辑删除
......
...@@ -45,18 +45,18 @@ public class TQuestionServiceImpl implements TQuestionService { ...@@ -45,18 +45,18 @@ public class TQuestionServiceImpl implements TQuestionService {
*/ */
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public PersistModel save(TQuestion tQuestion, List<Map<String,Object>> questionOptions){ public PersistModel save(TQuestion tQuestion){
List<TQuestionOptions> optionList = new ArrayList(); List<TQuestionOptions> optionList = new ArrayList();
//增加主表题干信息 //增加主表题干信息
UserUtil.setCurrentPersistOperation(tQuestion); UserUtil.setCurrentPersistOperation(tQuestion);
int line = tQuestionRepository.insertSelective(tQuestion); int line = tQuestionRepository.insertSelective(tQuestion);
//增加选项信息 //增加选项信息
for(Map<String,Object> map : questionOptions){ for(Map<String,Object> map : tQuestion.getQuestionOptions()){
TQuestionOptions tQuestionOptions = new TQuestionOptions(); TQuestionOptions tQuestionOptions = new TQuestionOptions();
tQuestionOptions.setCommonBusinessId(); tQuestionOptions.setCommonBusinessId();
tQuestionOptions.setQid(tQuestion.getQid()); tQuestionOptions.setQid(tQuestion.getBusinessId());
tQuestionOptions.setAlias(String.valueOf(map.get("alias"))); tQuestionOptions.setAlias(String.valueOf(map.keySet()));
tQuestionOptions.setDescribe(String.valueOf(map.get("describe"))); tQuestionOptions.setDescribe(String.valueOf(map.get(map.keySet())));
optionList.add(tQuestionOptions); optionList.add(tQuestionOptions);
} }
......
...@@ -21,7 +21,7 @@ import java.net.ConnectException; ...@@ -21,7 +21,7 @@ import java.net.ConnectException;
public class PptToPdf { public class PptToPdf {
/*@Autowired /*@Autowired
private Global global; private Global global;*/
private static OfficeManager officeManager; private static OfficeManager officeManager;
private static int port[] = { 8100 }; private static int port[] = { 8100 };
...@@ -43,7 +43,7 @@ public class PptToPdf { ...@@ -43,7 +43,7 @@ public class PptToPdf {
DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration(); DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
try { try {
System.out.println("准备启动服务...."); System.out.println("准备启动服务....");
configuration.setOfficeHome(global.getOPEN_OFFICE_HOME());// 设置OpenOffice.org安装目录 configuration.setOfficeHome("/opt/openoffice4/");// 设置OpenOffice.org安装目录
configuration.setPortNumbers(port); // 设置转换端口,默认为8100 configuration.setPortNumbers(port); // 设置转换端口,默认为8100
configuration.setTaskExecutionTimeout(1000 * 60 * 5L);// 设置任务执行超时为5分钟 configuration.setTaskExecutionTimeout(1000 * 60 * 5L);// 设置任务执行超时为5分钟
configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);// 设置任务队列超时为24小时 configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);// 设置任务队列超时为24小时
...@@ -63,16 +63,16 @@ public class PptToPdf { ...@@ -63,16 +63,16 @@ public class PptToPdf {
officeManager.stop(); officeManager.stop();
} }
System.out.println("关闭office转换成功!"); System.out.println("关闭office转换成功!");
}*/ }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String path = "C:/Users/Administrator/Desktop/"; String path = "/working/";
PptToPdf opc = new PptToPdf(); PptToPdf opc = new PptToPdf();
opc.office2PDF(path+"abc.pptx", path+"1.pdf"); opc.pptToPdf(path+"111.pptx", path+"1.pdf");
} }
public static int office2PDF(String sourceFile, String destFile) throws FileNotFoundException { /*public static int office2PDF(String sourceFile, String destFile) throws FileNotFoundException {
try { try {
File inputFile = new File(sourceFile); File inputFile = new File(sourceFile);
if (!inputFile.exists()) { if (!inputFile.exists()) {
...@@ -87,7 +87,7 @@ public class PptToPdf { ...@@ -87,7 +87,7 @@ public class PptToPdf {
// connect to an OpenOffice.org instance running on port 8100 // connect to an OpenOffice.org instance running on port 8100
OpenOfficeConnection connection = new SocketOpenOfficeConnection( OpenOfficeConnection connection = new SocketOpenOfficeConnection(
"192.168.1.130", 10202); "192.168.1.130", 2002);
connection.connect(); connection.connect();
// convert // convert
...@@ -106,7 +106,7 @@ public class PptToPdf { ...@@ -106,7 +106,7 @@ public class PptToPdf {
} }
return 1; return 1;
} }*/
} }
...@@ -59,7 +59,7 @@ public class UploadUtil { ...@@ -59,7 +59,7 @@ public class UploadUtil {
Runtime.getRuntime().exec("chmod -R 755 " + basePath); Runtime.getRuntime().exec("chmod -R 755 " + basePath);
} }
map.put(IS_SUCCESSS, true); map.put(IS_SUCCESSS, true);
map.put(URL, userPath.substring(1, userPath.length()) + filename);//url中是图片的路径,应该是服务器上图片 map.put(URL, userPath.substring(0, userPath.length()) + filename);//url中是图片的路径,应该是服务器上图片
//的路径,我在controller中调用这个方法时间,直接看返回值,如果isSuccess是true,则取出url,然后将其存入数据库,如果 //的路径,我在controller中调用这个方法时间,直接看返回值,如果isSuccess是true,则取出url,然后将其存入数据库,如果
// 取出的isSuccess的值是false,就直接报错,跳到exception。 // 取出的isSuccess的值是false,就直接报错,跳到exception。
return map; return map;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<result column="experiment_type" jdbcType="VARCHAR" property="experimentType"/> <result column="experiment_type" jdbcType="VARCHAR" property="experimentType"/>
</resultMap> </resultMap>
<!--教师和管理员使用这个-->
<resultMap id="SupperChildListResultMap" type="org.rcisoft.business.bchapter.entity.BChapter" extends="BaseResultMap"> <resultMap id="SupperChildListResultMap" type="org.rcisoft.business.bchapter.entity.BChapter" extends="BaseResultMap">
<association column="business_id" property="childList" select="org.rcisoft.business.bchapter.dao.BChapterRepository.queryBChaptersByPid"></association> <association column="business_id" property="childList" select="org.rcisoft.business.bchapter.dao.BChapterRepository.queryBChaptersByPid"></association>
</resultMap> </resultMap>
...@@ -34,10 +35,9 @@ ...@@ -34,10 +35,9 @@
<result column="chapter_name" property="chapterName"></result> <result column="chapter_name" property="chapterName"></result>
</resultMap> </resultMap>
<!--学生单独使用这个-->
<resultMap id="SupperStudentChildListResultMap" type="org.rcisoft.business.bchapter.entity.BChapter" extends="BaseResultMap"> <resultMap id="SupperStudentChildListResultMap" type="org.rcisoft.business.bchapter.entity.BChapter" extends="BaseResultMap">
<association column="{studentId=stuId,paId=business_id}" property="childList" select="queryBChaptersByPidAndUserId"> <association column="{studentId=stuId,paId=business_id}" property="childList" select="queryBChaptersByPidAndUserId">
</association> </association>
</resultMap> </resultMap>
...@@ -63,4 +63,32 @@ ...@@ -63,4 +63,32 @@
ORDER BY ORDER BY
bc.sort asc bc.sort asc
</select> </select>
<!--成绩评定时使用这个-->
<resultMap id="ScoreReportResultMap" type="org.rcisoft.business.bchapter.dto.ScoreReportDto" extends="BaseResultMap">
<association column="{pid=business_id,slId=sl_id}" property="childList" select="scoreReportChildList"></association>
</resultMap>
<select id="scoreReportChildList" parameterType="java.util.Map" resultMap="ScoreReportResultMap">
SELECT DISTINCT bc.business_id,
bc.chapter_name, bc.automatic,bc.sl_id,
ROUND((SELECT AVG(bsc.score) from b_r_student_chapter bsc
where bsc.chapter_id = bc.business_id and score != '-1'),2) as average,
(SELECT MAX(bsc.score) from b_r_student_chapter bsc
where bsc.chapter_id = bc.business_id and score != '-1') as maxScore,
(SELECT MIN(bsc.score) from b_r_student_chapter bsc
where bsc.chapter_id = bc.business_id and score != '-1') as minScore,
(SELECT COUNT(*) from b_r_student_chapter where score = '-1'
AND sl_id = #{slId} AND chapter_id = bc.business_id) as waitingMark,
(SELECT COUNT(*) from b_r_student_chapter where sl_id = #{slId}
AND chapter_id = bc.business_id) as submit,
(SELECT COUNT(*) from b_r_sl_student brss where brss.sl_code =
(SELECT `code` from b_sl where business_id = #{slId})) as allStudent
from b_chapter bc
where bc.pid = #{pid}
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment