新增,修改部分功能,新加字体文件,查询IP归属地文件

newBigdata
xiaoCJ 11 months ago
parent d73de94d99
commit c1de307680

@ -204,6 +204,12 @@
<version>9.1.22</version>
</dependency>
<dependency>
<groupId>org.lionsoul</groupId>
<artifactId>ip2region</artifactId>
<version>2.6.5</version>
</dependency>
</dependencies>
<build>

@ -97,8 +97,8 @@ public class ExerciseExperimentalTraining {
@AnonymousAccess
@ApiOperation("实训演练页面查询")
@PostMapping("getCourseChapter")
public ResultEntity<List<SysCourseDto>> getIndexTheoryTest(@RequestParam String schoolId, @RequestParam String userId) {
List<SysCourse> sysCourseList = sysCourseMapper.getBySchoolId(schoolId);
public ResultEntity<List<SysCourseDto>> getIndexTheoryTest(@RequestParam String userId) {
List<SysCourse> sysCourseList = sysCourseMapper.getBySchoolId();
List<SysCourseDto> dtoList = new ArrayList<>();
for (SysCourse sysCourse : sysCourseList) {
SysCourseDto newDto = new SysCourseDto();

@ -2,9 +2,13 @@ package com.sztzjy.financial_bigdata.controller.stu;
import cn.hutool.core.util.IdUtil;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.entity.StuTraining;
import com.sztzjy.financial_bigdata.entity.StuTrainingExample;
import com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs;
import com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary;
import com.sztzjy.financial_bigdata.entity.stu_dto.ReceivingObject;
import com.sztzjy.financial_bigdata.mapper.StuTrainingMapper;
import com.sztzjy.financial_bigdata.mapper.SysKnowledgeSummaryMapper;
import com.sztzjy.financial_bigdata.util.PdfUtil;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import com.sztzjy.financial_bigdata.util.file.IFileUtil;
@ -13,19 +17,26 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
/**
* @Author xcj
* @Date 2024/4/24
*/
@RestController
@Api(tags = "学生端--知识笔记")
@Api(tags = "学生端-知识笔记-知识概要")
@RequestMapping("api/stu/knowledgeNote")
public class StuKnowledgeNote {
@Autowired
@ -34,10 +45,11 @@ public class StuKnowledgeNote {
private IFileUtil fileUtil;
@Value("${file.path}")
private String filePath;
@Autowired
private SysKnowledgeSummaryMapper sysKnowledgeSummaryMapper;
@AnonymousAccess
@ApiOperation("保存")
@ApiOperation("知识笔记-保存")
@PostMapping("save")
public ResultEntity<String> save(@RequestBody ReceivingObject receivingObject) {
StuTrainingWithBLOBs stuTrainingWithBLOBs = stuTrainingMapper.selectByPrimaryKey(receivingObject.getTrainingId());
@ -52,14 +64,14 @@ public class StuKnowledgeNote {
}
@AnonymousAccess
@ApiOperation("导出")
@PostMapping("export")
@ApiOperation("知识笔记-导出")
@GetMapping("export")
public void export(HttpServletResponse response, String context) {
try {
String s = IdUtil.simpleUUID();
FileOutputStream fileOutputStream = new FileOutputStream(filePath + "/pdf/" + s + ".pdf");
PdfUtil.htmlStringToPdf(context, fileOutputStream);
fileUtil.download(response, s + ".pdf", "/pdf/" + s + ".pdf");
PdfUtil.htmlStringToPdf(context, fileOutputStream);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
@ -67,7 +79,7 @@ public class StuKnowledgeNote {
@AnonymousAccess
@ApiOperation("回显")
@ApiOperation("知识笔记-回显")
@PostMapping("getKnowledgeNote")
public ResultEntity<String> getKnowledgeNote(@RequestParam String trainingId) {
StuTrainingWithBLOBs stuTrainingWithBLOBs = stuTrainingMapper.selectByPrimaryKey(trainingId);
@ -75,4 +87,45 @@ public class StuKnowledgeNote {
}
@GetMapping("/getReport")
@ApiOperation("获取单个学生报告接口")
@AnonymousAccess
public ResponseEntity<FileSystemResource> getReport(@RequestParam String chapterId, HttpServletResponse response) {
SysKnowledgeSummary sysKnowledgeSummary = sysKnowledgeSummaryMapper.selectByPrimaryKey(chapterId);
String fileUrl = sysKnowledgeSummary.getFileUrl();
String videoPath = filePath + fileUrl;
File videoFile = new File(videoPath);
if (videoFile.exists()) {
FileSystemResource fileSystemResource = new FileSystemResource(videoFile);
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType("application/pdf"))
.body(fileSystemResource);
} else {
return ResponseEntity.notFound().build();
}
}
@GetMapping("/returnTrainingId")
@ApiOperation("返回实训ID接口/进入知识概要页面调用")
@AnonymousAccess
public ResultEntity<String> returnTrainingId(@RequestParam String chapterId,
@RequestParam String userId) {
StuTrainingExample stuTrainingExample = new StuTrainingExample();
stuTrainingExample.createCriteria().andChapterIdEqualTo(chapterId).andUserIdEqualTo(userId);
List<StuTrainingWithBLOBs> list = stuTrainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
if (list.isEmpty()) { //该用户第一次进入这个章节的知识概要 新增
StuTrainingWithBLOBs stuTraining = new StuTrainingWithBLOBs();
String uuid = IdUtil.randomUUID();
stuTraining.setTrainingId(uuid);
stuTraining.setChapterId(chapterId);
stuTraining.setUserId(userId);
stuTrainingMapper.insert(stuTraining);
return new ResultEntity<>(uuid);
} else {
return new ResultEntity<>(list.get(0).getTrainingId());
}
}
}

@ -149,7 +149,7 @@ public class StuScoreController {
@AnonymousAccess
@ApiOperation("实验报告下载")
@PostMapping("downloadReport")
@GetMapping("downloadReport")
public void downloadReport(@RequestParam String reportId, HttpServletResponse response) {
TrainingReport trainingReport = trainingReportMapper.selectByPrimaryKey(reportId);
Assert.isTrue(trainingReport != null && trainingReport.getFilePath() != null, "报告不存在");

@ -39,6 +39,8 @@ public class TeaExamManageController {
@Autowired
private TeaExamManageMapper teaExamManageMapper;
@Autowired
private StuStudentExamMapper studentExamMapper;
@Autowired
private StuTrainingMapper stuTrainingMapper;
@Autowired
private TeaAndStudentExamMapper teaAndStudentExamMapper;
@ -47,6 +49,7 @@ public class TeaExamManageController {
@Autowired
private IFileUtil fileUtil;
@AnonymousAccess
@PostMapping("/getSelectCountAndScore")
@ApiOperation("新增考试--获取选题量和分数")
@ -63,7 +66,6 @@ public class TeaExamManageController {
return new ResultEntity<>(map);
}
@AnonymousAccess
@PostMapping("/getAllCount")
@ApiOperation("新增考试--获取题目总数量")
@ -104,10 +106,10 @@ public class TeaExamManageController {
@AnonymousAccess
@PostMapping("/selectExamList")
@ApiOperation("考试管理--查询考试列表")
public ResultEntity<PageInfo> selectExamList(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) @ApiParam("考试名称") String examName,
@RequestParam String schoolId) {
public ResultEntity<PageInfo<TeaExamManageWithBLOBs>> selectExamList(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) @ApiParam("考试名称") String examName,
@RequestParam String schoolId) {
PageHelper.startPage(index, size);
TeaExamManageExample teaExamManageExample = new TeaExamManageExample();
TeaExamManageExample.Criteria criteria = teaExamManageExample.createCriteria();
@ -152,7 +154,7 @@ public class TeaExamManageController {
teaExamManageWithBLOB.setExamDescription("进行中");
}
}
return new ResultEntity<>(new PageInfo(teaExamManageWithBLOBs));
return new ResultEntity<>(new PageInfo<>(teaExamManageWithBLOBs));
}
@ -163,10 +165,10 @@ public class TeaExamManageController {
if (StringUtils.isBlank(examManage.getExamManageId())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "缺少必须的主键ID");
}
TeaExamManageWithBLOBs newData =new TeaExamManageWithBLOBs();
BeanUtils.copyProperties(examManage,newData);
TeaExamManageWithBLOBs newData = new TeaExamManageWithBLOBs();
BeanUtils.copyProperties(examManage, newData);
TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManage.getExamManageId());
if (examManage.getFile()!=null){
if (examManage.getFile() != null) {
String path = fileUtil.upload(examManage.getFile()); //设置新的图片路径
teaExamManageWithBLOBs.setLogoAddress(path);
}
@ -195,11 +197,45 @@ public class TeaExamManageController {
return new ResultEntity<HttpStatus>(HttpStatus.OK, "删除成功!");
}
@AnonymousAccess
@PostMapping("/getUsersByExamID")
@ApiOperation("考试管理--展示指定人重考列表")
public ResultEntity<PageInfo> getUsersByExamID(@RequestParam Integer index,
@RequestParam Integer size,
@ApiParam("考试管理") @RequestParam String examId,
@ApiParam("学号/姓名") @RequestParam(required = false) String keyWord,
@ApiParam("状态true/false") @RequestParam(required = false) String status) {
PageHelper.startPage(index, size);
List<StuUser> stuUsers = studentExamMapper.getUsersByExamID(examId, keyWord, status);
if (!stuUsers.isEmpty()) {
for (StuUser stuUser : stuUsers) {
if (stuUser.getPhone().equals("true") && stuUser.getEmail().equals("true")) {
stuUser.setMajor("已提交");
} else {
stuUser.setMajor("未提交");
}
}
}
PageInfo pageInfo = new PageInfo(stuUsers);
return new ResultEntity<>(pageInfo);
}
@AnonymousAccess
@PostMapping("/reloadExamById")
@ApiOperation("考试管理--指定人重考") //Todo 待写
public ResultEntity reloadExamById(@RequestParam String examId) {
return null;
@ApiOperation("考试管理--指定人重考")
public ResultEntity<String> reloadExamById(@ApiParam("考试管理ID") @RequestParam String examId, @RequestParam String userId) {
StuStudentExamExample studentExamExample = new StuStudentExamExample();
studentExamExample.createCriteria().andUseridEqualTo(userId).andExamManageIdEqualTo(examId);
List<StuStudentExamWithBLOBs> stuStudentExamWithBLOBs = studentExamMapper.selectByExampleWithBLOBs(studentExamExample);
if (stuStudentExamWithBLOBs.isEmpty()) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "学生暂未考试,无需重考");
} else {
StuStudentExamWithBLOBs stuStudentExamWithBLOBs1 = stuStudentExamWithBLOBs.get(0);
studentExamMapper.deleteByPrimaryKey(stuStudentExamWithBLOBs1.getStudentExamId());
return new ResultEntity(HttpStatus.OK, "指定重考成功!");
}
}
}

@ -144,18 +144,24 @@ public class TeaGradeManageController {
@AnonymousAccess
@PostMapping("/getClassByExamManageId")
@ApiOperation("考试模式--图表统计接口班级下拉框返回classID和班级名") //只显示新建实训时添加的班级
public ResultEntity<Map<String, String>> getClassByExamManageId(@RequestParam String examManageId) {
public ResultEntity<List<Map<String, String>>> getClassByExamManageId(@RequestParam String examManageId) {
TeaAndStudentExamExample teaAndStudentExamExample = new TeaAndStudentExamExample();
teaAndStudentExamExample.createCriteria().andExamManageIdEqualTo(examManageId);
List<TeaAndStudentExam> teaAndStudentExams = teaAndStudentExamMapper.selectByExample(teaAndStudentExamExample);
List<Map<String, String>> list = new ArrayList();
Map<String, String> map = new HashMap<>();
for (TeaAndStudentExam teaAndStudentExam : teaAndStudentExams) {
if (!teaAndStudentExams.isEmpty()) {
TeaAndStudentExam teaAndStudentExam = teaAndStudentExams.get(0);
String classId = teaAndStudentExam.getClassId();
StuClass stuClass = stuClassMapper.selectByPrimaryKey(classId);
String className = stuClass.getClassName();
map.put(classId, className);
String[] split = classId.split(",");
for (String singleId : split) {
StuClass stuClass = stuClassMapper.selectByPrimaryKey(singleId);
String className = stuClass.getClassName();
map.put(singleId, className);
}
list.add(map);
}
return new ResultEntity<Map<String, String>>(map);
return new ResultEntity<>(list);
}
@AnonymousAccess
@ -247,7 +253,7 @@ public class TeaGradeManageController {
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId,
@RequestParam String userId) {
return new ResultEntity<PageInfo<TeaTrainingInfoDTO>>(iTeaGradeManageService.getTrainingInfo(index, size, schoolId, keyWord, classId,userId));
return new ResultEntity<PageInfo<TeaTrainingInfoDTO>>(iTeaGradeManageService.getTrainingInfo(index, size, schoolId, keyWord, classId, userId));
}
@AnonymousAccess
@ -258,7 +264,7 @@ public class TeaGradeManageController {
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId,
@RequestParam String userId) {
iTeaGradeManageService.exportTrainingInfo(response, schoolId, keyWord, classId,userId);
iTeaGradeManageService.exportTrainingInfo(response, schoolId, keyWord, classId, userId);
}
@AnonymousAccess

@ -12,6 +12,7 @@ import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuUserDto;
import com.sztzjy.financial_bigdata.mapper.StuClassMapper;
import com.sztzjy.financial_bigdata.mapper.StuUserMapper;
import com.sztzjy.financial_bigdata.mapper.SysLoginLogMapper;
import com.sztzjy.financial_bigdata.service.tea.ITeaUserService;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import com.sztzjy.financial_bigdata.util.RsaUtil;
@ -28,7 +29,6 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -49,6 +49,8 @@ public class UserController {
private StuUserMapper stuUserMapper;
@Autowired
private ITeaUserService userService;
@Autowired
private SysLoginLogMapper sysLoginLogMapper;
// 用户登录时记录的信息
private static LocalDateTime loginTime;
private static String loginIp;
@ -61,7 +63,9 @@ public class UserController {
@AnonymousAccess
public ResultEntity login(@RequestParam String passwordEncode,
@RequestParam String userName,
HttpServletRequest request,
@RequestParam(required = false) String TOKEN) throws Exception {
JwtUser jwtUser;
String passWord = RsaUtil.decryptByPrivateKey(passwordEncode);
if (StringUtils.isBlank(TOKEN)) {
@ -74,7 +78,6 @@ public class UserController {
throw new UnAuthorizedException("用户名或密码错误");
} else {
//保存用户的登录信息
Map<String, Object> map = new HashMap<>();
StuUser user = stuUsers.get(0);
map.put("name", user.getName());
@ -84,6 +87,8 @@ public class UserController {
map.put("schoolId", user.getSchoolId());
map.put("classId", user.getClassId());
map.put("userId", user.getUserid());
String uuid = getIPAndPlace(request, user.getName(), user.getUserid(), user.getStudentId());
map.put("logId", uuid);
return new ResultEntity(HttpStatus.OK, map);
}
} else { // 2、智云单点登录
@ -104,22 +109,54 @@ public class UserController {
SecurityContextHolder.getContext().setAuthentication(authentication);
String token = TokenProvider.createToken(jwtUser);
LoginResult loginResult = LoginResult.create(jwtUser, token);
//todo 从智云登录后将用户添加到本地用户表
return new ResultEntity(HttpStatus.OK, loginResult);
Map<String, Object> map = new HashMap<>();
map.put("name", loginResult.getName());
map.put("username", loginResult.getUsername());
map.put("roleId", loginResult.getRoleId());
map.put("schoolId", loginResult.getSchoolId());
map.put("classId", loginResult.getClassId());
map.put("userId", loginResult.getUserId());
String uuid = getIPAndPlace(request, loginResult.getName(), loginResult.getUserId(), jwtUser.getUsername()); //todo 学号暂时没有
map.put("logId", uuid);
return new ResultEntity(HttpStatus.OK, map); //todo 从智云登录后将用户添加到本地用户表
}
}
@AnonymousAccess
@ApiOperation("测试IP归属地")
@PostMapping("test")
public ResultEntity test(@ApiParam @RequestBody(required = false) SysLoginLog loginDTO, HttpServletRequest request) throws Exception {
private String getIPAndPlace(HttpServletRequest request,String name,String userId,String studentId){
String ip = request.getRemoteAddr();
String ipHomePlace = userService.getIpAddress(ip);
SysLoginLog sysLoginLog =new SysLoginLog();
String uuid = IdUtil.randomUUID();
sysLoginLog.setLogId(uuid);
sysLoginLog.setLoginIp(ip);
sysLoginLog.setUserid(userId);
sysLoginLog.setName(name);
sysLoginLog.setStudentId(studentId);
sysLoginLog.setLoginTime(new Date());
sysLoginLog.setIpAddress(ipHomePlace);
sysLoginLogMapper.insert(sysLoginLog);
return uuid;
}
return null;
@PostMapping("/setLoginDuration")
@ApiOperation("登录日志--设置登录时长退出时调用")
public void setLoginDuration(@ApiParam("登录返回的日志ID") @RequestParam String logID) {
SysLoginLog sysLoginLog = sysLoginLogMapper.selectByPrimaryKey(logID);
Date loginTime = sysLoginLog.getLoginTime();
Date date = new Date();
long diffInMillis = date.getTime() - loginTime.getTime()/1000; //得到秒为单位的时间
Date date1 =new Date(diffInMillis);
sysLoginLog.setLoginDuration(date1);
sysLoginLogMapper.updateByPrimaryKey(sysLoginLog);
}
@ApiOperation("根据用户Code查询该用户是否存在个人赛用户数据存在则返回不存在则新增后返回用于智云3.0创建用户后调用该接口创建用户个人赛")
@PostMapping("/checkOrCreateForexSimulationUser")
@AnonymousAccess

@ -0,0 +1,42 @@
package com.sztzjy.financial_bigdata.entity;
import io.swagger.annotations.ApiModelProperty;
/**
*
*
* @author xcj
* sys_knowledge_summary
*/
public class SysKnowledgeSummary {
private String chapterId;
@ApiModelProperty("文件路径")
private String fileUrl;
@ApiModelProperty("文件名称")
private String fileName;
public String getChapterId() {
return chapterId;
}
public void setChapterId(String chapterId) {
this.chapterId = chapterId == null ? null : chapterId.trim();
}
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl == null ? null : fileUrl.trim();
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName == null ? null : fileName.trim();
}
}

@ -0,0 +1,409 @@
package com.sztzjy.financial_bigdata.entity;
import java.util.ArrayList;
import java.util.List;
public class SysKnowledgeSummaryExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysKnowledgeSummaryExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andChapterIdIsNull() {
addCriterion("chapter_id is null");
return (Criteria) this;
}
public Criteria andChapterIdIsNotNull() {
addCriterion("chapter_id is not null");
return (Criteria) this;
}
public Criteria andChapterIdEqualTo(String value) {
addCriterion("chapter_id =", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdNotEqualTo(String value) {
addCriterion("chapter_id <>", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdGreaterThan(String value) {
addCriterion("chapter_id >", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdGreaterThanOrEqualTo(String value) {
addCriterion("chapter_id >=", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdLessThan(String value) {
addCriterion("chapter_id <", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdLessThanOrEqualTo(String value) {
addCriterion("chapter_id <=", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdLike(String value) {
addCriterion("chapter_id like", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdNotLike(String value) {
addCriterion("chapter_id not like", value, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdIn(List<String> values) {
addCriterion("chapter_id in", values, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdNotIn(List<String> values) {
addCriterion("chapter_id not in", values, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdBetween(String value1, String value2) {
addCriterion("chapter_id between", value1, value2, "chapterId");
return (Criteria) this;
}
public Criteria andChapterIdNotBetween(String value1, String value2) {
addCriterion("chapter_id not between", value1, value2, "chapterId");
return (Criteria) this;
}
public Criteria andFileUrlIsNull() {
addCriterion("file_url is null");
return (Criteria) this;
}
public Criteria andFileUrlIsNotNull() {
addCriterion("file_url is not null");
return (Criteria) this;
}
public Criteria andFileUrlEqualTo(String value) {
addCriterion("file_url =", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlNotEqualTo(String value) {
addCriterion("file_url <>", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlGreaterThan(String value) {
addCriterion("file_url >", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlGreaterThanOrEqualTo(String value) {
addCriterion("file_url >=", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlLessThan(String value) {
addCriterion("file_url <", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlLessThanOrEqualTo(String value) {
addCriterion("file_url <=", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlLike(String value) {
addCriterion("file_url like", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlNotLike(String value) {
addCriterion("file_url not like", value, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlIn(List<String> values) {
addCriterion("file_url in", values, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlNotIn(List<String> values) {
addCriterion("file_url not in", values, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlBetween(String value1, String value2) {
addCriterion("file_url between", value1, value2, "fileUrl");
return (Criteria) this;
}
public Criteria andFileUrlNotBetween(String value1, String value2) {
addCriterion("file_url not between", value1, value2, "fileUrl");
return (Criteria) this;
}
public Criteria andFileNameIsNull() {
addCriterion("file_name is null");
return (Criteria) this;
}
public Criteria andFileNameIsNotNull() {
addCriterion("file_name is not null");
return (Criteria) this;
}
public Criteria andFileNameEqualTo(String value) {
addCriterion("file_name =", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotEqualTo(String value) {
addCriterion("file_name <>", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThan(String value) {
addCriterion("file_name >", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThanOrEqualTo(String value) {
addCriterion("file_name >=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThan(String value) {
addCriterion("file_name <", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThanOrEqualTo(String value) {
addCriterion("file_name <=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLike(String value) {
addCriterion("file_name like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotLike(String value) {
addCriterion("file_name not like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameIn(List<String> values) {
addCriterion("file_name in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotIn(List<String> values) {
addCriterion("file_name not in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameBetween(String value1, String value2) {
addCriterion("file_name between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotBetween(String value1, String value2) {
addCriterion("file_name not between", value1, value2, "fileName");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -8,6 +8,7 @@ import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import com.sztzjy.financial_bigdata.entity.StuUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -46,4 +47,6 @@ public interface StuStudentExamMapper {
@Select("SELECT se.total_score,te.exam_name FROM stu_student_exam se JOIN tea_exam_manage te on se.exam_manage_id = te.exam_manage_id WHERE se.userid =#{userId} ORDER BY end_time ASC")
List<Map<String, BigDecimal>> getTestScoresLineChart(@Param("userId") String userId);
List<StuUser> getUsersByExamID(@Param("examId")String examId, @Param("keyWord")String keyWord, @Param("status")String status);
}

@ -36,20 +36,7 @@ public interface StuUserMapper {
@Select("select DISTINCT stu_userinfo.school_name from stu_users where school_id =#{schoolId}")
String selectSchoolNameById(@Param("schoolId")String schoolId);
@Select("SELECT SUM(user_count) AS total_user_count " +
"FROM ( " +
" SELECT class_id, COUNT(*) AS user_count " +
" FROM stu_userinfo " +
" WHERE class_id IN (SELECT class_id " +
" FROM tea_and_student_exam " +
" WHERE exam_manage_id = #{examManageId}" +
" <if test='classId != null'>" +
" AND class_id = #{classId}" +
" </if>" +
" ) " +
" GROUP BY class_id " +
") AS subquery;")
int getAllUsersByExamManageId(@Param("examManageId") String examManageId, @Param("classId") String classId);
Integer getAllUsersByExamManageId(@Param("examManageId") String examManageId, @Param("classId") String classId);
void batchInsertStudents(List<StuUser> users);

@ -39,6 +39,6 @@ public interface SysCourseMapper {
@Select("SELECT course_id,course_name FROM sys_course WHERE school_id in (999999999,#{schoolId}) ORDER BY sequence ASC")
List<Map<String,String>> getModuleBySchoolId(@Param("schoolId") String schoolId);
List<SysCourse> getBySchoolId(@Param("schoolId")String schoolId);
List<SysCourse> getBySchoolId();
}

@ -0,0 +1,33 @@
package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary;
import com.sztzjy.financial_bigdata.entity.SysKnowledgeSummaryExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysKnowledgeSummaryMapper {
long countByExample(SysKnowledgeSummaryExample example);
int deleteByExample(SysKnowledgeSummaryExample example);
int deleteByPrimaryKey(String chapterId);
int insert(SysKnowledgeSummary record);
int insertSelective(SysKnowledgeSummary record);
List<SysKnowledgeSummary> selectByExample(SysKnowledgeSummaryExample example);
SysKnowledgeSummary selectByPrimaryKey(String chapterId);
int updateByExampleSelective(@Param("record") SysKnowledgeSummary record, @Param("example") SysKnowledgeSummaryExample example);
int updateByExample(@Param("record") SysKnowledgeSummary record, @Param("example") SysKnowledgeSummaryExample example);
int updateByPrimaryKeySelective(SysKnowledgeSummary record);
int updateByPrimaryKey(SysKnowledgeSummary record);
}

@ -15,4 +15,6 @@ public interface ITeaUserService {
ResultEntity<PageInfo<SysLoginLog>> selectLogs(Integer index, Integer size, String schoolId, String studentId, String classId);
void logExport(HttpServletResponse response, String schoolId, String studentId, String classId);
String getIpAddress(String ip);
}

@ -96,7 +96,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
int generalNum = 0; //一般人数 60-79
int failNumber = 0; //不及格人数
//根据考试ID查出所有user的数量
int sumUserCount = userMapper.getAllUsersByExamManageId(examManageId, classId); //获取老师指定的参加考试的人数
Integer sumUserCount = userMapper.getAllUsersByExamManageId(examManageId, classId); //获取老师指定的参加考试的人数
TeaExaminationDetailsDto teaExaminationDetailsDto = new TeaExaminationDetailsDto();
teaExaminationDetailsDto.setExamNum(sumUserCount);
TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId);
@ -332,7 +332,10 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
}
for (StuTrainingWithBLOBs stuTrainingWithBLOB : stuTrainings) {
TrainingReport trainingReport = trainingReportMapper.selectByPrimaryKey(stuTrainingWithBLOB.getReportId());
BigDecimal reportScore = trainingReport.getTeacherScore();
BigDecimal reportScore = null;
if (trainingReport!=null){
reportScore = trainingReport.getTeacherScore();
}
BigDecimal expTrainingScore = stuTrainingWithBLOB.getExpTrainingScore();
BigDecimal knowledgeSummaryScore = stuTrainingWithBLOB.getKnowledgeSummaryScore();
BigDecimal resourceLearningScore = stuTrainingWithBLOB.getResourceLearningScore();

@ -14,14 +14,18 @@ import com.sztzjy.financial_bigdata.util.ResultEntity;
import com.sztzjy.financial_bigdata.util.excel.FilePortUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.lionsoul.ip2region.xdb.Searcher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.ResourceUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -36,7 +40,7 @@ public class TeaUserServiceImpl implements ITeaUserService {
private SysLoginLogMapper sysLogMapper;
@Autowired
private StuUserMapper stuUserMapper;
private Searcher searcher;
@Override
public ResultEntity<PageInfo<SysLoginLog>> selectLogs(Integer index, Integer size, String schoolId, String studentId, String classId) {
@ -90,5 +94,37 @@ public class TeaUserServiceImpl implements ITeaUserService {
}
}
@Override
public String getIpAddress(String ip){
if ("127.0.0.1".equals(ip) || ip.startsWith("192.168")) {
return "局域网 ip";
}
if (searcher == null) {
try {
File file = ResourceUtils.getFile("classpath:ipdb/ip2region.xdb");
String dbPath = file.getPath();
searcher = Searcher.newWithFileOnly(dbPath);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
String region = null;
String errorMessage = null;
try {
region = searcher.search(ip);
} catch (Exception e) {
errorMessage = e.getMessage();
if (errorMessage != null && errorMessage.length() > 256) {
errorMessage = errorMessage.substring(0,256);
}
e.printStackTrace();
}
// 输出 region
return region;
}
}

@ -1,396 +1,438 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.financial_bigdata.mapper.StuStudentExamMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuStudentExam">
<id column="student_exam_id" jdbcType="VARCHAR" property="studentExamId" />
<result column="exam_manage_id" jdbcType="VARCHAR" property="examManageId" />
<result column="userid" jdbcType="VARCHAR" property="userid" />
<result column="Objective_score" jdbcType="DECIMAL" property="objectiveScore" />
<result column="case_score" jdbcType="DECIMAL" property="caseScore" />
<result column="total_score" jdbcType="DECIMAL" property="totalScore" />
<result column="class_id" jdbcType="VARCHAR" property="classId" />
<result column="exam_end_status" jdbcType="VARCHAR" property="examEndStatus" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
<result column="single_stu_answer_ids" jdbcType="LONGVARCHAR" property="singleStuAnswerIds" />
<result column="many_stu_answer_ids" jdbcType="LONGVARCHAR" property="manyStuAnswerIds" />
<result column="judge_stu_answer_ids" jdbcType="LONGVARCHAR" property="judgeStuAnswerIds" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuStudentExam">
<id column="student_exam_id" jdbcType="VARCHAR" property="studentExamId"/>
<result column="exam_manage_id" jdbcType="VARCHAR" property="examManageId"/>
<result column="userid" jdbcType="VARCHAR" property="userid"/>
<result column="Objective_score" jdbcType="DECIMAL" property="objectiveScore"/>
<result column="case_score" jdbcType="DECIMAL" property="caseScore"/>
<result column="total_score" jdbcType="DECIMAL" property="totalScore"/>
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
<result column="exam_end_status" jdbcType="VARCHAR" property="examEndStatus"/>
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
type="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
<result column="single_stu_answer_ids" jdbcType="LONGVARCHAR" property="singleStuAnswerIds"/>
<result column="many_stu_answer_ids" jdbcType="LONGVARCHAR" property="manyStuAnswerIds"/>
<result column="judge_stu_answer_ids" jdbcType="LONGVARCHAR" property="judgeStuAnswerIds"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
student_exam_id, exam_manage_id, userid, Objective_score, case_score, total_score,
</where>
</sql>
<sql id="Base_Column_List">
student_exam_id
, exam_manage_id, userid, Objective_score, case_score, total_score,
class_id, exam_end_status, start_time
</sql>
<sql id="Blob_Column_List">
single_stu_answer_ids, many_stu_answer_ids, judge_stu_answer_ids
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_student_exam
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_student_exam
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample">
delete from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
insert into stu_student_exam (student_exam_id, exam_manage_id, userid,
Objective_score, case_score, total_score,
class_id, exam_end_status, start_time,
single_stu_answer_ids, many_stu_answer_ids,
judge_stu_answer_ids)
values (#{studentExamId,jdbcType=VARCHAR}, #{examManageId,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR},
#{objectiveScore,jdbcType=DECIMAL}, #{caseScore,jdbcType=DECIMAL}, #{totalScore,jdbcType=DECIMAL},
#{classId,jdbcType=VARCHAR}, #{examEndStatus,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP},
#{singleStuAnswerIds,jdbcType=LONGVARCHAR}, #{manyStuAnswerIds,jdbcType=LONGVARCHAR},
#{judgeStuAnswerIds,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
insert into stu_student_exam
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="studentExamId != null">
student_exam_id,
</if>
<if test="examManageId != null">
exam_manage_id,
</if>
<if test="userid != null">
userid,
</if>
<if test="objectiveScore != null">
Objective_score,
</if>
<if test="caseScore != null">
case_score,
</if>
<if test="totalScore != null">
total_score,
</if>
<if test="classId != null">
class_id,
</if>
<if test="examEndStatus != null">
exam_end_status,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="singleStuAnswerIds != null">
single_stu_answer_ids,
</if>
<if test="manyStuAnswerIds != null">
many_stu_answer_ids,
</if>
<if test="judgeStuAnswerIds != null">
judge_stu_answer_ids,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="studentExamId != null">
#{studentExamId,jdbcType=VARCHAR},
</if>
<if test="examManageId != null">
#{examManageId,jdbcType=VARCHAR},
</if>
<if test="userid != null">
#{userid,jdbcType=VARCHAR},
</if>
<if test="objectiveScore != null">
#{objectiveScore,jdbcType=DECIMAL},
</if>
<if test="caseScore != null">
#{caseScore,jdbcType=DECIMAL},
</if>
<if test="totalScore != null">
#{totalScore,jdbcType=DECIMAL},
</if>
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="examEndStatus != null">
#{examEndStatus,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="singleStuAnswerIds != null">
#{singleStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="manyStuAnswerIds != null">
#{manyStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="judgeStuAnswerIds != null">
#{judgeStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample" resultType="java.lang.Long">
select count(*) from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_student_exam
<set>
<if test="record.studentExamId != null">
student_exam_id = #{record.studentExamId,jdbcType=VARCHAR},
</if>
<if test="record.examManageId != null">
</sql>
<sql id="Blob_Column_List">
single_stu_answer_ids
, many_stu_answer_ids, judge_stu_answer_ids
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from stu_student_exam
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from stu_student_exam
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample">
delete from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
insert into stu_student_exam (student_exam_id, exam_manage_id, userid,
Objective_score, case_score, total_score,
class_id, exam_end_status, start_time,
single_stu_answer_ids, many_stu_answer_ids,
judge_stu_answer_ids)
values (#{studentExamId,jdbcType=VARCHAR}, #{examManageId,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR},
#{objectiveScore,jdbcType=DECIMAL}, #{caseScore,jdbcType=DECIMAL}, #{totalScore,jdbcType=DECIMAL},
#{classId,jdbcType=VARCHAR}, #{examEndStatus,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP},
#{singleStuAnswerIds,jdbcType=LONGVARCHAR}, #{manyStuAnswerIds,jdbcType=LONGVARCHAR},
#{judgeStuAnswerIds,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
insert into stu_student_exam
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="studentExamId != null">
student_exam_id,
</if>
<if test="examManageId != null">
exam_manage_id,
</if>
<if test="userid != null">
userid,
</if>
<if test="objectiveScore != null">
Objective_score,
</if>
<if test="caseScore != null">
case_score,
</if>
<if test="totalScore != null">
total_score,
</if>
<if test="classId != null">
class_id,
</if>
<if test="examEndStatus != null">
exam_end_status,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="singleStuAnswerIds != null">
single_stu_answer_ids,
</if>
<if test="manyStuAnswerIds != null">
many_stu_answer_ids,
</if>
<if test="judgeStuAnswerIds != null">
judge_stu_answer_ids,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="studentExamId != null">
#{studentExamId,jdbcType=VARCHAR},
</if>
<if test="examManageId != null">
#{examManageId,jdbcType=VARCHAR},
</if>
<if test="userid != null">
#{userid,jdbcType=VARCHAR},
</if>
<if test="objectiveScore != null">
#{objectiveScore,jdbcType=DECIMAL},
</if>
<if test="caseScore != null">
#{caseScore,jdbcType=DECIMAL},
</if>
<if test="totalScore != null">
#{totalScore,jdbcType=DECIMAL},
</if>
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="examEndStatus != null">
#{examEndStatus,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="singleStuAnswerIds != null">
#{singleStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="manyStuAnswerIds != null">
#{manyStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="judgeStuAnswerIds != null">
#{judgeStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamExample"
resultType="java.lang.Long">
select count(*) from stu_student_exam
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_student_exam
<set>
<if test="record.studentExamId != null">
student_exam_id = #{record.studentExamId,jdbcType=VARCHAR},
</if>
<if test="record.examManageId != null">
exam_manage_id = #{record.examManageId,jdbcType=VARCHAR},
</if>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=VARCHAR},
</if>
<if test="record.objectiveScore != null">
Objective_score = #{record.objectiveScore,jdbcType=DECIMAL},
</if>
<if test="record.caseScore != null">
case_score = #{record.caseScore,jdbcType=DECIMAL},
</if>
<if test="record.totalScore != null">
total_score = #{record.totalScore,jdbcType=DECIMAL},
</if>
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.examEndStatus != null">
exam_end_status = #{record.examEndStatus,jdbcType=VARCHAR},
</if>
<if test="record.startTime != null">
start_time = #{record.startTime,jdbcType=TIMESTAMP},
</if>
<if test="record.singleStuAnswerIds != null">
single_stu_answer_ids = #{record.singleStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="record.manyStuAnswerIds != null">
many_stu_answer_ids = #{record.manyStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="record.judgeStuAnswerIds != null">
judge_stu_answer_ids = #{record.judgeStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_student_exam
set student_exam_id = #{record.studentExamId,jdbcType=VARCHAR},
exam_manage_id = #{record.examManageId,jdbcType=VARCHAR},
</if>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=VARCHAR},
</if>
<if test="record.objectiveScore != null">
Objective_score = #{record.objectiveScore,jdbcType=DECIMAL},
</if>
<if test="record.caseScore != null">
case_score = #{record.caseScore,jdbcType=DECIMAL},
</if>
<if test="record.totalScore != null">
total_score = #{record.totalScore,jdbcType=DECIMAL},
</if>
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.examEndStatus != null">
exam_end_status = #{record.examEndStatus,jdbcType=VARCHAR},
</if>
<if test="record.startTime != null">
start_time = #{record.startTime,jdbcType=TIMESTAMP},
</if>
<if test="record.singleStuAnswerIds != null">
single_stu_answer_ids = #{record.singleStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="record.manyStuAnswerIds != null">
many_stu_answer_ids = #{record.manyStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="record.judgeStuAnswerIds != null">
judge_stu_answer_ids = #{record.judgeStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_student_exam
set student_exam_id = #{record.studentExamId,jdbcType=VARCHAR},
exam_manage_id = #{record.examManageId,jdbcType=VARCHAR},
userid = #{record.userid,jdbcType=VARCHAR},
Objective_score = #{record.objectiveScore,jdbcType=DECIMAL},
case_score = #{record.caseScore,jdbcType=DECIMAL},
total_score = #{record.totalScore,jdbcType=DECIMAL},
class_id = #{record.classId,jdbcType=VARCHAR},
exam_end_status = #{record.examEndStatus,jdbcType=VARCHAR},
start_time = #{record.startTime,jdbcType=TIMESTAMP},
single_stu_answer_ids = #{record.singleStuAnswerIds,jdbcType=LONGVARCHAR},
many_stu_answer_ids = #{record.manyStuAnswerIds,jdbcType=LONGVARCHAR},
judge_stu_answer_ids = #{record.judgeStuAnswerIds,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_student_exam
set student_exam_id = #{record.studentExamId,jdbcType=VARCHAR},
exam_manage_id = #{record.examManageId,jdbcType=VARCHAR},
userid = #{record.userid,jdbcType=VARCHAR},
Objective_score = #{record.objectiveScore,jdbcType=DECIMAL},
case_score = #{record.caseScore,jdbcType=DECIMAL},
total_score = #{record.totalScore,jdbcType=DECIMAL},
class_id = #{record.classId,jdbcType=VARCHAR},
exam_end_status = #{record.examEndStatus,jdbcType=VARCHAR},
start_time = #{record.startTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
update stu_student_exam
<set>
<if test="examManageId != null">
exam_manage_id = #{examManageId,jdbcType=VARCHAR},
</if>
<if test="userid != null">
userid = #{userid,jdbcType=VARCHAR},
</if>
<if test="objectiveScore != null">
Objective_score = #{objectiveScore,jdbcType=DECIMAL},
</if>
<if test="caseScore != null">
case_score = #{caseScore,jdbcType=DECIMAL},
</if>
<if test="totalScore != null">
total_score = #{totalScore,jdbcType=DECIMAL},
</if>
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="examEndStatus != null">
exam_end_status = #{examEndStatus,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="singleStuAnswerIds != null">
single_stu_answer_ids = #{singleStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="manyStuAnswerIds != null">
many_stu_answer_ids = #{manyStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="judgeStuAnswerIds != null">
judge_stu_answer_ids = #{judgeStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
</set>
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
update stu_student_exam
set exam_manage_id = #{examManageId,jdbcType=VARCHAR},
userid = #{userid,jdbcType=VARCHAR},
Objective_score = #{objectiveScore,jdbcType=DECIMAL},
case_score = #{caseScore,jdbcType=DECIMAL},
total_score = #{totalScore,jdbcType=DECIMAL},
class_id = #{classId,jdbcType=VARCHAR},
exam_end_status = #{examEndStatus,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
single_stu_answer_ids = #{singleStuAnswerIds,jdbcType=LONGVARCHAR},
many_stu_answer_ids = #{manyStuAnswerIds,jdbcType=LONGVARCHAR},
judge_stu_answer_ids = #{judgeStuAnswerIds,jdbcType=LONGVARCHAR}
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExam">
update stu_student_exam
set exam_manage_id = #{examManageId,jdbcType=VARCHAR},
userid = #{userid,jdbcType=VARCHAR},
Objective_score = #{objectiveScore,jdbcType=DECIMAL},
case_score = #{caseScore,jdbcType=DECIMAL},
total_score = #{totalScore,jdbcType=DECIMAL},
class_id = #{classId,jdbcType=VARCHAR},
exam_end_status = #{examEndStatus,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP}
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</update>
judge_stu_answer_ids = #{record.judgeStuAnswerIds,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_student_exam
set student_exam_id = #{record.studentExamId,jdbcType=VARCHAR},
exam_manage_id = #{record.examManageId,jdbcType=VARCHAR},
userid = #{record.userid,jdbcType=VARCHAR},
Objective_score = #{record.objectiveScore,jdbcType=DECIMAL},
case_score = #{record.caseScore,jdbcType=DECIMAL},
total_score = #{record.totalScore,jdbcType=DECIMAL},
class_id = #{record.classId,jdbcType=VARCHAR},
exam_end_status = #{record.examEndStatus,jdbcType=VARCHAR},
start_time = #{record.startTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective"
parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
update stu_student_exam
<set>
<if test="examManageId != null">
exam_manage_id = #{examManageId,jdbcType=VARCHAR},
</if>
<if test="userid != null">
userid = #{userid,jdbcType=VARCHAR},
</if>
<if test="objectiveScore != null">
Objective_score = #{objectiveScore,jdbcType=DECIMAL},
</if>
<if test="caseScore != null">
case_score = #{caseScore,jdbcType=DECIMAL},
</if>
<if test="totalScore != null">
total_score = #{totalScore,jdbcType=DECIMAL},
</if>
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="examEndStatus != null">
exam_end_status = #{examEndStatus,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="singleStuAnswerIds != null">
single_stu_answer_ids = #{singleStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="manyStuAnswerIds != null">
many_stu_answer_ids = #{manyStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
<if test="judgeStuAnswerIds != null">
judge_stu_answer_ids = #{judgeStuAnswerIds,jdbcType=LONGVARCHAR},
</if>
</set>
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs"
parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs">
update stu_student_exam
set exam_manage_id = #{examManageId,jdbcType=VARCHAR},
userid = #{userid,jdbcType=VARCHAR},
Objective_score = #{objectiveScore,jdbcType=DECIMAL},
case_score = #{caseScore,jdbcType=DECIMAL},
total_score = #{totalScore,jdbcType=DECIMAL},
class_id = #{classId,jdbcType=VARCHAR},
exam_end_status = #{examEndStatus,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
single_stu_answer_ids = #{singleStuAnswerIds,jdbcType=LONGVARCHAR},
many_stu_answer_ids = #{manyStuAnswerIds,jdbcType=LONGVARCHAR},
judge_stu_answer_ids = #{judgeStuAnswerIds,jdbcType=LONGVARCHAR}
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuStudentExam">
update stu_student_exam
set exam_manage_id = #{examManageId,jdbcType=VARCHAR},
userid = #{userid,jdbcType=VARCHAR},
Objective_score = #{objectiveScore,jdbcType=DECIMAL},
case_score = #{caseScore,jdbcType=DECIMAL},
total_score = #{totalScore,jdbcType=DECIMAL},
class_id = #{classId,jdbcType=VARCHAR},
exam_end_status = #{examEndStatus,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP}
where student_exam_id = #{studentExamId,jdbcType=VARCHAR}
</update>
<select id="selectLastExamRank" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT COUNT(*) AS exam_rank
FROM stu_student_exam se
JOIN tea_exam_manage te ON se.exam_manage_id = te.exam_manage_id
WHERE se.exam_manage_id = (
SELECT exam_manage_id
FROM stu_student_exam
WHERE userid = #{userId}
AND te.end_time &lt;= NOW()
ORDER BY te.end_time DESC
LIMIT 1
)
AND se.total_score IS NOT NULL
AND se.total_score >= (
SELECT total_score
FROM stu_student_exam
WHERE userid = #{userId} AND te.end_time &lt;= NOW()
ORDER BY te.end_time DESC
LIMIT 1
);
</select>
<select id="selectLastExamRank" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT COUNT(*) AS exam_rank
FROM stu_student_exam se
JOIN tea_exam_manage te ON se.exam_manage_id = te.exam_manage_id
WHERE se.exam_manage_id = (
SELECT exam_manage_id
FROM stu_student_exam
WHERE userid = #{userId} AND te.end_time &lt;= NOW()
ORDER BY te.end_time DESC
LIMIT 1
)
AND se.total_score IS NOT NULL
AND se.total_score >= (
SELECT total_score
FROM stu_student_exam
WHERE userid = #{userId} AND te.end_time &lt;= NOW()
ORDER BY te.end_time DESC
LIMIT 1
);
</select>
<resultMap id="UserMap" type="com.sztzjy.financial_bigdata.entity.StuUser">
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
<result column="class_name" jdbcType="VARCHAR" property="classId"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="exam_end_status" jdbcType="VARCHAR" property="phone"/>
<result column="case_end_status" jdbcType="VARCHAR" property="email"/>
</resultMap>
<select id="getUsersByExamID" parameterType="java.lang.String" resultMap="UserMap">
SELECT su.student_id, sc.class_name, su.`name`,sse.exam_end_status,sse.case_end_status
FROM `stu_student_exam` sse
JOIN stu_userinfo su on sse.userid = su.userid
LEFT JOIN stu_class sc ON su.class_id = sc.class_id
<where>
<if test="examId != null and examId != ''">
exam_manage_id = #{examId}
</if>
<if test="keyWord != null and keyWord != ''">
AND (su.name LIKE CONCAT('%', #{keyWord}, '%') OR su.student_id LIKE CONCAT('%', #{keyWord}, '%'))
</if>
<if test="status == 'true'">
AND sse.case_end_status = 'true' and sse.exam_end_status = 'true'
</if>
<if test="status == 'false'">
AND (sse.case_end_status != 'true' OR sse.exam_end_status != 'true')
</if>
</where>
</select>
</mapper>

@ -400,4 +400,19 @@
</where>
ORDER BY r.teacher_score DESC
</select>
<select id="getAllUsersByExamManageId" resultType="java.lang.Integer">
SELECT SUM(user_count) AS total_user_count
FROM (
SELECT class_id, COUNT(*) AS user_count
FROM stu_userinfo
WHERE class_id IN (SELECT class_id
FROM tea_and_student_exam
WHERE exam_manage_id = #{examManageId}
<if test='classId != null and classId != ""'>
AND class_id = #{classId}
</if>
)GROUP BY class_id ) AS subquery;
</select>
</mapper>

@ -227,7 +227,7 @@
<include refid="Base_Column_List" />
FROM
sys_course
WHERE school_id in ('999999999',#{schoolId})
WHERE input_type = '1'
ORDER BY sequence ASC
</select>

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.financial_bigdata.mapper.SysKnowledgeSummaryMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary">
<id column="chapter_id" jdbcType="VARCHAR" property="chapterId" />
<result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
chapter_id, file_url, file_name
</sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummaryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_knowledge_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_knowledge_summary
where chapter_id = #{chapterId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_knowledge_summary
where chapter_id = #{chapterId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummaryExample">
delete from sys_knowledge_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary">
insert into sys_knowledge_summary (chapter_id, file_url, file_name
)
values (#{chapterId,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary">
insert into sys_knowledge_summary
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="chapterId != null">
chapter_id,
</if>
<if test="fileUrl != null">
file_url,
</if>
<if test="fileName != null">
file_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="chapterId != null">
#{chapterId,jdbcType=VARCHAR},
</if>
<if test="fileUrl != null">
#{fileUrl,jdbcType=VARCHAR},
</if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummaryExample" resultType="java.lang.Long">
select count(*) from sys_knowledge_summary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_knowledge_summary
<set>
<if test="record.chapterId != null">
chapter_id = #{record.chapterId,jdbcType=VARCHAR},
</if>
<if test="record.fileUrl != null">
file_url = #{record.fileUrl,jdbcType=VARCHAR},
</if>
<if test="record.fileName != null">
file_name = #{record.fileName,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_knowledge_summary
set chapter_id = #{record.chapterId,jdbcType=VARCHAR},
file_url = #{record.fileUrl,jdbcType=VARCHAR},
file_name = #{record.fileName,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary">
update sys_knowledge_summary
<set>
<if test="fileUrl != null">
file_url = #{fileUrl,jdbcType=VARCHAR},
</if>
<if test="fileName != null">
file_name = #{fileName,jdbcType=VARCHAR},
</if>
</set>
where chapter_id = #{chapterId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary">
update sys_knowledge_summary
set file_url = #{fileUrl,jdbcType=VARCHAR},
file_name = #{fileName,jdbcType=VARCHAR}
where chapter_id = #{chapterId,jdbcType=VARCHAR}
</update>
</mapper>

Binary file not shown.
Loading…
Cancel
Save