diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/TeaController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/TeaController.java deleted file mode 100644 index fd7fcbc..0000000 --- a/src/main/java/com/sztzjy/financial_bigdata/controller/TeaController.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.sztzjy.financial_bigdata.controller; - -import org.springframework.web.bind.annotation.RestController; - -/** - * @Author xcj - * @Date 2024/3/7 - */ -@RestController -public class TeaController { -} diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/UserController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/UserController.java new file mode 100644 index 0000000..6701995 --- /dev/null +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/UserController.java @@ -0,0 +1,280 @@ +package com.sztzjy.financial_bigdata.controller.tea; + +import cn.hutool.core.util.IdUtil; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.sztzjy.financial_bigdata.annotation.AnonymousAccess; +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.util.ResultEntity; +import com.sztzjy.financial_bigdata.util.excel.FilePortUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; + +/** + * @Author xcj + * @Date 2024/3/7 + */ +@RestController +@RequestMapping("/tea/user") +@Api(tags = "老师端--用户相关") +public class UserController { + @Autowired + private StuClassMapper classMapper; + @Autowired + private StuUserMapper stuUserMapper; + /* 添加班级 + * @author xcj + * @Date 2024/3/11 + */ + @PostMapping("/addClass") + @ApiOperation("班级管理--添加班级") + public ResultEntity addClass(@RequestBody StuClass stuClass) { + if (StringUtils.isBlank(stuClass.getClassName())) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "请填写班级名称"); + } + if (StringUtils.isBlank(stuClass.getSchoolName())) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "请填写学校名称"); + } + StuClass stuClass1 = classMapper.selectByPrimaryKey(stuClass.getClassName()); + if (stuClass1 != null) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "该班级已存在"); + } + stuClass.setCreateTime(new Date()); + stuClass.setClassId(IdUtil.randomUUID()); + classMapper.insert(stuClass); + return new ResultEntity(HttpStatus.OK, "新增成功"); + } + + /* 添加班级 + * @author xcj + * @Date 2024/3/11 + */ + @PostMapping("/deleteClass") + @ApiOperation("班级管理--删除班级") + public ResultEntity deleteClass(@ApiParam("班级id") @RequestParam String classId) { + if (classId == null) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "缺少主键id"); + } + classMapper.deleteByPrimaryKey(classId); + return new ResultEntity(HttpStatus.OK, "删除成功"); + } + + /* 编辑班级 + * @author xcj + * @Date 2024/3/11 + */ + @PostMapping("/updateClass") + @ApiOperation("班级管理--修改班级信息") + public ResultEntity updateClass(@ApiParam("班级id必传") @RequestBody StuClass stuClass) { + if (StringUtils.isBlank(stuClass.getClassName())) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "请填写班级名称"); + } + classMapper.updateByPrimaryKey(stuClass); + return new ResultEntity(HttpStatus.OK, "修改成功"); + } + + /* + * @author xcj + * @Date 2024/3/12 + */ + @PostMapping("/selectClassByName") + @ApiOperation("班级管理--班级管理页面分页查询") + public ResultEntity> selectClassByName(@ApiParam("班级名称(不传默认查所有)") + @RequestParam(required = false) String className, + @RequestParam Integer index, + @RequestParam Integer size) { + PageHelper.startPage(index, size); + StuClassExample example = new StuClassExample(); + if (StringUtils.isNotBlank(className)) { + example.createCriteria().andClassNameEqualTo(className); + } + List stuClasses = classMapper.selectByExample(example); + return new ResultEntity>(new PageInfo<>(stuClasses)); + } + + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/selectAllClassNameBySchoolId") + @ApiOperation("班级下拉框") + public ResultEntity> selectAllClassNameBySchoolId(@RequestParam String schoolId) { + return new ResultEntity>(classMapper.selectAllClassNameBySchoolId(schoolId)); + } + + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/addStudent") + @ApiOperation("学生管理--添加学生") + public ResultEntity addStudent(@ApiParam("所属班级(id)、姓名、学号三个必填") @RequestBody StuUser stuUser) { + if (StringUtils.isBlank(stuUser.getClassId())) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "请选择班级"); + } + if (StringUtils.isBlank(stuUser.getName())) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "请输入学生姓名"); + } + if (StringUtils.isBlank(stuUser.getStudentId())) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "请输入学号"); + } + stuUser.setRoleId(0); + stuUser.setPassword("tzs!@#888"); + stuUser.setCreateTime(new Date()); + stuUser.setUserid(IdUtil.randomUUID()); + stuUser.setUsername(stuUser.getStudentId());//同学号 + stuUser.setStatus(0); + stuUserMapper.insert(stuUser); + return new ResultEntity(HttpStatus.OK, "新增成功"); + } + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/selectStuPage") + @ApiOperation("学生管理--查询") + public ResultEntity selectStuPage(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam String schoolId, + @RequestParam(required = false) String studentId, + @RequestParam(required = false) String classId) { + PageHelper.startPage(index, size); + StuUserExample stuUserExample = new StuUserExample(); + StuUserExample.Criteria criteria = stuUserExample.createCriteria(); + criteria.andSchoolIdEqualTo(schoolId).andStatusEqualTo(0); + if (StringUtils.isNotBlank(studentId)) { + criteria.andStudentIdEqualTo(studentId); + } + if (StringUtils.isNotBlank(classId)) { + criteria.andClassIdEqualTo(classId); + } + List stuUsers = stuUserMapper.selectByExample(stuUserExample); + return new ResultEntity<>(new PageInfo<>(stuUsers)); + } + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/selectSchoolNameById") + @ApiOperation("学生管理--学校名称") + public ResultEntity selectStuPage(@RequestParam String schoolId) { + return new ResultEntity(stuUserMapper.selectSchoolNameById(schoolId)); + } + + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/updateStudent") + @ApiOperation("学生管理--编辑") + public ResultEntity updateStudent(@ApiParam("学校ID必传") @RequestBody StuUser stuUser) { + StuUserExample example = new StuUserExample(); + if (StringUtils.isNotBlank(stuUser.getStudentId())) { + example.createCriteria().andStudentIdEqualTo(stuUser.getStudentId()).andSchoolIdEqualTo(stuUser.getSchoolId()); + } + List stuUsers = stuUserMapper.selectByExample(example); + if (!stuUsers.isEmpty()) { + return new ResultEntity(HttpStatus.BAD_REQUEST, "学号重复!"); + } + return null; + } + + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/deleteStudent") + @ApiOperation("学生管理--删除") + public ResultEntity deleteStudent(@RequestParam String userId) { + StuUser stuUser = stuUserMapper.selectByPrimaryKey(userId); + stuUser.setStatus(1); + stuUserMapper.updateByPrimaryKey(stuUser); + return new ResultEntity<>(HttpStatus.OK, "删除成功!"); + } + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/initPassword") + @ApiOperation("学生管理--初始化密码") + public ResultEntity initPassword(@RequestParam String userId) { + StuUser stuUser = stuUserMapper.selectByPrimaryKey(userId); + stuUser.setPassword("tzs!@#888"); + stuUserMapper.updateByPrimaryKey(stuUser); + return new ResultEntity<>(HttpStatus.OK, "密码初始化成功!", "tzs!@#888"); + } + + + /* + * @author xcj + * @Date 2024/3/12 + */ + @AnonymousAccess + @PostMapping("/exportStu") + @ApiOperation("学生管理--导出") + public void exportStu(HttpServletResponse response, + @ApiParam("按班级导出时传班级ID,默认按学校") @RequestParam(required = false) String classId, + @RequestParam String schoolId) { + StuUserExample userTableExample = new StuUserExample(); + StuUserExample.Criteria criteria = userTableExample.createCriteria(); + criteria.andSchoolIdEqualTo(schoolId); + if (StringUtils.isNotBlank(classId)) { + criteria.andClassIdEqualTo(classId); + } + List userTables = stuUserMapper.selectByExample(userTableExample); + List userDtos = new ArrayList<>(); + for (StuUser userTable : userTables) { + StuUserDto userDto = new StuUserDto(); + String className = classMapper.selectClassNameByClassId(userTable.getClassId()); + BeanUtils.copyProperties(userTable, userDto); + userDto.setClassName(className); + userDtos.add(userDto); + } + //导出的表名 + String title = IdUtil.simpleUUID(); + //表中第一行表头字段 + String[] headers = {"院校名称", "班级名称", "学生姓名", "学号", "电话", "邮箱"}; + + //具体需要写入excel需要哪些字段,这些字段取自UserReward类,也就是上面的实际数据结果集的泛型 + List listColumn = Arrays.asList("schoolName", "className", "name", "studentId", "phone", "email"); + try { + FilePortUtil.exportExcel(response, title, headers, userDtos, listColumn); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + + @AnonymousAccess + @PostMapping("/batchImportStu") + @ApiOperation("学生管理--批量导入") + public void batchImportStu() { + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/StuClass.java b/src/main/java/com/sztzjy/financial_bigdata/entity/StuClass.java index 7f4e1a8..c66e063 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/StuClass.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/StuClass.java @@ -10,6 +10,8 @@ import io.swagger.annotations.ApiModelProperty; * stu_class */ public class StuClass { + private String classId; + @ApiModelProperty("班级名称") private String className; @@ -19,6 +21,14 @@ public class StuClass { @ApiModelProperty("学校名称") private String schoolName; + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId == null ? null : classId.trim(); + } + public String getClassName() { return className; } diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/StuClassExample.java b/src/main/java/com/sztzjy/financial_bigdata/entity/StuClassExample.java index 436d574..38b95f3 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/StuClassExample.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/StuClassExample.java @@ -105,6 +105,76 @@ public class StuClassExample { criteria.add(new Criterion(condition, value1, value2)); } + public Criteria andClassIdIsNull() { + addCriterion("class_id is null"); + return (Criteria) this; + } + + public Criteria andClassIdIsNotNull() { + addCriterion("class_id is not null"); + return (Criteria) this; + } + + public Criteria andClassIdEqualTo(String value) { + addCriterion("class_id =", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotEqualTo(String value) { + addCriterion("class_id <>", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdGreaterThan(String value) { + addCriterion("class_id >", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdGreaterThanOrEqualTo(String value) { + addCriterion("class_id >=", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdLessThan(String value) { + addCriterion("class_id <", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdLessThanOrEqualTo(String value) { + addCriterion("class_id <=", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdLike(String value) { + addCriterion("class_id like", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotLike(String value) { + addCriterion("class_id not like", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdIn(List values) { + addCriterion("class_id in", values, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotIn(List values) { + addCriterion("class_id not in", values, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdBetween(String value1, String value2) { + addCriterion("class_id between", value1, value2, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotBetween(String value1, String value2) { + addCriterion("class_id not between", value1, value2, "classId"); + return (Criteria) this; + } + public Criteria andClassNameIsNull() { addCriterion("class_name is null"); return (Criteria) this; diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java b/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java index 06c4d09..8157785 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java @@ -19,9 +19,6 @@ public class StuUser { @ApiModelProperty("学号") private String studentId; - @ApiModelProperty("班级名称") - private String className; - @ApiModelProperty("班级ID") private String classId; @@ -40,20 +37,20 @@ public class StuUser { @ApiModelProperty("专业") private String major; - @ApiModelProperty("角色ID") + @ApiModelProperty("角色ID 学生0,老师1") private Integer roleId; @ApiModelProperty("创建时间") private Date createTime; @ApiModelProperty("学校ID") - private Integer schoolId; + private String schoolId; @ApiModelProperty("学校名称") private String schoolName; - @ApiModelProperty("状态(老师是否删除)") - private Boolean status; + @ApiModelProperty("状态 0未删除 1删除") + private Integer status; public String getUserid() { return userid; @@ -79,14 +76,6 @@ public class StuUser { this.studentId = studentId == null ? null : studentId.trim(); } - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className == null ? null : className.trim(); - } - public String getClassId() { return classId; } @@ -151,12 +140,12 @@ public class StuUser { this.createTime = createTime; } - public Integer getSchoolId() { + public String getSchoolId() { return schoolId; } - public void setSchoolId(Integer schoolId) { - this.schoolId = schoolId; + public void setSchoolId(String schoolId) { + this.schoolId = schoolId == null ? null : schoolId.trim(); } public String getSchoolName() { @@ -167,11 +156,11 @@ public class StuUser { this.schoolName = schoolName == null ? null : schoolName.trim(); } - public Boolean getStatus() { + public Integer getStatus() { return status; } - public void setStatus(Boolean status) { + public void setStatus(Integer status) { this.status = status; } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/StuUserExample.java b/src/main/java/com/sztzjy/financial_bigdata/entity/StuUserExample.java index 282024b..56e09ac 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/StuUserExample.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/StuUserExample.java @@ -315,76 +315,6 @@ public class StuUserExample { return (Criteria) this; } - public Criteria andClassNameIsNull() { - addCriterion("class_name is null"); - return (Criteria) this; - } - - public Criteria andClassNameIsNotNull() { - addCriterion("class_name is not null"); - return (Criteria) this; - } - - public Criteria andClassNameEqualTo(String value) { - addCriterion("class_name =", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameNotEqualTo(String value) { - addCriterion("class_name <>", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameGreaterThan(String value) { - addCriterion("class_name >", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameGreaterThanOrEqualTo(String value) { - addCriterion("class_name >=", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameLessThan(String value) { - addCriterion("class_name <", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameLessThanOrEqualTo(String value) { - addCriterion("class_name <=", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameLike(String value) { - addCriterion("class_name like", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameNotLike(String value) { - addCriterion("class_name not like", value, "className"); - return (Criteria) this; - } - - public Criteria andClassNameIn(List values) { - addCriterion("class_name in", values, "className"); - return (Criteria) this; - } - - public Criteria andClassNameNotIn(List values) { - addCriterion("class_name not in", values, "className"); - return (Criteria) this; - } - - public Criteria andClassNameBetween(String value1, String value2) { - addCriterion("class_name between", value1, value2, "className"); - return (Criteria) this; - } - - public Criteria andClassNameNotBetween(String value1, String value2) { - addCriterion("class_name not between", value1, value2, "className"); - return (Criteria) this; - } - public Criteria andClassIdIsNull() { addCriterion("class_id is null"); return (Criteria) this; @@ -935,52 +865,62 @@ public class StuUserExample { return (Criteria) this; } - public Criteria andSchoolIdEqualTo(Integer value) { + public Criteria andSchoolIdEqualTo(String value) { addCriterion("school_id =", value, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdNotEqualTo(Integer value) { + public Criteria andSchoolIdNotEqualTo(String value) { addCriterion("school_id <>", value, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdGreaterThan(Integer value) { + public Criteria andSchoolIdGreaterThan(String value) { addCriterion("school_id >", value, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdGreaterThanOrEqualTo(Integer value) { + public Criteria andSchoolIdGreaterThanOrEqualTo(String value) { addCriterion("school_id >=", value, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdLessThan(Integer value) { + public Criteria andSchoolIdLessThan(String value) { addCriterion("school_id <", value, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdLessThanOrEqualTo(Integer value) { + public Criteria andSchoolIdLessThanOrEqualTo(String value) { addCriterion("school_id <=", value, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdIn(List values) { + public Criteria andSchoolIdLike(String value) { + addCriterion("school_id like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotLike(String value) { + addCriterion("school_id not like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdIn(List values) { addCriterion("school_id in", values, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdNotIn(List values) { + public Criteria andSchoolIdNotIn(List values) { addCriterion("school_id not in", values, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdBetween(Integer value1, Integer value2) { + public Criteria andSchoolIdBetween(String value1, String value2) { addCriterion("school_id between", value1, value2, "schoolId"); return (Criteria) this; } - public Criteria andSchoolIdNotBetween(Integer value1, Integer value2) { + public Criteria andSchoolIdNotBetween(String value1, String value2) { addCriterion("school_id not between", value1, value2, "schoolId"); return (Criteria) this; } @@ -1065,52 +1005,52 @@ public class StuUserExample { return (Criteria) this; } - public Criteria andStatusEqualTo(Boolean value) { + public Criteria andStatusEqualTo(Integer value) { addCriterion("status =", value, "status"); return (Criteria) this; } - public Criteria andStatusNotEqualTo(Boolean value) { + public Criteria andStatusNotEqualTo(Integer value) { addCriterion("status <>", value, "status"); return (Criteria) this; } - public Criteria andStatusGreaterThan(Boolean value) { + public Criteria andStatusGreaterThan(Integer value) { addCriterion("status >", value, "status"); return (Criteria) this; } - public Criteria andStatusGreaterThanOrEqualTo(Boolean value) { + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { addCriterion("status >=", value, "status"); return (Criteria) this; } - public Criteria andStatusLessThan(Boolean value) { + public Criteria andStatusLessThan(Integer value) { addCriterion("status <", value, "status"); return (Criteria) this; } - public Criteria andStatusLessThanOrEqualTo(Boolean value) { + public Criteria andStatusLessThanOrEqualTo(Integer value) { addCriterion("status <=", value, "status"); return (Criteria) this; } - public Criteria andStatusIn(List values) { + public Criteria andStatusIn(List values) { addCriterion("status in", values, "status"); return (Criteria) this; } - public Criteria andStatusNotIn(List values) { + public Criteria andStatusNotIn(List values) { addCriterion("status not in", values, "status"); return (Criteria) this; } - public Criteria andStatusBetween(Boolean value1, Boolean value2) { + public Criteria andStatusBetween(Integer value1, Integer value2) { addCriterion("status between", value1, value2, "status"); return (Criteria) this; } - public Criteria andStatusNotBetween(Boolean value1, Boolean value2) { + public Criteria andStatusNotBetween(Integer value1, Integer value2) { addCriterion("status not between", value1, value2, "status"); return (Criteria) this; } diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManage.java b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManage.java index 2707c55..1e147f7 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManage.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManage.java @@ -23,8 +23,8 @@ public class TeaExamManage { @ApiModelProperty("结束时间") private Date endTime; - @ApiModelProperty("班级名称") - private String className; + @ApiModelProperty("班级id") + private String classId; @ApiModelProperty("LOGO地址") private String logoAddress; @@ -82,12 +82,12 @@ public class TeaExamManage { this.endTime = endTime; } - public String getClassName() { - return className; + public String getClassId() { + return classId; } - public void setClassName(String className) { - this.className = className == null ? null : className.trim(); + public void setClassId(String classId) { + this.classId = classId == null ? null : classId.trim(); } public String getLogoAddress() { diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManageExample.java b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManageExample.java index 78c1eba..e07eede 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManageExample.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaExamManageExample.java @@ -366,73 +366,73 @@ public class TeaExamManageExample { return (Criteria) this; } - public Criteria andClassNameIsNull() { - addCriterion("class_name is null"); + public Criteria andClassIdIsNull() { + addCriterion("class_id is null"); return (Criteria) this; } - public Criteria andClassNameIsNotNull() { - addCriterion("class_name is not null"); + public Criteria andClassIdIsNotNull() { + addCriterion("class_id is not null"); return (Criteria) this; } - public Criteria andClassNameEqualTo(String value) { - addCriterion("class_name =", value, "className"); + public Criteria andClassIdEqualTo(String value) { + addCriterion("class_id =", value, "classId"); return (Criteria) this; } - public Criteria andClassNameNotEqualTo(String value) { - addCriterion("class_name <>", value, "className"); + public Criteria andClassIdNotEqualTo(String value) { + addCriterion("class_id <>", value, "classId"); return (Criteria) this; } - public Criteria andClassNameGreaterThan(String value) { - addCriterion("class_name >", value, "className"); + public Criteria andClassIdGreaterThan(String value) { + addCriterion("class_id >", value, "classId"); return (Criteria) this; } - public Criteria andClassNameGreaterThanOrEqualTo(String value) { - addCriterion("class_name >=", value, "className"); + public Criteria andClassIdGreaterThanOrEqualTo(String value) { + addCriterion("class_id >=", value, "classId"); return (Criteria) this; } - public Criteria andClassNameLessThan(String value) { - addCriterion("class_name <", value, "className"); + public Criteria andClassIdLessThan(String value) { + addCriterion("class_id <", value, "classId"); return (Criteria) this; } - public Criteria andClassNameLessThanOrEqualTo(String value) { - addCriterion("class_name <=", value, "className"); + public Criteria andClassIdLessThanOrEqualTo(String value) { + addCriterion("class_id <=", value, "classId"); return (Criteria) this; } - public Criteria andClassNameLike(String value) { - addCriterion("class_name like", value, "className"); + public Criteria andClassIdLike(String value) { + addCriterion("class_id like", value, "classId"); return (Criteria) this; } - public Criteria andClassNameNotLike(String value) { - addCriterion("class_name not like", value, "className"); + public Criteria andClassIdNotLike(String value) { + addCriterion("class_id not like", value, "classId"); return (Criteria) this; } - public Criteria andClassNameIn(List values) { - addCriterion("class_name in", values, "className"); + public Criteria andClassIdIn(List values) { + addCriterion("class_id in", values, "classId"); return (Criteria) this; } - public Criteria andClassNameNotIn(List values) { - addCriterion("class_name not in", values, "className"); + public Criteria andClassIdNotIn(List values) { + addCriterion("class_id not in", values, "classId"); return (Criteria) this; } - public Criteria andClassNameBetween(String value1, String value2) { - addCriterion("class_name between", value1, value2, "className"); + public Criteria andClassIdBetween(String value1, String value2) { + addCriterion("class_id between", value1, value2, "classId"); return (Criteria) this; } - public Criteria andClassNameNotBetween(String value1, String value2) { - addCriterion("class_name not between", value1, value2, "className"); + public Criteria andClassIdNotBetween(String value1, String value2) { + addCriterion("class_id not between", value1, value2, "classId"); return (Criteria) this; } diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/stu_dto/StuUserDto.java b/src/main/java/com/sztzjy/financial_bigdata/entity/stu_dto/StuUserDto.java new file mode 100644 index 0000000..1eac6f8 --- /dev/null +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/stu_dto/StuUserDto.java @@ -0,0 +1,34 @@ +package com.sztzjy.financial_bigdata.entity.stu_dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @Author xcj + * @Date 2024/3/12 + */ +@Data +@NoArgsConstructor +public class StuUserDto { + @ApiModelProperty("学校名称") + private String schoolName; + + @ApiModelProperty("班级名称") + private String className; + + @ApiModelProperty("姓名") + private String name; + + @ApiModelProperty("学号") + private String studentId; + + @ApiModelProperty("电话") + private String phone; + + @ApiModelProperty("邮箱") + private String email; + +} diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuClassMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuClassMapper.java index 270990b..27dc52e 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuClassMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuClassMapper.java @@ -3,14 +3,17 @@ package com.sztzjy.financial_bigdata.mapper; import com.sztzjy.financial_bigdata.entity.StuClass; import com.sztzjy.financial_bigdata.entity.StuClassExample; import java.util.List; -import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +@Mapper public interface StuClassMapper { long countByExample(StuClassExample example); int deleteByExample(StuClassExample example); - int deleteByPrimaryKey(String className); + int deleteByPrimaryKey(String classId); int insert(StuClass record); @@ -18,7 +21,7 @@ public interface StuClassMapper { List selectByExample(StuClassExample example); - StuClass selectByPrimaryKey(String className); + StuClass selectByPrimaryKey(String classId); int updateByExampleSelective(@Param("record") StuClass record, @Param("example") StuClassExample example); @@ -27,4 +30,10 @@ public interface StuClassMapper { int updateByPrimaryKeySelective(StuClass record); int updateByPrimaryKey(StuClass record); + + @Select("SELECT DISTINCT s.class_name, s.class_id FROM stu_class s, stu_users u WHERE #{schoolId}= u.school_id;") + String selectAllClassNameBySchoolId(@Param("schoolId")String schoolId); + + @Select("SELECT s.class_name FROM stu_class s, stu_users u WHERE s.class_id = u.class_id and s.class_id = #{classId};") + String selectClassNameByClassId(@Param("classId")String classId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java index a859230..09ae4e6 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java @@ -2,21 +2,32 @@ package com.sztzjy.financial_bigdata.mapper; import com.sztzjy.financial_bigdata.entity.StuUser; import com.sztzjy.financial_bigdata.entity.StuUserExample; -import java.util.List; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import java.util.List; +@Mapper public interface StuUserMapper { long countByExample(StuUserExample example); int deleteByExample(StuUserExample example); - int insert(StuUser record); + int deleteByPrimaryKey(String classId); + int insert(StuUser record); int insertSelective(StuUser record); List selectByExample(StuUserExample example); - int updateByExampleSelective(@Param("record") StuUser record, @Param("example") StuUserExample example); + StuUser selectByPrimaryKey(String classId); + + int updateByPrimaryKeySelective(StuUser record); + int updateByPrimaryKey(StuUser record); + int updateByExampleSelective(@Param("record") StuUser record, @Param("example") StuUserExample example); int updateByExample(@Param("record") StuUser record, @Param("example") StuUserExample example); + + @Select("select DISTINCT stu_users.school_name from stu_users where school_id =#{schoolId}") + String selectSchoolNameById(@Param("schoolId")String schoolId); } \ No newline at end of file diff --git a/src/main/resources/mapper/StuClassMapper.xml b/src/main/resources/mapper/StuClassMapper.xml index a6f3916..6ff4609 100644 --- a/src/main/resources/mapper/StuClassMapper.xml +++ b/src/main/resources/mapper/StuClassMapper.xml @@ -2,7 +2,8 @@ - + + @@ -65,7 +66,7 @@ - class_name, create_time, school_name + class_id, class_name, create_time, school_name delete from stu_class - where class_name = #{className,jdbcType=VARCHAR} + where class_id = #{classId,jdbcType=VARCHAR} delete from stu_class @@ -98,14 +99,17 @@ - insert into stu_class (class_name, create_time, school_name - ) - values (#{className,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{schoolName,jdbcType=VARCHAR} - ) + insert into stu_class (class_id, class_name, create_time, + school_name) + values (#{classId,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{schoolName,jdbcType=VARCHAR}) insert into stu_class + + class_id, + class_name, @@ -117,6 +121,9 @@ + + #{classId,jdbcType=VARCHAR}, + #{className,jdbcType=VARCHAR}, @@ -137,6 +144,9 @@ update stu_class + + class_id = #{record.classId,jdbcType=VARCHAR}, + class_name = #{record.className,jdbcType=VARCHAR}, @@ -153,7 +163,8 @@ update stu_class - set class_name = #{record.className,jdbcType=VARCHAR}, + set class_id = #{record.classId,jdbcType=VARCHAR}, + class_name = #{record.className,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=TIMESTAMP}, school_name = #{record.schoolName,jdbcType=VARCHAR} @@ -163,6 +174,9 @@ update stu_class + + class_name = #{className,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, @@ -170,12 +184,13 @@ school_name = #{schoolName,jdbcType=VARCHAR}, - where class_name = #{className,jdbcType=VARCHAR} + where class_id = #{classId,jdbcType=VARCHAR} update stu_class - set create_time = #{createTime,jdbcType=TIMESTAMP}, + set class_name = #{className,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, school_name = #{schoolName,jdbcType=VARCHAR} - where class_name = #{className,jdbcType=VARCHAR} + where class_id = #{classId,jdbcType=VARCHAR} \ No newline at end of file diff --git a/src/main/resources/mapper/StuUserMapper.xml b/src/main/resources/mapper/StuUserMapper.xml index 6eef615..db1179b 100644 --- a/src/main/resources/mapper/StuUserMapper.xml +++ b/src/main/resources/mapper/StuUserMapper.xml @@ -5,7 +5,6 @@ - @@ -14,9 +13,9 @@ - + - + @@ -77,8 +76,8 @@ - userid, name, student_id, class_name, class_id, username, password, phone, email, - major, role_id, create_time, school_id, school_name, status + userid, name, student_id, class_id, username, password, phone, email, major, role_id, + create_time, school_id, school_name, status - select - - distinct - - - from stu_user - - - - - order by ${orderByClause} - - - - - delete from stu_user - where user_id = #{userId,jdbcType=VARCHAR} - - - delete from stu_user - - - - - - insert into stu_user (user_id, name, student_id, - major, class_name, class_id, - school_id, school_name, five_score, - artificial_intelligence_score, big_data_score, - cloud_compute_score, internet_of_things_socre, - virtual_reality_socre, industrial_internet_socre, - digital_industry_score, digital_industry_rank, - digital_gover_socre, digital_gover_rank, digital_trade_score, - digital_finance_score, value_data_score, value_data_rank, - industry_digital_score, industry_digital_rank, - total_rank, total_score) - values (#{userId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, - #{major,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, - #{schoolId,jdbcType=VARCHAR}, #{schoolName,jdbcType=VARCHAR}, #{fiveScore,jdbcType=DECIMAL}, - #{artificialIntelligenceScore,jdbcType=DECIMAL}, #{bigDataScore,jdbcType=DECIMAL}, - #{cloudComputeScore,jdbcType=DECIMAL}, #{internetOfThingsSocre,jdbcType=DECIMAL}, - #{virtualRealitySocre,jdbcType=DECIMAL}, #{industrialInternetSocre,jdbcType=DECIMAL}, - #{digitalIndustryScore,jdbcType=DECIMAL}, #{digitalIndustryRank,jdbcType=INTEGER}, - #{digitalGoverSocre,jdbcType=DECIMAL}, #{digitalGoverRank,jdbcType=INTEGER}, #{digitalTradeScore,jdbcType=DECIMAL}, - #{digitalFinanceScore,jdbcType=DECIMAL}, #{valueDataScore,jdbcType=DECIMAL}, #{valueDataRank,jdbcType=INTEGER}, - #{industryDigitalScore,jdbcType=DECIMAL}, #{industryDigitalRank,jdbcType=INTEGER}, - #{totalRank,jdbcType=INTEGER}, #{totalScore,jdbcType=DECIMAL}) - - - insert into stu_user - - - user_id, - - - name, - - - student_id, - - - major, - - - class_name, - - - class_id, - - - school_id, - - - school_name, - - - five_score, - - - artificial_intelligence_score, - - - big_data_score, - - - cloud_compute_score, - - - internet_of_things_socre, - - - virtual_reality_socre, - - - industrial_internet_socre, - - - digital_industry_score, - - - digital_industry_rank, - - - digital_gover_socre, - - - digital_gover_rank, - - - digital_trade_score, - - - digital_finance_score, - - - value_data_score, - - - value_data_rank, - - - industry_digital_score, - - - industry_digital_rank, - - - total_rank, - - - total_score, - - - - - #{userId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{studentId,jdbcType=VARCHAR}, - - - #{major,jdbcType=VARCHAR}, - - - #{className,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - #{schoolId,jdbcType=VARCHAR}, - - - #{schoolName,jdbcType=VARCHAR}, - - - #{fiveScore,jdbcType=DECIMAL}, - - - #{artificialIntelligenceScore,jdbcType=DECIMAL}, - - - #{bigDataScore,jdbcType=DECIMAL}, - - - #{cloudComputeScore,jdbcType=DECIMAL}, - - - #{internetOfThingsSocre,jdbcType=DECIMAL}, - - - #{virtualRealitySocre,jdbcType=DECIMAL}, - - - #{industrialInternetSocre,jdbcType=DECIMAL}, - - - #{digitalIndustryScore,jdbcType=DECIMAL}, - - - #{digitalIndustryRank,jdbcType=INTEGER}, - - - #{digitalGoverSocre,jdbcType=DECIMAL}, - - - #{digitalGoverRank,jdbcType=INTEGER}, - - - #{digitalTradeScore,jdbcType=DECIMAL}, - - - #{digitalFinanceScore,jdbcType=DECIMAL}, - - - #{valueDataScore,jdbcType=DECIMAL}, - - - #{valueDataRank,jdbcType=INTEGER}, - - - #{industryDigitalScore,jdbcType=DECIMAL}, - - - #{industryDigitalRank,jdbcType=INTEGER}, - - - #{totalRank,jdbcType=INTEGER}, - - - #{totalScore,jdbcType=DECIMAL}, - - - - - - update stu_user - - - user_id = #{record.userId,jdbcType=VARCHAR}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - student_id = #{record.studentId,jdbcType=VARCHAR}, - - - major = #{record.major,jdbcType=VARCHAR}, - - - class_name = #{record.className,jdbcType=VARCHAR}, - - - class_id = #{record.classId,jdbcType=VARCHAR}, - - - school_id = #{record.schoolId,jdbcType=VARCHAR}, - - - school_name = #{record.schoolName,jdbcType=VARCHAR}, - - - five_score = #{record.fiveScore,jdbcType=DECIMAL}, - - - artificial_intelligence_score = #{record.artificialIntelligenceScore,jdbcType=DECIMAL}, - - - big_data_score = #{record.bigDataScore,jdbcType=DECIMAL}, - - - cloud_compute_score = #{record.cloudComputeScore,jdbcType=DECIMAL}, - - - internet_of_things_socre = #{record.internetOfThingsSocre,jdbcType=DECIMAL}, - - - virtual_reality_socre = #{record.virtualRealitySocre,jdbcType=DECIMAL}, - - - industrial_internet_socre = #{record.industrialInternetSocre,jdbcType=DECIMAL}, - - - digital_industry_score = #{record.digitalIndustryScore,jdbcType=DECIMAL}, - - - digital_industry_rank = #{record.digitalIndustryRank,jdbcType=INTEGER}, - - - digital_gover_socre = #{record.digitalGoverSocre,jdbcType=DECIMAL}, - - - digital_gover_rank = #{record.digitalGoverRank,jdbcType=INTEGER}, - - - digital_trade_score = #{record.digitalTradeScore,jdbcType=DECIMAL}, - - - digital_finance_score = #{record.digitalFinanceScore,jdbcType=DECIMAL}, - - - value_data_score = #{record.valueDataScore,jdbcType=DECIMAL}, - - - value_data_rank = #{record.valueDataRank,jdbcType=INTEGER}, - - - industry_digital_score = #{record.industryDigitalScore,jdbcType=DECIMAL}, - - - industry_digital_rank = #{record.industryDigitalRank,jdbcType=INTEGER}, - - - total_rank = #{record.totalRank,jdbcType=INTEGER}, - - - total_score = #{record.totalScore,jdbcType=DECIMAL}, - - - - - - - - update stu_user - set user_id = #{record.userId,jdbcType=VARCHAR}, - name = #{record.name,jdbcType=VARCHAR}, - student_id = #{record.studentId,jdbcType=VARCHAR}, - major = #{record.major,jdbcType=VARCHAR}, - class_name = #{record.className,jdbcType=VARCHAR}, - class_id = #{record.classId,jdbcType=VARCHAR}, school_id = #{record.schoolId,jdbcType=VARCHAR}, school_name = #{record.schoolName,jdbcType=VARCHAR}, - five_score = #{record.fiveScore,jdbcType=DECIMAL}, - artificial_intelligence_score = #{record.artificialIntelligenceScore,jdbcType=DECIMAL}, - big_data_score = #{record.bigDataScore,jdbcType=DECIMAL}, - cloud_compute_score = #{record.cloudComputeScore,jdbcType=DECIMAL}, - internet_of_things_socre = #{record.internetOfThingsSocre,jdbcType=DECIMAL}, - virtual_reality_socre = #{record.virtualRealitySocre,jdbcType=DECIMAL}, - industrial_internet_socre = #{record.industrialInternetSocre,jdbcType=DECIMAL}, - digital_industry_score = #{record.digitalIndustryScore,jdbcType=DECIMAL}, - digital_industry_rank = #{record.digitalIndustryRank,jdbcType=INTEGER}, - digital_gover_socre = #{record.digitalGoverSocre,jdbcType=DECIMAL}, - digital_gover_rank = #{record.digitalGoverRank,jdbcType=INTEGER}, - digital_trade_score = #{record.digitalTradeScore,jdbcType=DECIMAL}, - digital_finance_score = #{record.digitalFinanceScore,jdbcType=DECIMAL}, - value_data_score = #{record.valueDataScore,jdbcType=DECIMAL}, - value_data_rank = #{record.valueDataRank,jdbcType=INTEGER}, - industry_digital_score = #{record.industryDigitalScore,jdbcType=DECIMAL}, - industry_digital_rank = #{record.industryDigitalRank,jdbcType=INTEGER}, - total_rank = #{record.totalRank,jdbcType=INTEGER}, - total_score = #{record.totalScore,jdbcType=DECIMAL} + status = #{record.status,jdbcType=INTEGER} - - update stu_user - - - name = #{name,jdbcType=VARCHAR}, - - - student_id = #{studentId,jdbcType=VARCHAR}, - - - major = #{major,jdbcType=VARCHAR}, - - - class_name = #{className,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - school_id = #{schoolId,jdbcType=VARCHAR}, - - - school_name = #{schoolName,jdbcType=VARCHAR}, - - - five_score = #{fiveScore,jdbcType=DECIMAL}, - - - artificial_intelligence_score = #{artificialIntelligenceScore,jdbcType=DECIMAL}, - - - big_data_score = #{bigDataScore,jdbcType=DECIMAL}, - - - cloud_compute_score = #{cloudComputeScore,jdbcType=DECIMAL}, - - - internet_of_things_socre = #{internetOfThingsSocre,jdbcType=DECIMAL}, - - - virtual_reality_socre = #{virtualRealitySocre,jdbcType=DECIMAL}, - - - industrial_internet_socre = #{industrialInternetSocre,jdbcType=DECIMAL}, - - - digital_industry_score = #{digitalIndustryScore,jdbcType=DECIMAL}, - - - digital_industry_rank = #{digitalIndustryRank,jdbcType=INTEGER}, - - - digital_gover_socre = #{digitalGoverSocre,jdbcType=DECIMAL}, - - - digital_gover_rank = #{digitalGoverRank,jdbcType=INTEGER}, - - - digital_trade_score = #{digitalTradeScore,jdbcType=DECIMAL}, - - - digital_finance_score = #{digitalFinanceScore,jdbcType=DECIMAL}, - - - value_data_score = #{valueDataScore,jdbcType=DECIMAL}, - - - value_data_rank = #{valueDataRank,jdbcType=INTEGER}, - - - industry_digital_score = #{industryDigitalScore,jdbcType=DECIMAL}, - - - industry_digital_rank = #{industryDigitalRank,jdbcType=INTEGER}, - - - total_rank = #{totalRank,jdbcType=INTEGER}, - - - total_score = #{totalScore,jdbcType=DECIMAL}, - - - where user_id = #{userId,jdbcType=VARCHAR} - - - update stu_user - set name = #{name,jdbcType=VARCHAR}, - student_id = #{studentId,jdbcType=VARCHAR}, - major = #{major,jdbcType=VARCHAR}, - class_name = #{className,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR}, - school_id = #{schoolId,jdbcType=VARCHAR}, - school_name = #{schoolName,jdbcType=VARCHAR}, - five_score = #{fiveScore,jdbcType=DECIMAL}, - artificial_intelligence_score = #{artificialIntelligenceScore,jdbcType=DECIMAL}, - big_data_score = #{bigDataScore,jdbcType=DECIMAL}, - cloud_compute_score = #{cloudComputeScore,jdbcType=DECIMAL}, - internet_of_things_socre = #{internetOfThingsSocre,jdbcType=DECIMAL}, - virtual_reality_socre = #{virtualRealitySocre,jdbcType=DECIMAL}, - industrial_internet_socre = #{industrialInternetSocre,jdbcType=DECIMAL}, - digital_industry_score = #{digitalIndustryScore,jdbcType=DECIMAL}, - digital_industry_rank = #{digitalIndustryRank,jdbcType=INTEGER}, - digital_gover_socre = #{digitalGoverSocre,jdbcType=DECIMAL}, - digital_gover_rank = #{digitalGoverRank,jdbcType=INTEGER}, - digital_trade_score = #{digitalTradeScore,jdbcType=DECIMAL}, - digital_finance_score = #{digitalFinanceScore,jdbcType=DECIMAL}, - value_data_score = #{valueDataScore,jdbcType=DECIMAL}, - value_data_rank = #{valueDataRank,jdbcType=INTEGER}, - industry_digital_score = #{industryDigitalScore,jdbcType=DECIMAL}, - industry_digital_rank = #{industryDigitalRank,jdbcType=INTEGER}, - total_rank = #{totalRank,jdbcType=INTEGER}, - total_score = #{totalScore,jdbcType=DECIMAL} - where user_id = #{userId,jdbcType=VARCHAR} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - user_id, name, student_id, major, class_name, class_id, school_id, school_name, hash_function_score, - blockchain_score, data_layer_score, network_layer_score, consensus_layer_socre, exciting_layer_socre, - contract_layer_socre, concept_score, concept_rank, technology_socre, technology_rank, - digital_currency_score, digital_currency_rank, invoice_score, supply_chain_finance_score, - traceability_and_anti_counterfeiting_score, ticket_results_score, cross_border_payment_results_score, - total_rank, total_score - - - - - delete from stu_user - where user_id = #{userId,jdbcType=VARCHAR} - - - delete from stu_user - - - - - - insert into stu_user (user_id, name, student_id, - major, class_name, class_id, - school_id, school_name, hash_function_score, - blockchain_score, data_layer_score, network_layer_score, - consensus_layer_socre, exciting_layer_socre, - contract_layer_socre, concept_score, concept_rank, - technology_socre, technology_rank, digital_currency_score, - digital_currency_rank, invoice_score, supply_chain_finance_score, - traceability_and_anti_counterfeiting_score, ticket_results_score, - cross_border_payment_results_score, total_rank, - total_score) - values (#{userId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, - #{major,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, - #{schoolId,jdbcType=VARCHAR}, #{schoolName,jdbcType=VARCHAR}, #{hashFunctionScore,jdbcType=DECIMAL}, - #{blockchainScore,jdbcType=DECIMAL}, #{dataLayerScore,jdbcType=DECIMAL}, #{networkLayerScore,jdbcType=DECIMAL}, - #{consensusLayerSocre,jdbcType=DECIMAL}, #{excitingLayerSocre,jdbcType=DECIMAL}, - #{contractLayerSocre,jdbcType=DECIMAL}, #{conceptScore,jdbcType=DECIMAL}, #{conceptRank,jdbcType=INTEGER}, - #{technologySocre,jdbcType=DECIMAL}, #{technologyRank,jdbcType=INTEGER}, #{digitalCurrencyScore,jdbcType=DECIMAL}, - #{digitalCurrencyRank,jdbcType=INTEGER}, #{invoiceScore,jdbcType=DECIMAL}, #{supplyChainFinanceScore,jdbcType=DECIMAL}, - #{traceabilityAndAntiCounterfeitingScore,jdbcType=DECIMAL}, #{ticketResultsScore,jdbcType=DECIMAL}, - #{crossBorderPaymentResultsScore,jdbcType=DECIMAL}, #{totalRank,jdbcType=INTEGER}, - #{totalScore,jdbcType=DECIMAL}) - - - insert into stu_user - - - user_id, - - - name, - - - student_id, - - - major, - - - class_name, - - - class_id, - - - school_id, - - - school_name, - - - hash_function_score, - - - blockchain_score, - - - data_layer_score, - - - network_layer_score, - - - consensus_layer_socre, - - - exciting_layer_socre, - - - contract_layer_socre, - - - concept_score, - - - concept_rank, - - - technology_socre, - - - technology_rank, - - - digital_currency_score, - - - digital_currency_rank, - - - invoice_score, - - - supply_chain_finance_score, - - - traceability_and_anti_counterfeiting_score, - - - ticket_results_score, - - - cross_border_payment_results_score, - - - total_rank, - - - total_score, - - - - - #{userId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{studentId,jdbcType=VARCHAR}, - - - #{major,jdbcType=VARCHAR}, - - - #{className,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - #{schoolId,jdbcType=VARCHAR}, - - - #{schoolName,jdbcType=VARCHAR}, - - - #{hashFunctionScore,jdbcType=DECIMAL}, - - - #{blockchainScore,jdbcType=DECIMAL}, - - - #{dataLayerScore,jdbcType=DECIMAL}, - - - #{networkLayerScore,jdbcType=DECIMAL}, - - - #{consensusLayerSocre,jdbcType=DECIMAL}, - - - #{excitingLayerSocre,jdbcType=DECIMAL}, - - - #{contractLayerSocre,jdbcType=DECIMAL}, - - - #{conceptScore,jdbcType=DECIMAL}, - - - #{conceptRank,jdbcType=INTEGER}, - - - #{technologySocre,jdbcType=DECIMAL}, - - - #{technologyRank,jdbcType=INTEGER}, - - - #{digitalCurrencyScore,jdbcType=DECIMAL}, - - - #{digitalCurrencyRank,jdbcType=INTEGER}, - - - #{invoiceScore,jdbcType=DECIMAL}, - - - #{supplyChainFinanceScore,jdbcType=DECIMAL}, - - - #{traceabilityAndAntiCounterfeitingScore,jdbcType=DECIMAL}, - - - #{ticketResultsScore,jdbcType=DECIMAL}, - - - #{crossBorderPaymentResultsScore,jdbcType=DECIMAL}, - - - #{totalRank,jdbcType=INTEGER}, - - - #{totalScore,jdbcType=DECIMAL}, - - - - - - update stu_user - - - user_id = #{record.userId,jdbcType=VARCHAR}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - student_id = #{record.studentId,jdbcType=VARCHAR}, - - - major = #{record.major,jdbcType=VARCHAR}, - - - class_name = #{record.className,jdbcType=VARCHAR}, - - - class_id = #{record.classId,jdbcType=VARCHAR}, - - - school_id = #{record.schoolId,jdbcType=VARCHAR}, - - - school_name = #{record.schoolName,jdbcType=VARCHAR}, - - - hash_function_score = #{record.hashFunctionScore,jdbcType=DECIMAL}, - - - blockchain_score = #{record.blockchainScore,jdbcType=DECIMAL}, - - - data_layer_score = #{record.dataLayerScore,jdbcType=DECIMAL}, - - - network_layer_score = #{record.networkLayerScore,jdbcType=DECIMAL}, - - - consensus_layer_socre = #{record.consensusLayerSocre,jdbcType=DECIMAL}, - - - exciting_layer_socre = #{record.excitingLayerSocre,jdbcType=DECIMAL}, - - - contract_layer_socre = #{record.contractLayerSocre,jdbcType=DECIMAL}, - - - concept_score = #{record.conceptScore,jdbcType=DECIMAL}, - - - concept_rank = #{record.conceptRank,jdbcType=INTEGER}, - - - technology_socre = #{record.technologySocre,jdbcType=DECIMAL}, - - - technology_rank = #{record.technologyRank,jdbcType=INTEGER}, - - - digital_currency_score = #{record.digitalCurrencyScore,jdbcType=DECIMAL}, - - - digital_currency_rank = #{record.digitalCurrencyRank,jdbcType=INTEGER}, - - - invoice_score = #{record.invoiceScore,jdbcType=DECIMAL}, - - - supply_chain_finance_score = #{record.supplyChainFinanceScore,jdbcType=DECIMAL}, - - - traceability_and_anti_counterfeiting_score = #{record.traceabilityAndAntiCounterfeitingScore,jdbcType=DECIMAL}, - - - ticket_results_score = #{record.ticketResultsScore,jdbcType=DECIMAL}, - - - cross_border_payment_results_score = #{record.crossBorderPaymentResultsScore,jdbcType=DECIMAL}, - - - total_rank = #{record.totalRank,jdbcType=INTEGER}, - - - total_score = #{record.totalScore,jdbcType=DECIMAL}, - - - - - - - - update stu_user - set user_id = #{record.userId,jdbcType=VARCHAR}, - name = #{record.name,jdbcType=VARCHAR}, - student_id = #{record.studentId,jdbcType=VARCHAR}, - major = #{record.major,jdbcType=VARCHAR}, - class_name = #{record.className,jdbcType=VARCHAR}, - class_id = #{record.classId,jdbcType=VARCHAR}, - school_id = #{record.schoolId,jdbcType=VARCHAR}, - school_name = #{record.schoolName,jdbcType=VARCHAR}, - hash_function_score = #{record.hashFunctionScore,jdbcType=DECIMAL}, - blockchain_score = #{record.blockchainScore,jdbcType=DECIMAL}, - data_layer_score = #{record.dataLayerScore,jdbcType=DECIMAL}, - network_layer_score = #{record.networkLayerScore,jdbcType=DECIMAL}, - consensus_layer_socre = #{record.consensusLayerSocre,jdbcType=DECIMAL}, - exciting_layer_socre = #{record.excitingLayerSocre,jdbcType=DECIMAL}, - contract_layer_socre = #{record.contractLayerSocre,jdbcType=DECIMAL}, - concept_score = #{record.conceptScore,jdbcType=DECIMAL}, - concept_rank = #{record.conceptRank,jdbcType=INTEGER}, - technology_socre = #{record.technologySocre,jdbcType=DECIMAL}, - technology_rank = #{record.technologyRank,jdbcType=INTEGER}, - digital_currency_score = #{record.digitalCurrencyScore,jdbcType=DECIMAL}, - digital_currency_rank = #{record.digitalCurrencyRank,jdbcType=INTEGER}, - invoice_score = #{record.invoiceScore,jdbcType=DECIMAL}, - supply_chain_finance_score = #{record.supplyChainFinanceScore,jdbcType=DECIMAL}, - traceability_and_anti_counterfeiting_score = #{record.traceabilityAndAntiCounterfeitingScore,jdbcType=DECIMAL}, - ticket_results_score = #{record.ticketResultsScore,jdbcType=DECIMAL}, - cross_border_payment_results_score = #{record.crossBorderPaymentResultsScore,jdbcType=DECIMAL}, - total_rank = #{record.totalRank,jdbcType=INTEGER}, - total_score = #{record.totalScore,jdbcType=DECIMAL} - - - - - - update stu_user - - - name = #{name,jdbcType=VARCHAR}, - - - student_id = #{studentId,jdbcType=VARCHAR}, - - - major = #{major,jdbcType=VARCHAR}, - - - class_name = #{className,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - school_id = #{schoolId,jdbcType=VARCHAR}, - - - school_name = #{schoolName,jdbcType=VARCHAR}, - - - hash_function_score = #{hashFunctionScore,jdbcType=DECIMAL}, - - - blockchain_score = #{blockchainScore,jdbcType=DECIMAL}, - - - data_layer_score = #{dataLayerScore,jdbcType=DECIMAL}, - - - network_layer_score = #{networkLayerScore,jdbcType=DECIMAL}, - - - consensus_layer_socre = #{consensusLayerSocre,jdbcType=DECIMAL}, - - - exciting_layer_socre = #{excitingLayerSocre,jdbcType=DECIMAL}, - - - contract_layer_socre = #{contractLayerSocre,jdbcType=DECIMAL}, - - - concept_score = #{conceptScore,jdbcType=DECIMAL}, - - - concept_rank = #{conceptRank,jdbcType=INTEGER}, - - - technology_socre = #{technologySocre,jdbcType=DECIMAL}, - - - technology_rank = #{technologyRank,jdbcType=INTEGER}, - - - digital_currency_score = #{digitalCurrencyScore,jdbcType=DECIMAL}, - - - digital_currency_rank = #{digitalCurrencyRank,jdbcType=INTEGER}, - - - invoice_score = #{invoiceScore,jdbcType=DECIMAL}, - - - supply_chain_finance_score = #{supplyChainFinanceScore,jdbcType=DECIMAL}, - - - traceability_and_anti_counterfeiting_score = #{traceabilityAndAntiCounterfeitingScore,jdbcType=DECIMAL}, - - - ticket_results_score = #{ticketResultsScore,jdbcType=DECIMAL}, - - - cross_border_payment_results_score = #{crossBorderPaymentResultsScore,jdbcType=DECIMAL}, - - - total_rank = #{totalRank,jdbcType=INTEGER}, - - - total_score = #{totalScore,jdbcType=DECIMAL}, - - - where user_id = #{userId,jdbcType=VARCHAR} - - - update stu_user - set name = #{name,jdbcType=VARCHAR}, - student_id = #{studentId,jdbcType=VARCHAR}, - major = #{major,jdbcType=VARCHAR}, - class_name = #{className,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR}, - school_id = #{schoolId,jdbcType=VARCHAR}, - school_name = #{schoolName,jdbcType=VARCHAR}, - hash_function_score = #{hashFunctionScore,jdbcType=DECIMAL}, - blockchain_score = #{blockchainScore,jdbcType=DECIMAL}, - data_layer_score = #{dataLayerScore,jdbcType=DECIMAL}, - network_layer_score = #{networkLayerScore,jdbcType=DECIMAL}, - consensus_layer_socre = #{consensusLayerSocre,jdbcType=DECIMAL}, - exciting_layer_socre = #{excitingLayerSocre,jdbcType=DECIMAL}, - contract_layer_socre = #{contractLayerSocre,jdbcType=DECIMAL}, - concept_score = #{conceptScore,jdbcType=DECIMAL}, - concept_rank = #{conceptRank,jdbcType=INTEGER}, - technology_socre = #{technologySocre,jdbcType=DECIMAL}, - technology_rank = #{technologyRank,jdbcType=INTEGER}, - digital_currency_score = #{digitalCurrencyScore,jdbcType=DECIMAL}, - digital_currency_rank = #{digitalCurrencyRank,jdbcType=INTEGER}, - invoice_score = #{invoiceScore,jdbcType=DECIMAL}, - supply_chain_finance_score = #{supplyChainFinanceScore,jdbcType=DECIMAL}, - traceability_and_anti_counterfeiting_score = #{traceabilityAndAntiCounterfeitingScore,jdbcType=DECIMAL}, - ticket_results_score = #{ticketResultsScore,jdbcType=DECIMAL}, - cross_border_payment_results_score = #{crossBorderPaymentResultsScore,jdbcType=DECIMAL}, - total_rank = #{totalRank,jdbcType=INTEGER}, - total_score = #{totalScore,jdbcType=DECIMAL} - where user_id = #{userId,jdbcType=VARCHAR} - - \ No newline at end of file + diff --git a/src/main/resources/mapper/TeaExamManageMapper.xml b/src/main/resources/mapper/TeaExamManageMapper.xml index 77514d2..eb2c123 100644 --- a/src/main/resources/mapper/TeaExamManageMapper.xml +++ b/src/main/resources/mapper/TeaExamManageMapper.xml @@ -6,7 +6,7 @@ - + @@ -84,7 +84,7 @@ - exam_manage_id, exam_name, start_time, end_time, class_name, logo_address, exam_Description, + exam_manage_id, exam_name, start_time, end_time, class_id, logo_address, exam_Description, Objective_weight, case_weight, single_score, many_score, judge_score, case_score @@ -141,14 +141,14 @@ insert into tea_exam_manage (exam_manage_id, exam_name, start_time, - end_time, class_name, logo_address, + end_time, class_id, logo_address, exam_Description, Objective_weight, case_weight, single_score, many_score, judge_score, case_score, single_idList, many_idList, judge_idList, case_idList, single_answer, many_answer, judge_answer) values (#{examManageId,jdbcType=VARCHAR}, #{examName,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, - #{endTime,jdbcType=TIMESTAMP}, #{className,jdbcType=VARCHAR}, #{logoAddress,jdbcType=VARCHAR}, + #{endTime,jdbcType=TIMESTAMP}, #{classId,jdbcType=VARCHAR}, #{logoAddress,jdbcType=VARCHAR}, #{examDescription,jdbcType=VARCHAR}, #{objectiveWeight,jdbcType=DECIMAL}, #{caseWeight,jdbcType=DECIMAL}, #{singleScore,jdbcType=DECIMAL}, #{manyScore,jdbcType=DECIMAL}, #{judgeScore,jdbcType=DECIMAL}, #{caseScore,jdbcType=DECIMAL}, #{singleIdlist,jdbcType=LONGVARCHAR}, #{manyIdlist,jdbcType=LONGVARCHAR}, @@ -170,8 +170,8 @@ end_time, - - class_name, + + class_id, logo_address, @@ -232,8 +232,8 @@ #{endTime,jdbcType=TIMESTAMP}, - - #{className,jdbcType=VARCHAR}, + + #{classId,jdbcType=VARCHAR}, #{logoAddress,jdbcType=VARCHAR}, @@ -303,8 +303,8 @@ end_time = #{record.endTime,jdbcType=TIMESTAMP}, - - class_name = #{record.className,jdbcType=VARCHAR}, + + class_id = #{record.classId,jdbcType=VARCHAR}, logo_address = #{record.logoAddress,jdbcType=VARCHAR}, @@ -362,7 +362,7 @@ exam_name = #{record.examName,jdbcType=VARCHAR}, start_time = #{record.startTime,jdbcType=TIMESTAMP}, end_time = #{record.endTime,jdbcType=TIMESTAMP}, - class_name = #{record.className,jdbcType=VARCHAR}, + class_id = #{record.classId,jdbcType=VARCHAR}, logo_address = #{record.logoAddress,jdbcType=VARCHAR}, exam_Description = #{record.examDescription,jdbcType=VARCHAR}, Objective_weight = #{record.objectiveWeight,jdbcType=DECIMAL}, @@ -388,7 +388,7 @@ exam_name = #{record.examName,jdbcType=VARCHAR}, start_time = #{record.startTime,jdbcType=TIMESTAMP}, end_time = #{record.endTime,jdbcType=TIMESTAMP}, - class_name = #{record.className,jdbcType=VARCHAR}, + class_id = #{record.classId,jdbcType=VARCHAR}, logo_address = #{record.logoAddress,jdbcType=VARCHAR}, exam_Description = #{record.examDescription,jdbcType=VARCHAR}, Objective_weight = #{record.objectiveWeight,jdbcType=DECIMAL}, @@ -413,8 +413,8 @@ end_time = #{endTime,jdbcType=TIMESTAMP}, - - class_name = #{className,jdbcType=VARCHAR}, + + class_id = #{classId,jdbcType=VARCHAR}, logo_address = #{logoAddress,jdbcType=VARCHAR}, @@ -469,7 +469,7 @@ set exam_name = #{examName,jdbcType=VARCHAR}, start_time = #{startTime,jdbcType=TIMESTAMP}, end_time = #{endTime,jdbcType=TIMESTAMP}, - class_name = #{className,jdbcType=VARCHAR}, + class_id = #{classId,jdbcType=VARCHAR}, logo_address = #{logoAddress,jdbcType=VARCHAR}, exam_Description = #{examDescription,jdbcType=VARCHAR}, Objective_weight = #{objectiveWeight,jdbcType=DECIMAL}, @@ -492,7 +492,7 @@ set exam_name = #{examName,jdbcType=VARCHAR}, start_time = #{startTime,jdbcType=TIMESTAMP}, end_time = #{endTime,jdbcType=TIMESTAMP}, - class_name = #{className,jdbcType=VARCHAR}, + class_id = #{classId,jdbcType=VARCHAR}, logo_address = #{logoAddress,jdbcType=VARCHAR}, exam_Description = #{examDescription,jdbcType=VARCHAR}, Objective_weight = #{objectiveWeight,jdbcType=DECIMAL},