自动生成配置文件和mapper xml

newBigdata
xiaoCJ 1 year ago
parent 09eb0ebc86
commit 6a3f1bc7e0

@ -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 {
}

@ -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<HttpStatus> addClass(@RequestBody StuClass stuClass) {
if (StringUtils.isBlank(stuClass.getClassName())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请填写班级名称");
}
if (StringUtils.isBlank(stuClass.getSchoolName())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请填写学校名称");
}
StuClass stuClass1 = classMapper.selectByPrimaryKey(stuClass.getClassName());
if (stuClass1 != null) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "该班级已存在");
}
stuClass.setCreateTime(new Date());
stuClass.setClassId(IdUtil.randomUUID());
classMapper.insert(stuClass);
return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功");
}
/*
* @author xcj
* @Date 2024/3/11
*/
@PostMapping("/deleteClass")
@ApiOperation("班级管理--删除班级")
public ResultEntity<HttpStatus> deleteClass(@ApiParam("班级id") @RequestParam String classId) {
if (classId == null) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "缺少主键id");
}
classMapper.deleteByPrimaryKey(classId);
return new ResultEntity<HttpStatus>(HttpStatus.OK, "删除成功");
}
/*
* @author xcj
* @Date 2024/3/11
*/
@PostMapping("/updateClass")
@ApiOperation("班级管理--修改班级信息")
public ResultEntity<HttpStatus> updateClass(@ApiParam("班级id必传") @RequestBody StuClass stuClass) {
if (StringUtils.isBlank(stuClass.getClassName())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请填写班级名称");
}
classMapper.updateByPrimaryKey(stuClass);
return new ResultEntity<HttpStatus>(HttpStatus.OK, "修改成功");
}
/*
* @author xcj
* @Date 2024/3/12
*/
@PostMapping("/selectClassByName")
@ApiOperation("班级管理--班级管理页面分页查询")
public ResultEntity<PageInfo<StuClass>> 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<StuClass> stuClasses = classMapper.selectByExample(example);
return new ResultEntity<PageInfo<StuClass>>(new PageInfo<>(stuClasses));
}
/*
* @author xcj
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/selectAllClassNameBySchoolId")
@ApiOperation("班级下拉框")
public ResultEntity<List<String>> selectAllClassNameBySchoolId(@RequestParam String schoolId) {
return new ResultEntity<List<String>>(classMapper.selectAllClassNameBySchoolId(schoolId));
}
/*
* @author xcj
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/addStudent")
@ApiOperation("学生管理--添加学生")
public ResultEntity<HttpStatus> addStudent(@ApiParam("所属班级(id)、姓名、学号三个必填") @RequestBody StuUser stuUser) {
if (StringUtils.isBlank(stuUser.getClassId())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请选择班级");
}
if (StringUtils.isBlank(stuUser.getName())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请输入学生姓名");
}
if (StringUtils.isBlank(stuUser.getStudentId())) {
return new ResultEntity<HttpStatus>(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>(HttpStatus.OK, "新增成功");
}
/*
* @author xcj
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/selectStuPage")
@ApiOperation("学生管理--查询")
public ResultEntity<PageInfo> 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<StuUser> stuUsers = stuUserMapper.selectByExample(stuUserExample);
return new ResultEntity<>(new PageInfo<>(stuUsers));
}
/*
* @author xcj
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/selectSchoolNameById")
@ApiOperation("学生管理--学校名称")
public ResultEntity<String> selectStuPage(@RequestParam String schoolId) {
return new ResultEntity(stuUserMapper.selectSchoolNameById(schoolId));
}
/*
* @author xcj
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/updateStudent")
@ApiOperation("学生管理--编辑")
public ResultEntity<HttpStatus> updateStudent(@ApiParam("学校ID必传") @RequestBody StuUser stuUser) {
StuUserExample example = new StuUserExample();
if (StringUtils.isNotBlank(stuUser.getStudentId())) {
example.createCriteria().andStudentIdEqualTo(stuUser.getStudentId()).andSchoolIdEqualTo(stuUser.getSchoolId());
}
List<StuUser> stuUsers = stuUserMapper.selectByExample(example);
if (!stuUsers.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "学号重复!");
}
return null;
}
/*
* @author xcj
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/deleteStudent")
@ApiOperation("学生管理--删除")
public ResultEntity<HttpStatus> 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<String> 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<StuUser> userTables = stuUserMapper.selectByExample(userTableExample);
List<StuUserDto> 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<String> 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() {
}
}

@ -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;
}

@ -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<String> values) {
addCriterion("class_id in", values, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotIn(List<String> 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;

@ -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;
}
}

@ -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<String> values) {
addCriterion("class_name in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameNotIn(List<String> 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<Integer> 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<String> values) {
addCriterion("school_id in", values, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdNotIn(List<Integer> values) {
public Criteria andSchoolIdNotIn(List<String> 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<Boolean> values) {
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Boolean> values) {
public Criteria andStatusNotIn(List<Integer> 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;
}

@ -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() {

@ -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<String> values) {
addCriterion("class_name in", values, "className");
public Criteria andClassIdIn(List<String> values) {
addCriterion("class_id in", values, "classId");
return (Criteria) this;
}
public Criteria andClassNameNotIn(List<String> values) {
addCriterion("class_name not in", values, "className");
public Criteria andClassIdNotIn(List<String> 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;
}

@ -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;
}

@ -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<StuClass> 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);
}

@ -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<StuUser> 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);
}

@ -2,7 +2,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.StuClassMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuClass">
<id column="class_name" jdbcType="VARCHAR" property="className" />
<id column="class_id" jdbcType="VARCHAR" property="classId" />
<result column="class_name" jdbcType="VARCHAR" property="className" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
</resultMap>
@ -65,7 +66,7 @@
</where>
</sql>
<sql id="Base_Column_List">
class_name, create_time, school_name
class_id, class_name, create_time, school_name
</sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample" resultMap="BaseResultMap">
select
@ -85,11 +86,11 @@
select
<include refid="Base_Column_List" />
from stu_class
where class_name = #{className,jdbcType=VARCHAR}
where class_id = #{classId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_class
where class_name = #{className,jdbcType=VARCHAR}
where class_id = #{classId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample">
delete from stu_class
@ -98,14 +99,17 @@
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
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>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
insert into stu_class
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="classId != null">
class_id,
</if>
<if test="className != null">
class_name,
</if>
@ -117,6 +121,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
@ -137,6 +144,9 @@
<update id="updateByExampleSelective" parameterType="map">
update stu_class
<set>
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
@ -153,7 +163,8 @@
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
@ -163,6 +174,9 @@
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
update stu_class
<set>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
@ -170,12 +184,13 @@
school_name = #{schoolName,jdbcType=VARCHAR},
</if>
</set>
where class_name = #{className,jdbcType=VARCHAR}
where class_id = #{classId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
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}
</update>
</mapper>

File diff suppressed because it is too large Load Diff

@ -6,7 +6,7 @@
<result column="exam_name" jdbcType="VARCHAR" property="examName" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="class_name" jdbcType="VARCHAR" property="className" />
<result column="class_id" jdbcType="VARCHAR" property="classId" />
<result column="logo_address" jdbcType="VARCHAR" property="logoAddress" />
<result column="exam_Description" jdbcType="VARCHAR" property="examDescription" />
<result column="Objective_weight" jdbcType="DECIMAL" property="objectiveWeight" />
@ -84,7 +84,7 @@
</where>
</sql>
<sql id="Base_Column_List">
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
</sql>
<sql id="Blob_Column_List">
@ -141,14 +141,14 @@
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.TeaExamManageWithBLOBs">
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 @@
<if test="endTime != null">
end_time,
</if>
<if test="className != null">
class_name,
<if test="classId != null">
class_id,
</if>
<if test="logoAddress != null">
logo_address,
@ -232,8 +232,8 @@
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="className != null">
#{className,jdbcType=VARCHAR},
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="logoAddress != null">
#{logoAddress,jdbcType=VARCHAR},
@ -303,8 +303,8 @@
<if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=TIMESTAMP},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.logoAddress != null">
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 @@
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="logoAddress != null">
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},

Loading…
Cancel
Save