Browse Source

脑力测评

master
zhizhi wu 4 years ago
parent
commit
01ceaa50eb
  1. 6
      pom.xml
  2. 47
      src/main/java/com/ccsens/yanyuan/api/MentalTestController.java
  3. 56
      src/main/java/com/ccsens/yanyuan/api/QuestionController.java
  4. 10
      src/main/java/com/ccsens/yanyuan/api/ToolController.java
  5. 10
      src/main/java/com/ccsens/yanyuan/api/TraineeController.java
  6. 5
      src/main/java/com/ccsens/yanyuan/bean/dto/FamilyDto.java
  7. 26
      src/main/java/com/ccsens/yanyuan/bean/dto/MentalTestDto.java
  8. 44
      src/main/java/com/ccsens/yanyuan/bean/dto/QuestionDto.java
  9. 7
      src/main/java/com/ccsens/yanyuan/bean/dto/ToolDto.java
  10. 6
      src/main/java/com/ccsens/yanyuan/bean/dto/TraineeDto.java
  11. 117
      src/main/java/com/ccsens/yanyuan/bean/po/EvaluationNum.java
  12. 761
      src/main/java/com/ccsens/yanyuan/bean/po/EvaluationNumExample.java
  13. 23
      src/main/java/com/ccsens/yanyuan/bean/po/EvaluationOption.java
  14. 108
      src/main/java/com/ccsens/yanyuan/bean/po/EvaluationOptionExample.java
  15. 35
      src/main/java/com/ccsens/yanyuan/bean/po/EvaluationQuestion.java
  16. 166
      src/main/java/com/ccsens/yanyuan/bean/po/EvaluationQuestionExample.java
  17. 12
      src/main/java/com/ccsens/yanyuan/bean/po/MentalQuestion.java
  18. 48
      src/main/java/com/ccsens/yanyuan/bean/po/MentalQuestionExample.java
  19. 23
      src/main/java/com/ccsens/yanyuan/bean/po/MentalRecord.java
  20. 118
      src/main/java/com/ccsens/yanyuan/bean/po/MentalRecordExample.java
  21. 6
      src/main/java/com/ccsens/yanyuan/bean/po/MentalTest.java
  22. 20
      src/main/java/com/ccsens/yanyuan/bean/po/MentalTestExample.java
  23. 22
      src/main/java/com/ccsens/yanyuan/bean/po/Tool.java
  24. 130
      src/main/java/com/ccsens/yanyuan/bean/po/ToolExample.java
  25. 44
      src/main/java/com/ccsens/yanyuan/bean/vo/MentalTestVo.java
  26. 83
      src/main/java/com/ccsens/yanyuan/bean/vo/QuestionVo.java
  27. 13
      src/main/java/com/ccsens/yanyuan/bean/vo/ToolVo.java
  28. 8
      src/main/java/com/ccsens/yanyuan/bean/vo/TraineeVo.java
  29. 12
      src/main/java/com/ccsens/yanyuan/config/BeanConfig.java
  30. 44
      src/main/java/com/ccsens/yanyuan/mq/MentalTestGenerateReceive.java
  31. 51
      src/main/java/com/ccsens/yanyuan/mq/MentalTestReceive.java
  32. 28
      src/main/java/com/ccsens/yanyuan/persist/dao/EvaluationNumDao.java
  33. 3
      src/main/java/com/ccsens/yanyuan/persist/dao/FamilyDao.java
  34. 20
      src/main/java/com/ccsens/yanyuan/persist/dao/MentalQuestionDao.java
  35. 45
      src/main/java/com/ccsens/yanyuan/persist/dao/MentalTestDao.java
  36. 5
      src/main/java/com/ccsens/yanyuan/persist/dao/TraineeDao.java
  37. 30
      src/main/java/com/ccsens/yanyuan/persist/mapper/EvaluationNumMapper.java
  38. 48
      src/main/java/com/ccsens/yanyuan/service/FamilyService.java
  39. 34
      src/main/java/com/ccsens/yanyuan/service/IMentalTestService.java
  40. 24
      src/main/java/com/ccsens/yanyuan/service/IQuestionService.java
  41. 8
      src/main/java/com/ccsens/yanyuan/service/IToolService.java
  42. 7
      src/main/java/com/ccsens/yanyuan/service/ITraineeService.java
  43. 137
      src/main/java/com/ccsens/yanyuan/service/MentalTestService.java
  44. 111
      src/main/java/com/ccsens/yanyuan/service/QuestionService.java
  45. 36
      src/main/java/com/ccsens/yanyuan/service/ToolService.java
  46. 76
      src/main/java/com/ccsens/yanyuan/service/TraineeService.java
  47. 32
      src/main/java/com/ccsens/yanyuan/util/YanYuanConstant.java
  48. 4
      src/main/resources/application-common.yml
  49. 4
      src/main/resources/application-test.yml
  50. 115
      src/main/resources/mapper_dao/EvaluationNumDao.xml
  51. 11
      src/main/resources/mapper_dao/MentalQuestionDao.xml
  52. 98
      src/main/resources/mapper_dao/MentalTestDao.xml
  53. 2
      src/main/resources/mapper_dao/TraineeDao.xml
  54. 275
      src/main/resources/mapper_raw/EvaluationNumMapper.xml
  55. 59
      src/main/resources/mapper_raw/EvaluationOptionMapper.xml
  56. 81
      src/main/resources/mapper_raw/EvaluationQuestionMapper.xml
  57. 28
      src/main/resources/mapper_raw/MentalQuestionMapper.xml
  58. 56
      src/main/resources/mapper_raw/MentalRecordMapper.xml
  59. 14
      src/main/resources/mapper_raw/MentalTestMapper.xml
  60. 45
      src/main/resources/mapper_raw/ToolMapper.xml
  61. 15
      src/main/resources/mbg.xml

6
pom.xml

@ -41,7 +41,11 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<artifactId>wechatutil</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>

47
src/main/java/com/ccsens/yanyuan/api/MentalTestController.java

@ -0,0 +1,47 @@
package com.ccsens.yanyuan.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.yanyuan.bean.dto.MentalTestDto;
import com.ccsens.yanyuan.bean.dto.QuestionDto;
import com.ccsens.yanyuan.bean.vo.MentalTestVo;
import com.ccsens.yanyuan.bean.vo.QuestionVo;
import com.ccsens.yanyuan.service.IMentalTestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @description:
* @author: whj
* @time: 2021/11/10 16:37
*/
@Api(tags = "脑力测评" )
@Slf4j
@RestController
@RequestMapping(value = "/mentalTest")
public class MentalTestController {
@Resource
private IMentalTestService mentalTestService;
@MustLogin
@ApiOperation(value = "脑力测评结果计算", notes = "脑力测评结果计算")
@RequestMapping(value = "/calculate", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<MentalTestVo.Result> calculate(@ApiParam @Validated @RequestBody QueryDto<MentalTestDto.Id> params) throws Exception{
log.info("脑力测评结果计算:{}",params);
MentalTestVo.Result message = mentalTestService.calculate(params.getParam(), params.getUserId());
log.info("脑力测评结果计算结束{}", message);
return JsonResponse.newInstance().ok(message);
}
}

56
src/main/java/com/ccsens/yanyuan/api/QuestionController.java

@ -0,0 +1,56 @@
package com.ccsens.yanyuan.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.yanyuan.bean.dto.QuestionDto;
import com.ccsens.yanyuan.bean.vo.QuestionVo;
import com.ccsens.yanyuan.service.IQuestionService;
import com.ccsens.yanyuan.util.YanYuanCodeError;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @description: 试题
* @author: whj
* @time: 2021/11/11 17:27
*/
@Api(tags = "测评" )
@Slf4j
@RestController
@RequestMapping(value = "/question")
public class QuestionController {
@Resource
private IQuestionService questionService;
@MustLogin
@ApiOperation(value = "试题查询", notes = "试题查询")
@RequestMapping(value = "/get", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<QuestionVo.QuestionMessage> get(@ApiParam @Validated @RequestBody QueryDto<QuestionDto.Get> params) throws Exception{
log.info("试题查询:{}",params);
QuestionVo.QuestionMessage message = questionService.get(params.getParam(), params.getUserId());
log.info("试题查询结束{}", message);
return JsonResponse.newInstance().ok(message);
}
@MustLogin
@ApiOperation(value = "试题答案保存", notes = "试题答案保存")
@RequestMapping(value = "/saveAnswer", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse saveAnswer(@ApiParam @Validated @RequestBody QueryDto<QuestionDto.SaveAnswer> params) throws Exception{
log.info("试题答案保存:{}",params);
questionService.saveAnswer(params.getParam(), params.getUserId());
log.info("试题答案保存结束");
return JsonResponse.newInstance().ok();
}
}

10
src/main/java/com/ccsens/yanyuan/api/ToolController.java

@ -42,4 +42,14 @@ public class ToolController {
return JsonResponse.newInstance().ok(bindTool);
}
@MustLogin
@ApiOperation(value = "查询指定工具箱二维码", notes = "查询指定工具箱二维码")
@RequestMapping(value = "/qrCode", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ToolVo.QrCode> qrCode(@ApiParam @Validated @RequestBody QueryDto<ToolDto.QrCode> params) throws Exception{
log.info("查询指定工具箱二维码:{}",params);
ToolVo.QrCode qrCode = toolService.generateQrCode(params.getParam(), params.getUserId());
log.info("查询指定工具箱二维码结束{}",qrCode);
return JsonResponse.newInstance().ok(qrCode);
}
}

10
src/main/java/com/ccsens/yanyuan/api/TraineeController.java

@ -48,9 +48,9 @@ public class TraineeController {
@MustLogin
@ApiOperation(value = "绑定手机号后,关联用户原有的使用者", notes = "该接口仅在前期使用,待旧版小程序停止,且用户全部迁移后,将不再调用改接口")
@RequestMapping(value = "/relation", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse relation(@ApiParam @Validated @RequestBody QueryDto<TraineeDto.Relation> params) throws Exception{
public JsonResponse relation(@ApiParam @Validated @RequestBody QueryDto params) throws Exception{
log.info("关联用户原有的使用者:{}",params);
CodeError.Code code = traineeService.bindOldTrainee(params.getParam(), params.getUserId());
CodeError.Code code = traineeService.bindOldTrainee(params.getPhone(), params.getUserId());
log.info("关联用户原有的使用者结束: {}",code);
return JsonResponse.newInstance().ok(code);
}
@ -80,8 +80,8 @@ public class TraineeController {
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse add(@ApiParam @Validated @RequestBody QueryDto<TraineeDto.User> params) throws Exception{
log.info("填写用户信息:{}",params);
JsonResponse response = traineeService.add(params.getParam(), params.getPhone(), params.getUserId());
log.info("填写用户信息结果: {}",response);
return response;
CodeError.Code code = traineeService.add(params.getParam(), params.getPhone(), params.getUserId());
log.info("填写用户信息结果: {}",code);
return JsonResponse.newInstance().ok(code);
}
}

5
src/main/java/com/ccsens/yanyuan/bean/dto/FamilyDto.java

@ -7,6 +7,7 @@ import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @description:
@ -16,10 +17,10 @@ import javax.validation.constraints.NotNull;
public class FamilyDto {
@Data
@ApiModel("申请成为家属-请求")
public class Apply {
public static class Apply {
@NotNull
@ApiModelProperty("使用者userId")
private Long keyUserId;
private List<Long> keyUserIds;
@ApiModelProperty("家属姓名")
private String name;
@ApiModelProperty("家属性别 1:男 2:女")

26
src/main/java/com/ccsens/yanyuan/bean/dto/MentalTestDto.java

@ -0,0 +1,26 @@
package com.ccsens.yanyuan.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: 脑力测评-请求
* @author: whj
* @time: 2021/11/10 16:48
*/
public class MentalTestDto {
@Data
@ApiModel("为某个用户生成脑力测评")
public static class GenerateOne{
@ApiModelProperty("使用者ID")
private Long keyUserId;
}
@Data
@ApiModel("测评报告ID")
public static class Id {
@ApiModelProperty("脑力测评ID")
private Long mentalTestId;
}
}

44
src/main/java/com/ccsens/yanyuan/bean/dto/QuestionDto.java

@ -0,0 +1,44 @@
package com.ccsens.yanyuan.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* @description: 试题
* @author: whj
* @time: 2021/11/11 17:37
*/
public class QuestionDto {
@ApiModel("查询试题-请求")
@Data
public static class Get {
@NotEmpty
@ApiModelProperty("题目code NLCP:脑力测评 ZARIT:照顾者负担量表")
private String code;
@NotNull
@ApiModelProperty("测评ID 脑力测评ID或zaritID")
private Long reportId;
@ApiModelProperty("题号")
private int num;
}
@ApiModel("保存试题答案-请求")
@Data
public static class SaveAnswer {
@NotEmpty
@ApiModelProperty("题目code NLCP:脑力测评 ZARIT:照顾者负担量表")
private String code;
@NotNull
@ApiModelProperty("测评ID 脑力测评ID或zaritID")
private Long reportId;
@NotNull
@ApiModelProperty("题目ID")
private Long questionId;
@NotNull
@ApiModelProperty("选项ID")
private Long optionId;
}
}

7
src/main/java/com/ccsens/yanyuan/bean/dto/ToolDto.java

@ -15,4 +15,11 @@ public class ToolDto {
@ApiModelProperty("工具箱code码")
private String toolCode;
}
@Data
@ApiModel("工具箱二维码-请求")
public static class QrCode {
@ApiModelProperty("工具箱ID")
private Long id;
}
}

6
src/main/java/com/ccsens/yanyuan/bean/dto/TraineeDto.java

@ -1,5 +1,6 @@
package com.ccsens.yanyuan.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -62,6 +63,7 @@ public class TraineeDto {
@ApiModelProperty("就诊医生")
private String clinicDoctor;
@ApiModelProperty("出生年月")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthDate;
@ApiModelProperty("身高")
private String height;
@ -76,8 +78,10 @@ public class TraineeDto {
@ApiModelProperty("长期居住地")
private String abodePlace;
@ApiModelProperty("出现认知障碍时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date appearTime;
@ApiModelProperty("首次诊断痴呆时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date diagnoseTime;
@ApiModelProperty("诊断")
private String diagnoseResult;
@ -97,7 +101,7 @@ public class TraineeDto {
private String relativeDiseasesRecord;
@ApiModelProperty("是否失眠: 0 不 1 是")
private Byte isInsomnic;
@ApiModelProperty("每天平均眠时间")
@ApiModelProperty("每天平均眠时间")
private String insomnicPeriod;
@ApiModelProperty("是否吸烟 0 不 1 吸烟已戒 2 吸烟未戒")
private Byte isSmoke;

117
src/main/java/com/ccsens/yanyuan/bean/po/EvaluationNum.java

@ -0,0 +1,117 @@
package com.ccsens.yanyuan.bean.po;
import java.io.Serializable;
import java.util.Date;
public class EvaluationNum implements Serializable {
private Long id;
private String code;
private Integer num;
private Integer sort;
private String remark;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", code=").append(code);
sb.append(", num=").append(num);
sb.append(", sort=").append(sort);
sb.append(", remark=").append(remark);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

761
src/main/java/com/ccsens/yanyuan/bean/po/EvaluationNumExample.java

@ -0,0 +1,761 @@
package com.ccsens.yanyuan.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class EvaluationNumExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public EvaluationNumExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCodeIsNull() {
addCriterion("code is null");
return (Criteria) this;
}
public Criteria andCodeIsNotNull() {
addCriterion("code is not null");
return (Criteria) this;
}
public Criteria andCodeEqualTo(String value) {
addCriterion("code =", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotEqualTo(String value) {
addCriterion("code <>", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThan(String value) {
addCriterion("code >", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("code >=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThan(String value) {
addCriterion("code <", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("code <=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLike(String value) {
addCriterion("code like", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotLike(String value) {
addCriterion("code not like", value, "code");
return (Criteria) this;
}
public Criteria andCodeIn(List<String> values) {
addCriterion("code in", values, "code");
return (Criteria) this;
}
public Criteria andCodeNotIn(List<String> values) {
addCriterion("code not in", values, "code");
return (Criteria) this;
}
public Criteria andCodeBetween(String value1, String value2) {
addCriterion("code between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("code not between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andNumIsNull() {
addCriterion("num is null");
return (Criteria) this;
}
public Criteria andNumIsNotNull() {
addCriterion("num is not null");
return (Criteria) this;
}
public Criteria andNumEqualTo(Integer value) {
addCriterion("num =", value, "num");
return (Criteria) this;
}
public Criteria andNumNotEqualTo(Integer value) {
addCriterion("num <>", value, "num");
return (Criteria) this;
}
public Criteria andNumGreaterThan(Integer value) {
addCriterion("num >", value, "num");
return (Criteria) this;
}
public Criteria andNumGreaterThanOrEqualTo(Integer value) {
addCriterion("num >=", value, "num");
return (Criteria) this;
}
public Criteria andNumLessThan(Integer value) {
addCriterion("num <", value, "num");
return (Criteria) this;
}
public Criteria andNumLessThanOrEqualTo(Integer value) {
addCriterion("num <=", value, "num");
return (Criteria) this;
}
public Criteria andNumIn(List<Integer> values) {
addCriterion("num in", values, "num");
return (Criteria) this;
}
public Criteria andNumNotIn(List<Integer> values) {
addCriterion("num not in", values, "num");
return (Criteria) this;
}
public Criteria andNumBetween(Integer value1, Integer value2) {
addCriterion("num between", value1, value2, "num");
return (Criteria) this;
}
public Criteria andNumNotBetween(Integer value1, Integer value2) {
addCriterion("num not between", value1, value2, "num");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
}
public Criteria andSortIsNotNull() {
addCriterion("sort is not null");
return (Criteria) this;
}
public Criteria andSortEqualTo(Integer value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotEqualTo(Integer value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThan(Integer value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThan(Integer value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
public Criteria andSortIn(List<Integer> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<Integer> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

23
src/main/java/com/ccsens/yanyuan/bean/po/EvaluationOption.java

@ -6,7 +6,7 @@ import java.util.Date;
public class EvaluationOption implements Serializable {
private Long id;
private Long questionId;
private Long numId;
private String content;
@ -20,8 +20,6 @@ public class EvaluationOption implements Serializable {
private Byte col;
private Byte positon;
private Integer sort;
private String remark;
@ -44,12 +42,12 @@ public class EvaluationOption implements Serializable {
this.id = id;
}
public Long getQuestionId() {
return questionId;
public Long getNumId() {
return numId;
}
public void setQuestionId(Long questionId) {
this.questionId = questionId;
public void setNumId(Long numId) {
this.numId = numId;
}
public String getContent() {
@ -100,14 +98,6 @@ public class EvaluationOption implements Serializable {
this.col = col;
}
public Byte getPositon() {
return positon;
}
public void setPositon(Byte positon) {
this.positon = positon;
}
public Integer getSort() {
return sort;
}
@ -163,14 +153,13 @@ public class EvaluationOption implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", questionId=").append(questionId);
sb.append(", numId=").append(numId);
sb.append(", content=").append(content);
sb.append(", score=").append(score);
sb.append(", page=").append(page);
sb.append(", showType=").append(showType);
sb.append(", row=").append(row);
sb.append(", col=").append(col);
sb.append(", positon=").append(positon);
sb.append(", sort=").append(sort);
sb.append(", remark=").append(remark);
sb.append(", operator=").append(operator);

108
src/main/java/com/ccsens/yanyuan/bean/po/EvaluationOptionExample.java

@ -165,63 +165,63 @@ public class EvaluationOptionExample {
return (Criteria) this;
}
public Criteria andQuestionIdIsNull() {
addCriterion("question_id is null");
public Criteria andNumIdIsNull() {
addCriterion("num_id is null");
return (Criteria) this;
}
public Criteria andQuestionIdIsNotNull() {
addCriterion("question_id is not null");
public Criteria andNumIdIsNotNull() {
addCriterion("num_id is not null");
return (Criteria) this;
}
public Criteria andQuestionIdEqualTo(Long value) {
addCriterion("question_id =", value, "questionId");
public Criteria andNumIdEqualTo(Long value) {
addCriterion("num_id =", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotEqualTo(Long value) {
addCriterion("question_id <>", value, "questionId");
public Criteria andNumIdNotEqualTo(Long value) {
addCriterion("num_id <>", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThan(Long value) {
addCriterion("question_id >", value, "questionId");
public Criteria andNumIdGreaterThan(Long value) {
addCriterion("num_id >", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThanOrEqualTo(Long value) {
addCriterion("question_id >=", value, "questionId");
public Criteria andNumIdGreaterThanOrEqualTo(Long value) {
addCriterion("num_id >=", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThan(Long value) {
addCriterion("question_id <", value, "questionId");
public Criteria andNumIdLessThan(Long value) {
addCriterion("num_id <", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThanOrEqualTo(Long value) {
addCriterion("question_id <=", value, "questionId");
public Criteria andNumIdLessThanOrEqualTo(Long value) {
addCriterion("num_id <=", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdIn(List<Long> values) {
addCriterion("question_id in", values, "questionId");
public Criteria andNumIdIn(List<Long> values) {
addCriterion("num_id in", values, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotIn(List<Long> values) {
addCriterion("question_id not in", values, "questionId");
public Criteria andNumIdNotIn(List<Long> values) {
addCriterion("num_id not in", values, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdBetween(Long value1, Long value2) {
addCriterion("question_id between", value1, value2, "questionId");
public Criteria andNumIdBetween(Long value1, Long value2) {
addCriterion("num_id between", value1, value2, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotBetween(Long value1, Long value2) {
addCriterion("question_id not between", value1, value2, "questionId");
public Criteria andNumIdNotBetween(Long value1, Long value2) {
addCriterion("num_id not between", value1, value2, "numId");
return (Criteria) this;
}
@ -595,66 +595,6 @@ public class EvaluationOptionExample {
return (Criteria) this;
}
public Criteria andPositonIsNull() {
addCriterion("positon is null");
return (Criteria) this;
}
public Criteria andPositonIsNotNull() {
addCriterion("positon is not null");
return (Criteria) this;
}
public Criteria andPositonEqualTo(Byte value) {
addCriterion("positon =", value, "positon");
return (Criteria) this;
}
public Criteria andPositonNotEqualTo(Byte value) {
addCriterion("positon <>", value, "positon");
return (Criteria) this;
}
public Criteria andPositonGreaterThan(Byte value) {
addCriterion("positon >", value, "positon");
return (Criteria) this;
}
public Criteria andPositonGreaterThanOrEqualTo(Byte value) {
addCriterion("positon >=", value, "positon");
return (Criteria) this;
}
public Criteria andPositonLessThan(Byte value) {
addCriterion("positon <", value, "positon");
return (Criteria) this;
}
public Criteria andPositonLessThanOrEqualTo(Byte value) {
addCriterion("positon <=", value, "positon");
return (Criteria) this;
}
public Criteria andPositonIn(List<Byte> values) {
addCriterion("positon in", values, "positon");
return (Criteria) this;
}
public Criteria andPositonNotIn(List<Byte> values) {
addCriterion("positon not in", values, "positon");
return (Criteria) this;
}
public Criteria andPositonBetween(Byte value1, Byte value2) {
addCriterion("positon between", value1, value2, "positon");
return (Criteria) this;
}
public Criteria andPositonNotBetween(Byte value1, Byte value2) {
addCriterion("positon not between", value1, value2, "positon");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;

35
src/main/java/com/ccsens/yanyuan/bean/po/EvaluationQuestion.java

@ -6,9 +6,7 @@ import java.util.Date;
public class EvaluationQuestion implements Serializable {
private Long id;
private String code;
private Integer num;
private Long numId;
private String content;
@ -16,7 +14,7 @@ public class EvaluationQuestion implements Serializable {
private Byte page;
private Byte positon;
private Byte position;
private Integer sort;
@ -40,20 +38,12 @@ public class EvaluationQuestion implements Serializable {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public Integer getNum() {
return num;
public Long getNumId() {
return numId;
}
public void setNum(Integer num) {
this.num = num;
public void setNumId(Long numId) {
this.numId = numId;
}
public String getContent() {
@ -80,12 +70,12 @@ public class EvaluationQuestion implements Serializable {
this.page = page;
}
public Byte getPositon() {
return positon;
public Byte getPosition() {
return position;
}
public void setPositon(Byte positon) {
this.positon = positon;
public void setPosition(Byte position) {
this.position = position;
}
public Integer getSort() {
@ -143,12 +133,11 @@ public class EvaluationQuestion implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", code=").append(code);
sb.append(", num=").append(num);
sb.append(", numId=").append(numId);
sb.append(", content=").append(content);
sb.append(", showType=").append(showType);
sb.append(", page=").append(page);
sb.append(", positon=").append(positon);
sb.append(", position=").append(position);
sb.append(", sort=").append(sort);
sb.append(", remark=").append(remark);
sb.append(", operator=").append(operator);

166
src/main/java/com/ccsens/yanyuan/bean/po/EvaluationQuestionExample.java

@ -165,133 +165,63 @@ public class EvaluationQuestionExample {
return (Criteria) this;
}
public Criteria andCodeIsNull() {
addCriterion("code is null");
public Criteria andNumIdIsNull() {
addCriterion("num_id is null");
return (Criteria) this;
}
public Criteria andCodeIsNotNull() {
addCriterion("code is not null");
public Criteria andNumIdIsNotNull() {
addCriterion("num_id is not null");
return (Criteria) this;
}
public Criteria andCodeEqualTo(String value) {
addCriterion("code =", value, "code");
public Criteria andNumIdEqualTo(Long value) {
addCriterion("num_id =", value, "numId");
return (Criteria) this;
}
public Criteria andCodeNotEqualTo(String value) {
addCriterion("code <>", value, "code");
public Criteria andNumIdNotEqualTo(Long value) {
addCriterion("num_id <>", value, "numId");
return (Criteria) this;
}
public Criteria andCodeGreaterThan(String value) {
addCriterion("code >", value, "code");
public Criteria andNumIdGreaterThan(Long value) {
addCriterion("num_id >", value, "numId");
return (Criteria) this;
}
public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("code >=", value, "code");
public Criteria andNumIdGreaterThanOrEqualTo(Long value) {
addCriterion("num_id >=", value, "numId");
return (Criteria) this;
}
public Criteria andCodeLessThan(String value) {
addCriterion("code <", value, "code");
public Criteria andNumIdLessThan(Long value) {
addCriterion("num_id <", value, "numId");
return (Criteria) this;
}
public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("code <=", value, "code");
public Criteria andNumIdLessThanOrEqualTo(Long value) {
addCriterion("num_id <=", value, "numId");
return (Criteria) this;
}
public Criteria andCodeLike(String value) {
addCriterion("code like", value, "code");
public Criteria andNumIdIn(List<Long> values) {
addCriterion("num_id in", values, "numId");
return (Criteria) this;
}
public Criteria andCodeNotLike(String value) {
addCriterion("code not like", value, "code");
public Criteria andNumIdNotIn(List<Long> values) {
addCriterion("num_id not in", values, "numId");
return (Criteria) this;
}
public Criteria andCodeIn(List<String> values) {
addCriterion("code in", values, "code");
public Criteria andNumIdBetween(Long value1, Long value2) {
addCriterion("num_id between", value1, value2, "numId");
return (Criteria) this;
}
public Criteria andCodeNotIn(List<String> values) {
addCriterion("code not in", values, "code");
return (Criteria) this;
}
public Criteria andCodeBetween(String value1, String value2) {
addCriterion("code between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("code not between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andNumIsNull() {
addCriterion("num is null");
return (Criteria) this;
}
public Criteria andNumIsNotNull() {
addCriterion("num is not null");
return (Criteria) this;
}
public Criteria andNumEqualTo(Integer value) {
addCriterion("num =", value, "num");
return (Criteria) this;
}
public Criteria andNumNotEqualTo(Integer value) {
addCriterion("num <>", value, "num");
return (Criteria) this;
}
public Criteria andNumGreaterThan(Integer value) {
addCriterion("num >", value, "num");
return (Criteria) this;
}
public Criteria andNumGreaterThanOrEqualTo(Integer value) {
addCriterion("num >=", value, "num");
return (Criteria) this;
}
public Criteria andNumLessThan(Integer value) {
addCriterion("num <", value, "num");
return (Criteria) this;
}
public Criteria andNumLessThanOrEqualTo(Integer value) {
addCriterion("num <=", value, "num");
return (Criteria) this;
}
public Criteria andNumIn(List<Integer> values) {
addCriterion("num in", values, "num");
return (Criteria) this;
}
public Criteria andNumNotIn(List<Integer> values) {
addCriterion("num not in", values, "num");
return (Criteria) this;
}
public Criteria andNumBetween(Integer value1, Integer value2) {
addCriterion("num between", value1, value2, "num");
return (Criteria) this;
}
public Criteria andNumNotBetween(Integer value1, Integer value2) {
addCriterion("num not between", value1, value2, "num");
public Criteria andNumIdNotBetween(Long value1, Long value2) {
addCriterion("num_id not between", value1, value2, "numId");
return (Criteria) this;
}
@ -485,63 +415,63 @@ public class EvaluationQuestionExample {
return (Criteria) this;
}
public Criteria andPositonIsNull() {
addCriterion("positon is null");
public Criteria andPositionIsNull() {
addCriterion("position is null");
return (Criteria) this;
}
public Criteria andPositonIsNotNull() {
addCriterion("positon is not null");
public Criteria andPositionIsNotNull() {
addCriterion("position is not null");
return (Criteria) this;
}
public Criteria andPositonEqualTo(Byte value) {
addCriterion("positon =", value, "positon");
public Criteria andPositionEqualTo(Byte value) {
addCriterion("position =", value, "position");
return (Criteria) this;
}
public Criteria andPositonNotEqualTo(Byte value) {
addCriterion("positon <>", value, "positon");
public Criteria andPositionNotEqualTo(Byte value) {
addCriterion("position <>", value, "position");
return (Criteria) this;
}
public Criteria andPositonGreaterThan(Byte value) {
addCriterion("positon >", value, "positon");
public Criteria andPositionGreaterThan(Byte value) {
addCriterion("position >", value, "position");
return (Criteria) this;
}
public Criteria andPositonGreaterThanOrEqualTo(Byte value) {
addCriterion("positon >=", value, "positon");
public Criteria andPositionGreaterThanOrEqualTo(Byte value) {
addCriterion("position >=", value, "position");
return (Criteria) this;
}
public Criteria andPositonLessThan(Byte value) {
addCriterion("positon <", value, "positon");
public Criteria andPositionLessThan(Byte value) {
addCriterion("position <", value, "position");
return (Criteria) this;
}
public Criteria andPositonLessThanOrEqualTo(Byte value) {
addCriterion("positon <=", value, "positon");
public Criteria andPositionLessThanOrEqualTo(Byte value) {
addCriterion("position <=", value, "position");
return (Criteria) this;
}
public Criteria andPositonIn(List<Byte> values) {
addCriterion("positon in", values, "positon");
public Criteria andPositionIn(List<Byte> values) {
addCriterion("position in", values, "position");
return (Criteria) this;
}
public Criteria andPositonNotIn(List<Byte> values) {
addCriterion("positon not in", values, "positon");
public Criteria andPositionNotIn(List<Byte> values) {
addCriterion("position not in", values, "position");
return (Criteria) this;
}
public Criteria andPositonBetween(Byte value1, Byte value2) {
addCriterion("positon between", value1, value2, "positon");
public Criteria andPositionBetween(Byte value1, Byte value2) {
addCriterion("position between", value1, value2, "position");
return (Criteria) this;
}
public Criteria andPositonNotBetween(Byte value1, Byte value2) {
addCriterion("positon not between", value1, value2, "positon");
public Criteria andPositionNotBetween(Byte value1, Byte value2) {
addCriterion("position not between", value1, value2, "position");
return (Criteria) this;
}

12
src/main/java/com/ccsens/yanyuan/bean/po/MentalQuestion.java

@ -8,7 +8,7 @@ public class MentalQuestion implements Serializable {
private Long mentalTestId;
private Long questionId;
private Long numId;
private String remark;
@ -38,12 +38,12 @@ public class MentalQuestion implements Serializable {
this.mentalTestId = mentalTestId;
}
public Long getQuestionId() {
return questionId;
public Long getNumId() {
return numId;
}
public void setQuestionId(Long questionId) {
this.questionId = questionId;
public void setNumId(Long numId) {
this.numId = numId;
}
public String getRemark() {
@ -94,7 +94,7 @@ public class MentalQuestion implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", mentalTestId=").append(mentalTestId);
sb.append(", questionId=").append(questionId);
sb.append(", numId=").append(numId);
sb.append(", remark=").append(remark);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);

48
src/main/java/com/ccsens/yanyuan/bean/po/MentalQuestionExample.java

@ -225,63 +225,63 @@ public class MentalQuestionExample {
return (Criteria) this;
}
public Criteria andQuestionIdIsNull() {
addCriterion("question_id is null");
public Criteria andNumIdIsNull() {
addCriterion("num_id is null");
return (Criteria) this;
}
public Criteria andQuestionIdIsNotNull() {
addCriterion("question_id is not null");
public Criteria andNumIdIsNotNull() {
addCriterion("num_id is not null");
return (Criteria) this;
}
public Criteria andQuestionIdEqualTo(Long value) {
addCriterion("question_id =", value, "questionId");
public Criteria andNumIdEqualTo(Long value) {
addCriterion("num_id =", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotEqualTo(Long value) {
addCriterion("question_id <>", value, "questionId");
public Criteria andNumIdNotEqualTo(Long value) {
addCriterion("num_id <>", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThan(Long value) {
addCriterion("question_id >", value, "questionId");
public Criteria andNumIdGreaterThan(Long value) {
addCriterion("num_id >", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThanOrEqualTo(Long value) {
addCriterion("question_id >=", value, "questionId");
public Criteria andNumIdGreaterThanOrEqualTo(Long value) {
addCriterion("num_id >=", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThan(Long value) {
addCriterion("question_id <", value, "questionId");
public Criteria andNumIdLessThan(Long value) {
addCriterion("num_id <", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThanOrEqualTo(Long value) {
addCriterion("question_id <=", value, "questionId");
public Criteria andNumIdLessThanOrEqualTo(Long value) {
addCriterion("num_id <=", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdIn(List<Long> values) {
addCriterion("question_id in", values, "questionId");
public Criteria andNumIdIn(List<Long> values) {
addCriterion("num_id in", values, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotIn(List<Long> values) {
addCriterion("question_id not in", values, "questionId");
public Criteria andNumIdNotIn(List<Long> values) {
addCriterion("num_id not in", values, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdBetween(Long value1, Long value2) {
addCriterion("question_id between", value1, value2, "questionId");
public Criteria andNumIdBetween(Long value1, Long value2) {
addCriterion("num_id between", value1, value2, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotBetween(Long value1, Long value2) {
addCriterion("question_id not between", value1, value2, "questionId");
public Criteria andNumIdNotBetween(Long value1, Long value2) {
addCriterion("num_id not between", value1, value2, "numId");
return (Criteria) this;
}

23
src/main/java/com/ccsens/yanyuan/bean/po/MentalRecord.java

@ -8,12 +8,10 @@ public class MentalRecord implements Serializable {
private Long testId;
private Long questionId;
private Long numId;
private Long optionId;
private String code;
private String remark;
private Long operator;
@ -42,12 +40,12 @@ public class MentalRecord implements Serializable {
this.testId = testId;
}
public Long getQuestionId() {
return questionId;
public Long getNumId() {
return numId;
}
public void setQuestionId(Long questionId) {
this.questionId = questionId;
public void setNumId(Long numId) {
this.numId = numId;
}
public Long getOptionId() {
@ -58,14 +56,6 @@ public class MentalRecord implements Serializable {
this.optionId = optionId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public String getRemark() {
return remark;
}
@ -114,9 +104,8 @@ public class MentalRecord implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", testId=").append(testId);
sb.append(", questionId=").append(questionId);
sb.append(", numId=").append(numId);
sb.append(", optionId=").append(optionId);
sb.append(", code=").append(code);
sb.append(", remark=").append(remark);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);

118
src/main/java/com/ccsens/yanyuan/bean/po/MentalRecordExample.java

@ -225,63 +225,63 @@ public class MentalRecordExample {
return (Criteria) this;
}
public Criteria andQuestionIdIsNull() {
addCriterion("question_id is null");
public Criteria andNumIdIsNull() {
addCriterion("num_id is null");
return (Criteria) this;
}
public Criteria andQuestionIdIsNotNull() {
addCriterion("question_id is not null");
public Criteria andNumIdIsNotNull() {
addCriterion("num_id is not null");
return (Criteria) this;
}
public Criteria andQuestionIdEqualTo(Long value) {
addCriterion("question_id =", value, "questionId");
public Criteria andNumIdEqualTo(Long value) {
addCriterion("num_id =", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotEqualTo(Long value) {
addCriterion("question_id <>", value, "questionId");
public Criteria andNumIdNotEqualTo(Long value) {
addCriterion("num_id <>", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThan(Long value) {
addCriterion("question_id >", value, "questionId");
public Criteria andNumIdGreaterThan(Long value) {
addCriterion("num_id >", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThanOrEqualTo(Long value) {
addCriterion("question_id >=", value, "questionId");
public Criteria andNumIdGreaterThanOrEqualTo(Long value) {
addCriterion("num_id >=", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThan(Long value) {
addCriterion("question_id <", value, "questionId");
public Criteria andNumIdLessThan(Long value) {
addCriterion("num_id <", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThanOrEqualTo(Long value) {
addCriterion("question_id <=", value, "questionId");
public Criteria andNumIdLessThanOrEqualTo(Long value) {
addCriterion("num_id <=", value, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdIn(List<Long> values) {
addCriterion("question_id in", values, "questionId");
public Criteria andNumIdIn(List<Long> values) {
addCriterion("num_id in", values, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotIn(List<Long> values) {
addCriterion("question_id not in", values, "questionId");
public Criteria andNumIdNotIn(List<Long> values) {
addCriterion("num_id not in", values, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdBetween(Long value1, Long value2) {
addCriterion("question_id between", value1, value2, "questionId");
public Criteria andNumIdBetween(Long value1, Long value2) {
addCriterion("num_id between", value1, value2, "numId");
return (Criteria) this;
}
public Criteria andQuestionIdNotBetween(Long value1, Long value2) {
addCriterion("question_id not between", value1, value2, "questionId");
public Criteria andNumIdNotBetween(Long value1, Long value2) {
addCriterion("num_id not between", value1, value2, "numId");
return (Criteria) this;
}
@ -345,76 +345,6 @@ public class MentalRecordExample {
return (Criteria) this;
}
public Criteria andCodeIsNull() {
addCriterion("code is null");
return (Criteria) this;
}
public Criteria andCodeIsNotNull() {
addCriterion("code is not null");
return (Criteria) this;
}
public Criteria andCodeEqualTo(String value) {
addCriterion("code =", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotEqualTo(String value) {
addCriterion("code <>", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThan(String value) {
addCriterion("code >", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("code >=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThan(String value) {
addCriterion("code <", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("code <=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLike(String value) {
addCriterion("code like", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotLike(String value) {
addCriterion("code not like", value, "code");
return (Criteria) this;
}
public Criteria andCodeIn(List<String> values) {
addCriterion("code in", values, "code");
return (Criteria) this;
}
public Criteria andCodeNotIn(List<String> values) {
addCriterion("code not in", values, "code");
return (Criteria) this;
}
public Criteria andCodeBetween(String value1, String value2) {
addCriterion("code between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("code not between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;

6
src/main/java/com/ccsens/yanyuan/bean/po/MentalTest.java

@ -13,7 +13,7 @@ public class MentalTest implements Serializable {
private String userId;
private Integer finishStatus;
private Byte finishStatus;
private BigDecimal memoryNum;
@ -81,11 +81,11 @@ public class MentalTest implements Serializable {
this.userId = userId == null ? null : userId.trim();
}
public Integer getFinishStatus() {
public Byte getFinishStatus() {
return finishStatus;
}
public void setFinishStatus(Integer finishStatus) {
public void setFinishStatus(Byte finishStatus) {
this.finishStatus = finishStatus;
}

20
src/main/java/com/ccsens/yanyuan/bean/po/MentalTestExample.java

@ -376,52 +376,52 @@ public class MentalTestExample {
return (Criteria) this;
}
public Criteria andFinishStatusEqualTo(Integer value) {
public Criteria andFinishStatusEqualTo(Byte value) {
addCriterion("finish_status =", value, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusNotEqualTo(Integer value) {
public Criteria andFinishStatusNotEqualTo(Byte value) {
addCriterion("finish_status <>", value, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusGreaterThan(Integer value) {
public Criteria andFinishStatusGreaterThan(Byte value) {
addCriterion("finish_status >", value, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusGreaterThanOrEqualTo(Integer value) {
public Criteria andFinishStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("finish_status >=", value, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusLessThan(Integer value) {
public Criteria andFinishStatusLessThan(Byte value) {
addCriterion("finish_status <", value, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusLessThanOrEqualTo(Integer value) {
public Criteria andFinishStatusLessThanOrEqualTo(Byte value) {
addCriterion("finish_status <=", value, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusIn(List<Integer> values) {
public Criteria andFinishStatusIn(List<Byte> values) {
addCriterion("finish_status in", values, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusNotIn(List<Integer> values) {
public Criteria andFinishStatusNotIn(List<Byte> values) {
addCriterion("finish_status not in", values, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusBetween(Integer value1, Integer value2) {
public Criteria andFinishStatusBetween(Byte value1, Byte value2) {
addCriterion("finish_status between", value1, value2, "finishStatus");
return (Criteria) this;
}
public Criteria andFinishStatusNotBetween(Integer value1, Integer value2) {
public Criteria andFinishStatusNotBetween(Byte value1, Byte value2) {
addCriterion("finish_status not between", value1, value2, "finishStatus");
return (Criteria) this;
}

22
src/main/java/com/ccsens/yanyuan/bean/po/Tool.java

@ -12,6 +12,10 @@ public class Tool implements Serializable {
private String description;
private Byte version;
private String url;
private Long userId;
private Long operator;
@ -56,6 +60,22 @@ public class Tool implements Serializable {
this.description = description == null ? null : description.trim();
}
public Byte getVersion() {
return version;
}
public void setVersion(Byte version) {
this.version = version;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public Long getUserId() {
return userId;
}
@ -106,6 +126,8 @@ public class Tool implements Serializable {
sb.append(", code=").append(code);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", version=").append(version);
sb.append(", url=").append(url);
sb.append(", userId=").append(userId);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);

130
src/main/java/com/ccsens/yanyuan/bean/po/ToolExample.java

@ -375,6 +375,136 @@ public class ToolExample {
return (Criteria) this;
}
public Criteria andVersionIsNull() {
addCriterion("version is null");
return (Criteria) this;
}
public Criteria andVersionIsNotNull() {
addCriterion("version is not null");
return (Criteria) this;
}
public Criteria andVersionEqualTo(Byte value) {
addCriterion("version =", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotEqualTo(Byte value) {
addCriterion("version <>", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThan(Byte value) {
addCriterion("version >", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThanOrEqualTo(Byte value) {
addCriterion("version >=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThan(Byte value) {
addCriterion("version <", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThanOrEqualTo(Byte value) {
addCriterion("version <=", value, "version");
return (Criteria) this;
}
public Criteria andVersionIn(List<Byte> values) {
addCriterion("version in", values, "version");
return (Criteria) this;
}
public Criteria andVersionNotIn(List<Byte> values) {
addCriterion("version not in", values, "version");
return (Criteria) this;
}
public Criteria andVersionBetween(Byte value1, Byte value2) {
addCriterion("version between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andVersionNotBetween(Byte value1, Byte value2) {
addCriterion("version not between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andUrlIsNull() {
addCriterion("url is null");
return (Criteria) this;
}
public Criteria andUrlIsNotNull() {
addCriterion("url is not null");
return (Criteria) this;
}
public Criteria andUrlEqualTo(String value) {
addCriterion("url =", value, "url");
return (Criteria) this;
}
public Criteria andUrlNotEqualTo(String value) {
addCriterion("url <>", value, "url");
return (Criteria) this;
}
public Criteria andUrlGreaterThan(String value) {
addCriterion("url >", value, "url");
return (Criteria) this;
}
public Criteria andUrlGreaterThanOrEqualTo(String value) {
addCriterion("url >=", value, "url");
return (Criteria) this;
}
public Criteria andUrlLessThan(String value) {
addCriterion("url <", value, "url");
return (Criteria) this;
}
public Criteria andUrlLessThanOrEqualTo(String value) {
addCriterion("url <=", value, "url");
return (Criteria) this;
}
public Criteria andUrlLike(String value) {
addCriterion("url like", value, "url");
return (Criteria) this;
}
public Criteria andUrlNotLike(String value) {
addCriterion("url not like", value, "url");
return (Criteria) this;
}
public Criteria andUrlIn(List<String> values) {
addCriterion("url in", values, "url");
return (Criteria) this;
}
public Criteria andUrlNotIn(List<String> values) {
addCriterion("url not in", values, "url");
return (Criteria) this;
}
public Criteria andUrlBetween(String value1, String value2) {
addCriterion("url between", value1, value2, "url");
return (Criteria) this;
}
public Criteria andUrlNotBetween(String value1, String value2) {
addCriterion("url not between", value1, value2, "url");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;

44
src/main/java/com/ccsens/yanyuan/bean/vo/MentalTestVo.java

@ -0,0 +1,44 @@
package com.ccsens.yanyuan.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @description: 脑力测评-响应
* @author: whj
* @time: 2021/11/10 16:50
*/
public class MentalTestVo {
@Data
@ApiModel("脑力测评ID-响应")
public static class Simple{
@ApiModelProperty("脑力测评ID")
private Long mentalTestId;
@ApiModelProperty("是否为新的脑力测评 0:原有的脑力测评 1:新生成的脑力测评")
private byte newMentalTest;
}
@Data
@ApiModel("脑力测评结果-响应")
public static class Result {
@ApiModelProperty("记忆力")
private BigDecimal memoryNum;
@ApiModelProperty("语言能力")
private BigDecimal expressNum;
@ApiModelProperty("视空间")
private BigDecimal viewNum;
@ApiModelProperty("注意力")
private BigDecimal attentionNum;
@ApiModelProperty("定向力")
private BigDecimal directionNum;
@ApiModelProperty("计算能力")
private BigDecimal countNum;
@ApiModelProperty("逻辑执行")
private BigDecimal logicNum;
@ApiModelProperty("等级")
private Integer gradeResult;
}
}

83
src/main/java/com/ccsens/yanyuan/bean/vo/QuestionVo.java

@ -0,0 +1,83 @@
package com.ccsens.yanyuan.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @description:试题
* @author: whj
* @time: 2021/11/11 17:37
*/
public class QuestionVo {
@Data
@ApiModel("题目综合信息")
public static class QuestionMessage {
@ApiModelProperty("题目ID")
private Long id;
@ApiModelProperty("题号")
private int num;
@ApiModelProperty("题目页码")
private List<QuestionPage> questions;
@ApiModelProperty("选项")
private List<Option> options;
}
@Data
@ApiModel("题目页码")
public static class QuestionPage{
@ApiModelProperty("第几页 0:第一页 1:第二页")
private byte page;
@ApiModelProperty("题目位置")
private List<QuestionPosition> positions;
}
@Data
@ApiModel("题目位置")
public static class QuestionPosition {
@ApiModelProperty("题目位置:0:title 1:选项前 2:选项后 3:选项左 4:选项右")
private byte position;
private List<QuestionContent> contents;
}
@Data
@ApiModel("题目内容")
private static class QuestionContent {
@ApiModelProperty("题目内容")
private String content;
@ApiModelProperty("题目类型 0:文字 1:图片")
private byte showType;
}
@Data
@ApiModel("选项")
private static class Option {
@ApiModelProperty("第几页 0:第一页 1:第二页")
private byte page;
@ApiModelProperty("选项位置")
private List<OptionRow> positions;
}
@Data
@ApiModel("选项第几行")
private static class OptionRow {
@ApiModelProperty("第几行")
private byte row;
@ApiModelProperty("选项内容")
private List<OptionCol> contents;
}
@Data
@ApiModel("选项第几列")
private static class OptionCol {
@ApiModelProperty("选项ID")
private Long id;
@ApiModelProperty("选项内容")
private String content;
@ApiModelProperty("题目类型 0:文字 1:图片")
private byte showType;
@ApiModelProperty("第几列")
private byte col;
@ApiModelProperty("选中状态 0:未被选中 1:选中")
private byte chooseStatus;
}
}

13
src/main/java/com/ccsens/yanyuan/bean/vo/ToolVo.java

@ -15,11 +15,11 @@ public class ToolVo {
private Byte isBind;
@ApiModelProperty("用户类型(0:普通用户 1:企业用户)")
private Byte isCompany;
@ApiModelProperty("绑定者是否自己")
@ApiModelProperty("绑定者是否自己 0:否 1:是")
private Byte isMine;
@ApiModelProperty("是否满员")
@ApiModelProperty("是否满员 0:未满员 1:满员")
private Byte isMax;
@ApiModelProperty("是否有体验用户")
@ApiModelProperty("是否有体验用户0:无 1:有")
private Byte isUx;
@ApiModelProperty("绑定者userId")
private Long bindUserId;
@ -39,4 +39,11 @@ public class ToolVo {
@ApiModelProperty("性别(0-未知,1-男,2-女)")
private Byte sex;
}
@Data
@ApiModel("工具箱二维码-响应")
public static class QrCode {
@ApiModelProperty("二维码路径")
private String url;
}
}

8
src/main/java/com/ccsens/yanyuan/bean/vo/TraineeVo.java

@ -22,5 +22,13 @@ public class TraineeVo {
@ApiModelProperty("性别 1:男 2:女 0:未知")
private Integer sex;
}
@Data
@ApiModel("使用者ID-响应")
public static class UserId {
@ApiModelProperty("使用者userID")
private Long keyUserId;
@ApiModelProperty("id")
private String id;
}
}

12
src/main/java/com/ccsens/yanyuan/config/BeanConfig.java

@ -1,6 +1,9 @@
package com.ccsens.yanyuan.config;
import com.ccsens.util.PropUtil;
import com.ccsens.yanyuan.intercept.MybatisInterceptor;
import com.ccsens.yanyuan.util.YanYuanConstant;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -19,4 +22,13 @@ public class BeanConfig {
MybatisInterceptor interceptor = new MybatisInterceptor();
return interceptor;
}
@Bean
public Queue queueMentalTestSingle(){
return new Queue(YanYuanConstant.Mq.MENTAL_TEST_SINGLE);
}
@Bean
public Queue queueMentalTestAll(){
return new Queue(YanYuanConstant.Mq.MENTAL_TEST_ALL);
}
}

44
src/main/java/com/ccsens/yanyuan/mq/MentalTestGenerateReceive.java

@ -0,0 +1,44 @@
package com.ccsens.yanyuan.mq;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.yanyuan.bean.vo.TraineeVo;
import com.ccsens.yanyuan.service.IMentalTestService;
import com.ccsens.yanyuan.util.YanYuanConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @description: 脑力测评
* @author: whj
* @time: 2021/11/11 16:36
*/
@Slf4j
@Component
@RabbitListener(queues = YanYuanConstant.Mq.MENTAL_TEST_SINGLE)
public class MentalTestGenerateReceive {
@Resource
private IMentalTestService mentalTestService;
@RabbitHandler
public void process(String messageJson){
log.info("收到添加脑力测评的mq任务:{}", messageJson);
if (StrUtil.isEmpty(messageJson)) {
return;
}
TraineeVo.UserId userId;
try {
userId = JSONObject.parseObject(messageJson, TraineeVo.UserId.class);
} catch (Exception e) {
log.info("生成单个脑力测评,请求参数格式不正确");
return;
}
Long id = mentalTestService.generateMentalTest(userId.getKeyUserId(), userId.getId());
log.info("为{}生成了脑力测评ID:{}", userId.getKeyUserId(), id);
}
}

51
src/main/java/com/ccsens/yanyuan/mq/MentalTestReceive.java

@ -0,0 +1,51 @@
package com.ccsens.yanyuan.mq;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.util.DateUtil;
import com.ccsens.util.JacksonUtil;
import com.ccsens.util.config.RabbitMQConfig;
import com.ccsens.yanyuan.bean.vo.TraineeVo;
import com.ccsens.yanyuan.persist.dao.MentalTestDao;
import com.ccsens.yanyuan.service.IMentalTestService;
import com.ccsens.yanyuan.util.YanYuanConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Calendar;
import java.util.List;
/**
* @description: 脑力测评
* @author: whj
* @time: 2021/11/11 16:36
*/
@Slf4j
@Component
@RabbitListener(queues = YanYuanConstant.Mq.MENTAL_TEST_ALL)
public class MentalTestReceive {
@Resource
private MentalTestDao mentalTestDao;
@Resource
private AmqpTemplate amqpTemplate;
@RabbitHandler
public void process(String messageJson){
Calendar instance = Calendar.getInstance();
instance = DateUtil.beginOfDay(instance);
instance.add(Calendar.DAY_OF_YEAR, -YanYuanConstant.MentalTest.PERIOD);
log.info("有调度系统调用,为所有用户生成脑力测评");
long total = mentalTestDao.countNeedGenerateMental(instance.getTime());
int pageSize = 100;
for (int i = 0; i < total; i+= pageSize) {
List<TraineeVo.UserId> userIds = mentalTestDao.queryUserIds(i, pageSize, instance.getTime());
userIds.forEach(userId -> amqpTemplate.convertAndSend(YanYuanConstant.Mq.MENTAL_TEST_SINGLE, JSONObject.toJSONString(userId)));
log.info("第{}批用户生成脑力测评", i + 1);
}
}
}

28
src/main/java/com/ccsens/yanyuan/persist/dao/EvaluationNumDao.java

@ -0,0 +1,28 @@
package com.ccsens.yanyuan.persist.dao;
import com.ccsens.yanyuan.bean.dto.QuestionDto;
import com.ccsens.yanyuan.bean.vo.QuestionVo;
import com.ccsens.yanyuan.persist.mapper.EvaluationNumMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author whj
*/
public interface EvaluationNumDao extends EvaluationNumMapper {
/**
* 随机生成该类型的题目
* @param code 类型
* @param total 共几套题
* @return 题目ID
*/
List<Long> queryRandomIds(@Param("code") String code, @Param("total") int total);
/**
* 查询试题信息含答案
* @param param 试题信息查询
* @return 试题详情
*/
QuestionVo.QuestionMessage getQuestionMessage(QuestionDto.Get param);
}

3
src/main/java/com/ccsens/yanyuan/persist/dao/FamilyDao.java

@ -2,5 +2,8 @@ package com.ccsens.yanyuan.persist.dao;
import com.ccsens.yanyuan.persist.mapper.UserFamilyMapper;
/**
* @author whj
*/
public interface FamilyDao extends UserFamilyMapper {
}

20
src/main/java/com/ccsens/yanyuan/persist/dao/MentalQuestionDao.java

@ -0,0 +1,20 @@
package com.ccsens.yanyuan.persist.dao;
import com.ccsens.yanyuan.bean.dto.QuestionDto;
import com.ccsens.yanyuan.bean.po.MentalQuestion;
import com.ccsens.yanyuan.bean.vo.QuestionVo;
import com.ccsens.yanyuan.persist.mapper.MentalQuestionMapper;
import java.util.List;
/**
* @author whj
*/
public interface MentalQuestionDao extends MentalQuestionMapper {
/**
* 批量添加脑力测评题目
* @param mentalQuestions 脑力测评题目
*/
void insertBatch(List<MentalQuestion> mentalQuestions);
}

45
src/main/java/com/ccsens/yanyuan/persist/dao/MentalTestDao.java

@ -0,0 +1,45 @@
package com.ccsens.yanyuan.persist.dao;
import com.ccsens.yanyuan.bean.po.MentalTest;
import com.ccsens.yanyuan.bean.vo.MentalTestVo;
import com.ccsens.yanyuan.bean.vo.TraineeVo;
import com.ccsens.yanyuan.persist.mapper.MentalTestMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* @author whj
*/
public interface MentalTestDao extends MentalTestMapper {
/**
* 查询用户最近的脑力测评
* @param keyUserId 用户ID
* @return 脑力测评
*/
MentalTest getRecent(@Param("keyUserId") Long keyUserId);
/**
* 统计需要生成脑力测评的用户数量
* @param date 开始日期
* @return 用户数量
*/
long countNeedGenerateMental(@Param("date") Date date);
/**
* 查询需要生成脑力测评的用户信息
* @param start 开始
* @param size 长度
* @param date 开始日期
* @return 用户id
*/
List<TraineeVo.UserId> queryUserIds(@Param("start") int start, @Param("size") int size, @Param("date") Date date);
/**
* 计算分数
* @param mentalTestId 脑力测评ID
* @return 分数
*/
MentalTestVo.Result calculateScore(@Param("mentalTestId") Long mentalTestId);
}

5
src/main/java/com/ccsens/yanyuan/persist/dao/TraineeDao.java

@ -14,7 +14,8 @@ public interface TraineeDao extends UserMapper {
* 查询和用户关联的信息
* @param userId 用户ID
* @param relation 关联关系
* @return
* @param useLevel 用户等级0体验 1正式
* @return 查询用户基础信息
*/
List<TraineeVo.UserInfoSimple> queryUserInfo(@Param("userId") Long userId, @Param("relation") Byte relation, @Param("useLevel") Byte useLevel);
@ -23,7 +24,7 @@ public interface TraineeDao extends UserMapper {
* @param keyUserIds 使用者
* @param userId 用户
* @param useLevel 用户使用状态
* @return
* @return 不相关的数量
*/
long countNoRelation(@Param("keyUserIds") List<Long> keyUserIds, @Param("userId") Long userId, @Param("useLevel") byte useLevel);

30
src/main/java/com/ccsens/yanyuan/persist/mapper/EvaluationNumMapper.java

@ -0,0 +1,30 @@
package com.ccsens.yanyuan.persist.mapper;
import com.ccsens.yanyuan.bean.po.EvaluationNum;
import com.ccsens.yanyuan.bean.po.EvaluationNumExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EvaluationNumMapper {
long countByExample(EvaluationNumExample example);
int deleteByExample(EvaluationNumExample example);
int deleteByPrimaryKey(Long id);
int insert(EvaluationNum record);
int insertSelective(EvaluationNum record);
List<EvaluationNum> selectByExample(EvaluationNumExample example);
EvaluationNum selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") EvaluationNum record, @Param("example") EvaluationNumExample example);
int updateByExample(@Param("record") EvaluationNum record, @Param("example") EvaluationNumExample example);
int updateByPrimaryKeySelective(EvaluationNum record);
int updateByPrimaryKey(EvaluationNum record);
}

48
src/main/java/com/ccsens/yanyuan/service/FamilyService.java

@ -40,12 +40,15 @@ public class FamilyService implements IFamilyService {
@Override
public CodeError.Code apply(FamilyDto.Apply param, Long userId) {
if (CollectionUtil.isEmpty(param.getKeyUserIds())) {
return YanYuanCodeError.PARAM_ERROR;
}
// 1.校验使用者信息是否存在
UserExample userExample = new UserExample();
userExample.createCriteria().andKeyIdEqualTo(param.getKeyUserId());
userExample.createCriteria().andKeyIdIn(param.getKeyUserIds());
long userCount = userMapper.countByExample(userExample);
log.info("{}是否存在:{}", param.getKeyUserId(), userCount);
if (userCount <= 0) {
log.info("{}是否存在:{}", param.getKeyUserIds(), userCount);
if (userCount < param.getKeyUserIds().size()) {
return YanYuanCodeError.PARAM_ERROR;
}
// 2.校验家属信息存在
@ -63,25 +66,28 @@ public class FamilyService implements IFamilyService {
familyDao.insertSelective(userFamily);
}
// 3.检查关联关系是否有审核通过或待审核存在
UserRelationExample relationExample = new UserRelationExample();
relationExample.createCriteria().andKeyUserIdEqualTo(param.getKeyUserId())
.andUserIdEqualTo(userId)
.andAuditStatusIn(YanYuanConstant.Audit.noSuccess);
long relationCount = userRelationDao.countByExample(relationExample);
log.info("绑定数量:{}", relationCount);
if (relationCount > 0) {
// 3.1存在,通知无需重复提交
return YanYuanCodeError.MESSAGE_EXIST;
} else {
// 3.2不存在,提交
UserRelation relation = new UserRelation();
relation.setId(snowflake.nextId());
relation.setKeyUserId(param.getKeyUserId());
relation.setUserId(userId);
relation.setRelationType(YanYuanConstant.UserRelation.RELATION_FAMILY);
relation.setOperator(userId);
userRelationDao.insertSelective(relation);
for (Long keyUserId : param.getKeyUserIds()) {
UserRelationExample relationExample = new UserRelationExample();
relationExample.createCriteria().andKeyUserIdEqualTo(keyUserId)
.andUserIdEqualTo(userId)
.andAuditStatusIn(YanYuanConstant.Audit.noSuccess);
long relationCount = userRelationDao.countByExample(relationExample);
log.info("绑定数量:{}", relationCount);
if (relationCount > 0) {
// 3.1存在,通知无需重复提交
return YanYuanCodeError.MESSAGE_EXIST;
} else {
// 3.2不存在,提交
UserRelation relation = new UserRelation();
relation.setId(snowflake.nextId());
relation.setKeyUserId(keyUserId);
relation.setUserId(userId);
relation.setRelationType(YanYuanConstant.UserRelation.RELATION_FAMILY);
relation.setOperator(userId);
userRelationDao.insertSelective(relation);
}
}
return YanYuanCodeError.SUCCESS;
}

34
src/main/java/com/ccsens/yanyuan/service/IMentalTestService.java

@ -0,0 +1,34 @@
package com.ccsens.yanyuan.service;
import com.ccsens.yanyuan.bean.dto.MentalTestDto;
import com.ccsens.yanyuan.bean.vo.MentalTestVo;
/**
* @author whj
*/
public interface IMentalTestService {
/**
* 为某个使用者生成脑力测评校验是否应该生成
* @param param 使用者
* @param userId 操作者
* @return 脑力测评ID
*/
MentalTestVo.Simple generateMentalTestByValid(MentalTestDto.GenerateOne param, Long userId);
/**
* 为用户升车脑力测评不校验是否应该生成
* @param keyUserId 使用者keyId
* @param userId 使用者ID
* @return 脑力测评ID
*/
Long generateMentalTest(Long keyUserId, String userId);
/**
* 脑力测评结果计算
* @param param 脑力测评
* @param userId 操作用户ID
* @return 结果
*/
MentalTestVo.Result calculate(MentalTestDto.Id param, Long userId);
}

24
src/main/java/com/ccsens/yanyuan/service/IQuestionService.java

@ -0,0 +1,24 @@
package com.ccsens.yanyuan.service;
import com.ccsens.yanyuan.bean.dto.QuestionDto;
import com.ccsens.yanyuan.bean.vo.QuestionVo;
/**
* @author whj
*/
public interface IQuestionService {
/**
* 查询试题信息
* @param param 试题和用户信息
* @param userId 操作者
* @return 试题信息
*/
QuestionVo.QuestionMessage get(QuestionDto.Get param, Long userId);
/**
* 保存答案
* @param param 答案
* @param userId 用户ID
*/
void saveAnswer(QuestionDto.SaveAnswer param, Long userId);
}

8
src/main/java/com/ccsens/yanyuan/service/IToolService.java

@ -13,4 +13,12 @@ public interface IToolService {
* @return 工具箱绑定信息
*/
ToolVo.BindTool bindTool(ToolDto.BindTool param, String phone, Long userId);
/**
* 为指定工具箱生成二维码
* @param param 工具箱
* @param userId 操作人
* @return 二维码路径
*/
ToolVo.QrCode generateQrCode(ToolDto.QrCode param, Long userId) throws Exception;
}

7
src/main/java/com/ccsens/yanyuan/service/ITraineeService.java

@ -1,7 +1,6 @@
package com.ccsens.yanyuan.service;
import com.ccsens.util.CodeError;
import com.ccsens.util.JsonResponse;
import com.ccsens.yanyuan.bean.dto.TraineeDto;
import com.ccsens.yanyuan.bean.vo.TraineeVo;
@ -21,11 +20,11 @@ public interface ITraineeService {
/**
* 绑定原有用户信息
* @param param 手机号信息
* @param phone 手机号信息
* @param userId 绑定者用户
* @return 结果
*/
CodeError.Code bindOldTrainee(TraineeDto.Relation param, Long userId);
CodeError.Code bindOldTrainee(String phone, Long userId);
/**
* 查询体验者账号
@ -49,5 +48,5 @@ public interface ITraineeService {
* @param userId 填写者
* @return 结果
*/
JsonResponse add(TraineeDto.User param, String phone, Long userId);
CodeError.Code add(TraineeDto.User param, String phone, Long userId);
}

137
src/main/java/com/ccsens/yanyuan/service/MentalTestService.java

@ -0,0 +1,137 @@
package com.ccsens.yanyuan.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.exception.BaseException;
import com.ccsens.yanyuan.bean.dto.MentalTestDto;
import com.ccsens.yanyuan.bean.po.*;
import com.ccsens.yanyuan.bean.vo.MentalTestVo;
import com.ccsens.yanyuan.persist.dao.EvaluationNumDao;
import com.ccsens.yanyuan.persist.dao.MentalQuestionDao;
import com.ccsens.yanyuan.persist.dao.MentalTestDao;
import com.ccsens.yanyuan.persist.dao.TraineeDao;
import com.ccsens.yanyuan.util.YanYuanCodeError;
import com.ccsens.yanyuan.util.YanYuanConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
/**
* @description:
* @author: whj
* @time: 2021/11/10 16:39
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class MentalTestService implements IMentalTestService {
@Resource
private Snowflake snowflake;
@Resource
private MentalTestDao mentalTestDao;
@Resource
private TraineeDao traineeDao;
@Resource
private EvaluationNumDao evaluationNumDao;
@Resource
private MentalQuestionDao mentalQuestionDao;
@Override
public MentalTestVo.Simple generateMentalTestByValid(MentalTestDto.GenerateOne param, Long userId) {
log.info("为{}生成脑力测评", param);
MentalTestVo.Simple simple = new MentalTestVo.Simple();
// 用户存在
UserExample userExample = new UserExample();
userExample.createCriteria().andKeyIdEqualTo(param.getKeyUserId());
List<User> users = traineeDao.selectByExample(userExample);
if (CollectionUtil.isEmpty(users)) {
log.info("{}不存在该用户", param.getKeyUserId());
throw new BaseException(CodeEnum.PARAM_ERROR);
}
// 查询最近的脑力测评
MentalTest mentalTest = mentalTestDao.getRecent(param.getKeyUserId());
// 判断是否需要生成脑力测评
Calendar onePeriod = Calendar.getInstance();
onePeriod = DateUtil.endOfDay(onePeriod);
onePeriod.set(Calendar.DAY_OF_YEAR, -YanYuanConstant.MentalTest.PERIOD);
// 需生成脑力测评:1.最近无 2.早于14天 3.未完成
boolean generate = mentalTest == null || mentalTest.getCreateAt().getTime() < onePeriod.getTimeInMillis()
|| mentalTest.getFinishStatus() != YanYuanConstant.MentalTest.FINISH_STATUS_YES;
if (!generate) {
log.info("不需要生成新的脑力测评");
simple.setMentalTestId(mentalTest.getKeyId());
simple.setNewMentalTest(YanYuanConstant.MentalTest.GENERATE_OLD);
return simple;
}
log.info("开始生成脑力测评");
Long id = generateMentalTest(param.getKeyUserId(), users.get(0).getId());
simple.setMentalTestId(id);
simple.setNewMentalTest(YanYuanConstant.MentalTest.GENERATE_NEW);
return simple;
}
@Override
public Long generateMentalTest(Long keyUserId, String userId) {
// 将未完成的设置为过时
MentalTestExample mentalTestExample = new MentalTestExample();
mentalTestExample.createCriteria().andKeyUserIdEqualTo(keyUserId).andFinishStatusEqualTo(YanYuanConstant.MentalTest.FINISH_STATUS_NO);
MentalTest updateMental = new MentalTest();
updateMental.setFinishStatus(YanYuanConstant.MentalTest.FINISH_STATUS_OUT_DATE);
mentalTestDao.updateByExampleSelective(updateMental, mentalTestExample);
// 保存脑力测评
MentalTest mentalTest = new MentalTest();
mentalTest.setId(UUID.randomUUID().toString());
mentalTest.setKeyId(snowflake.nextId());
mentalTest.setKeyUserId(keyUserId);
mentalTest.setUserId(userId);
mentalTestDao.insertSelective(mentalTest);
// 随机获取题目ID
List<Long> numIds = evaluationNumDao.queryRandomIds(YanYuanConstant.Evaluation.TYPE_NLCP, YanYuanConstant.Evaluation.TYPE_NLCP_TOTAL);
// 生成题目
List<MentalQuestion> mentalQuestions = new ArrayList<>();
numIds.forEach(numId -> {
MentalQuestion mentalQuestion = new MentalQuestion();
mentalQuestion.setId(snowflake.nextId());
mentalQuestion.setMentalTestId(mentalTest.getKeyId());
mentalQuestion.setNumId(numId);
mentalQuestions.add(mentalQuestion);
});
if (CollectionUtil.isNotEmpty(mentalQuestions)) {
mentalQuestionDao.insertBatch(mentalQuestions);
}
return keyUserId;
}
@Override
public MentalTestVo.Result calculate(MentalTestDto.Id param, Long userId) {
MentalTestVo.Result result = new MentalTestVo.Result();
//判断是否有成绩
MentalTestExample testExample = new MentalTestExample();
testExample.createCriteria().andKeyIdEqualTo(param.getMentalTestId());
List<MentalTest> mentalTests = mentalTestDao.selectByExample(testExample);
if (CollectionUtil.isEmpty(mentalTests)) {
throw new BaseException(YanYuanCodeError.PARAM_ERROR);
}
MentalTest mentalTest = mentalTests.get(0);
if (mentalTest.getFinishStatus() == YanYuanConstant.MentalTest.FINISH_STATUS_YES) {
BeanUtils.copyProperties(mentalTest, result);
log.info("脑力测评成绩已存在:{}", mentalTest);
}
// 计算分数
result = mentalTestDao.calculateScore(param.getMentalTestId());
log.info("{}的分数:{}", param.getMentalTestId(), result);
MentalTest updateTest = new MentalTest();
BeanUtils.copyProperties(result, updateTest);
updateTest.setFinishStatus(YanYuanConstant.MentalTest.FINISH_STATUS_YES);
updateTest.setId(mentalTest.getId());
mentalTestDao.updateByPrimaryKeySelective(updateTest);
return result;
}
}

111
src/main/java/com/ccsens/yanyuan/service/QuestionService.java

@ -0,0 +1,111 @@
package com.ccsens.yanyuan.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import com.ccsens.yanyuan.bean.dto.QuestionDto;
import com.ccsens.yanyuan.bean.po.*;
import com.ccsens.yanyuan.bean.vo.QuestionVo;
import com.ccsens.yanyuan.persist.dao.EvaluationNumDao;
import com.ccsens.yanyuan.persist.dao.MentalQuestionDao;
import com.ccsens.yanyuan.persist.dao.MentalTestDao;
import com.ccsens.yanyuan.persist.mapper.EvaluationOptionMapper;
import com.ccsens.yanyuan.persist.mapper.MentalRecordMapper;
import com.ccsens.yanyuan.util.YanYuanCodeError;
import com.ccsens.yanyuan.util.YanYuanConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/11/11 17:30
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class QuestionService implements IQuestionService {
@Resource
private Snowflake snowflake;
@Resource
private MentalQuestionDao mentalQuestionDao;
@Resource
private EvaluationNumDao evaluationNumDao;
@Resource
private MentalTestDao mentalTestDao;
@Resource
private EvaluationOptionMapper evaluationOptionMapper;
@Resource
private MentalRecordMapper mentalRecordMapper;
@Override
public QuestionVo.QuestionMessage get(QuestionDto.Get param, Long userId) {
QuestionVo.QuestionMessage message = evaluationNumDao.getQuestionMessage(param);
return message;
}
@Override
public void saveAnswer(QuestionDto.SaveAnswer param, Long userId) {
// 校验报告单ID、题目、选项存在
Object o;
Long reportId = param.getReportId();
switch (param.getCode()) {
case YanYuanConstant.Evaluation.TYPE_NLCP:
// 判断脑力测评是否存在
o = getMentalTest(reportId);
break;
case YanYuanConstant.Evaluation.TYPE_ZARIT:
// TODO 判断照顾者量表是否存在
break;
default:
break;
}
// 校验题目和选项
EvaluationNum num = evaluationNumDao.selectByPrimaryKey(param.getQuestionId());
EvaluationOption option = evaluationOptionMapper.selectByPrimaryKey(param.getOptionId());
if (num == null || option == null || option.getNumId().longValue() != num.getId().longValue()) {
throw new BaseException(YanYuanCodeError.PARAM_ERROR);
}
// 保存答案
// 删除原有答案
MentalRecord delRecord = new MentalRecord();
delRecord.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
MentalRecordExample delExample = new MentalRecordExample();
delExample.createCriteria().andTestIdEqualTo(param.getReportId()).andNumIdEqualTo(param.getQuestionId());
mentalRecordMapper.updateByExampleSelective(delRecord, delExample);
MentalRecord record = new MentalRecord();
record.setId(snowflake.nextId());
record.setTestId(param.getReportId());
record.setNumId(param.getQuestionId());
record.setOptionId(param.getOptionId());
record.setOperator(userId);
mentalRecordMapper.insertSelective(record);
}
/**
* 获取mentalTest
* @param reportId keyId
* @return mentalTest
*/
private MentalTest getMentalTest(Long reportId) {
MentalTestExample mentalTestExample = new MentalTestExample();
mentalTestExample.createCriteria().andKeyIdEqualTo(reportId);
List<MentalTest> mentalTests = mentalTestDao.selectByExample(mentalTestExample);
if (CollectionUtil.isEmpty(mentalTests)) {
throw new BaseException(YanYuanCodeError.PARAM_ERROR);
}
return mentalTests.get(0);
}
}

36
src/main/java/com/ccsens/yanyuan/service/ToolService.java

@ -2,9 +2,15 @@ package com.ccsens.yanyuan.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.cloudutil.feign.Tall3FeignClient;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.PropUtil;
import com.ccsens.util.exception.BaseException;
import com.ccsens.wechatutil.bean.dto.WechatCode;
import com.ccsens.wechatutil.wxmini.MiniCodeUtil;
import com.ccsens.yanyuan.bean.dto.ToolDto;
import com.ccsens.yanyuan.bean.po.Tool;
import com.ccsens.yanyuan.bean.vo.ToolVo;
@ -18,6 +24,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.File;
import java.util.List;
@Slf4j
@ -34,6 +41,8 @@ public class ToolService implements IToolService {
private IUserPowerService userPowerService;
@Resource
private Tall3FeignClient tall3FeignClient;
@Resource
private MiniCodeUtil miniCodeUtil;
@Override
public ToolVo.BindTool bindTool(ToolDto.BindTool param, String phone, Long userId) {
@ -64,6 +73,33 @@ public class ToolService implements IToolService {
}
}
@Override
public ToolVo.QrCode generateQrCode(ToolDto.QrCode param, Long userId) throws Exception {
Tool tool = toolDao.selectByPrimaryKey(param.getId());
if (tool == null) {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
ToolVo.QrCode code = new ToolVo.QrCode();
if (StrUtil.isNotEmpty(tool.getUrl())) {
code.setUrl(tool.getUrl());
return code;
}
WechatCode.WechatCodeB wechatCodeB = new WechatCode.WechatCodeB();
wechatCodeB.setScene("toolCode=" + tool.getCode());
wechatCodeB.setPage("pages/index/index");
String path = PropUtil.path + getPosition();
MiniCodeUtil.getWxCodeB(wechatCodeB, path);
String visitUrl = PropUtil.imgDomain + getPosition();
code.setUrl(visitUrl);
return code;
}
private String getPosition() {
return "qrCode/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".png";
}
private ToolVo.BindTool setMyToolInfo(String phone, Long userId) {
ToolVo.BindTool bindTool = new ToolVo.BindTool();

76
src/main/java/com/ccsens/yanyuan/service/TraineeService.java

@ -6,11 +6,15 @@ import com.ccsens.cloudutil.bean.tall.dto.ProjectDto;
import com.ccsens.cloudutil.feign.Tall3FeignClient;
import com.ccsens.util.CodeError;
import com.ccsens.util.JsonResponse;
import com.ccsens.yanyuan.bean.dto.MentalTestDto;
import com.ccsens.yanyuan.bean.dto.TraineeDto;
import com.ccsens.yanyuan.bean.po.Tool;
import com.ccsens.yanyuan.bean.po.User;
import com.ccsens.yanyuan.bean.po.UserExample;
import com.ccsens.yanyuan.bean.po.UserRelation;
import com.ccsens.yanyuan.bean.vo.MentalTestVo;
import com.ccsens.yanyuan.bean.vo.TraineeVo;
import com.ccsens.yanyuan.persist.dao.ToolDao;
import com.ccsens.yanyuan.persist.dao.TraineeDao;
import com.ccsens.yanyuan.persist.dao.UserPowerDao;
import com.ccsens.yanyuan.persist.dao.UserRelationDao;
@ -23,11 +27,12 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* @description:
* @description: 使用者
* @author: whj
* @time: 2021/11/9 10:55
*/
@ -46,6 +51,10 @@ public class TraineeService implements ITraineeService {
private Tall3FeignClient tall3FeignClient;
@Resource
private UserPowerDao userPowerDao;
@Resource
private ToolDao toolDao;
@Resource
private IMentalTestService mentalTestService;
@Override
public List<TraineeVo.UserInfoSimple> queryCreateUser(TraineeDto.Create param, Long userId) {
@ -53,9 +62,9 @@ public class TraineeService implements ITraineeService {
}
@Override
public CodeError.Code bindOldTrainee(TraineeDto.Relation param, Long userId) {
public CodeError.Code bindOldTrainee(String phone, Long userId) {
UserExample userExample = new UserExample();
userExample.createCriteria().andMobileEqualTo(param.getPhone());
userExample.createCriteria().andMobileEqualTo(phone);
List<User> users = traineeDao.selectByExample(userExample);
log.info("原有用户:{}", users);
if (CollectionUtil.isEmpty(users)) {
@ -78,6 +87,15 @@ public class TraineeService implements ITraineeService {
relation.setAuditStatus(YanYuanConstant.Audit.SUCCESS);
relation.setOperator(userId);
userRelationDao.insertSelective(relation);
// 关联工具箱
Tool tool = new Tool();
tool.setId(snowflake.nextId());
tool.setCode(user.getRegisterNo());
tool.setUserId(userId);
tool.setVersion(YanYuanConstant.Tool.VERSION_OLD);
toolDao.insertSelective(tool);
// 关联项目
addUserProject(userId, keyId, user.getUserName(), user.getCreatedAt());
});
return YanYuanCodeError.SUCCESS;
@ -86,9 +104,9 @@ public class TraineeService implements ITraineeService {
@Override
public List<TraineeVo.UserInfoSimple> queryExperience(Long userId) {
List<TraineeVo.UserInfoSimple> creates = traineeDao.queryUserInfo(userId, null, YanYuanConstant.User.USE_LEVEL_EXPERIENCE);
return creates;
List<TraineeVo.UserInfoSimple> experiences = traineeDao.queryUserInfo(userId, null, YanYuanConstant.User.USE_LEVEL_EXPERIENCE);
log.info("体验者信息:{}", experiences);
return experiences;
}
@Override
@ -110,22 +128,24 @@ public class TraineeService implements ITraineeService {
userExample.createCriteria().andKeyIdIn(param.getKeyUserIds());
List<User> users = traineeDao.selectByExample(userExample);
if (CollectionUtil.isNotEmpty(users)) {
users.forEach(user -> {
ProjectDto.SaveProjectDto userProject = YanYuanConstant.Project.getUserProject(user.getKeyId(), userId, user.getUserName(), user.getCreatedAt());
JsonResponse response = tall3FeignClient.saveProjectList(userProject);
log.info("添加用户项目:{},结果:{}", userProject, response);
// TODO 失败后,添加失败记录表,由每10分钟执行一次的定时任务重复执行
});
users.forEach(user -> addUserProject(userId, user.getKeyId(), user.getUserName(), user.getCreatedAt()));
}
return YanYuanCodeError.SUCCESS;
}
private void addUserProject(Long userId, Long projectId, String userName, Date startTime) {
ProjectDto.SaveProjectDto userProject = YanYuanConstant.Project.getUserProject(projectId, userId, userName, startTime);
JsonResponse response = tall3FeignClient.saveProjectList(userProject);
log.info("添加用户项目:{},结果:{}", userProject, response);
// TODO 失败后,添加失败记录表,由每10分钟执行一次的定时任务重复执行
}
@Override
public JsonResponse add(TraineeDto.User param, String phone, Long userId) {
public CodeError.Code add(TraineeDto.User param, String phone, Long userId) {
// 判断是否有添加权限
boolean canAdd = pageAddPrivilege(phone, userId);
if (!canAdd) {
return JsonResponse.newInstance().ok(YanYuanCodeError.USER_FULL);
return YanYuanCodeError.USER_FULL;
}
// 添加用户
User user = new User();
@ -143,11 +163,30 @@ public class TraineeService implements ITraineeService {
relation.setOperator(userId);
userRelationDao.insertSelective(relation);
// 绑定
ProjectDto.SaveProjectDto userProject = YanYuanConstant.Project.getUserProject(user.getKeyId(), userId, user.getUserName(), user.getCreatedAt());
JsonResponse response = tall3FeignClient.saveProjectList(userProject);
return response;
addUserProject(userId, user.getKeyId(), user.getUserName(), new Date());
// 添加脑力测评
generateMentalTest(userId, user.getKeyId());
return YanYuanCodeError.SUCCESS;
}
/**
* 生成脑力测评
* @param userId 操作者
* @param keyId 使用者
*/
private void generateMentalTest(Long userId, Long keyId) {
MentalTestDto.GenerateOne one = new MentalTestDto.GenerateOne();
one.setKeyUserId(keyId);
MentalTestVo.Simple simple = mentalTestService.generateMentalTestByValid(one, userId);
log.info("生成的脑力测评:{}", simple);
}
/**
* 判断添加用户的权限
* @param phone 手机号
* @param userId 用户ID
* @return 权限
*/
private boolean pageAddPrivilege(String phone, Long userId) {
Integer identity = userPowerDao.findIdentity(phone, userId);
log.info("{},{}是否为企业用户:{}", phone, userId, identity);
@ -157,8 +196,7 @@ public class TraineeService implements ITraineeService {
}
Byte isMax = userRelationDao.queryIsMax(userId);
log.info("{}添加的老人数是否已经达到最大:{}", userId, isMax);
return isMax == 1 ? false : true;
return isMax == 0;
}
}

32
src/main/java/com/ccsens/yanyuan/util/YanYuanConstant.java

@ -22,6 +22,23 @@ public class YanYuanConstant {
/**字符串分隔符*/
public static final String STRING_REGEX = ",|,|;|;|、|/";
public static class Mq{
public final static String MENTAL_TEST_ALL = "mentalTestAll";
public final static String MENTAL_TEST_SINGLE = "mentalTestSingle";
}
public static class MentalTest{
public final static byte PERIOD = 14;
public final static byte PERIOD_MAX = 28;
public final static byte FINISH_STATUS_NO = 0;
public final static byte FINISH_STATUS_YES = 1;
public final static byte FINISH_STATUS_OUT_DATE = 2;
public final static byte GENERATE_NEW = 1;
public final static byte GENERATE_OLD = 0;
}
public static class User{
public final static byte USE_LEVEL_EXPERIENCE = 0;
public final static byte USE_LEVEL_OFFICIAL = 1;
@ -44,14 +61,25 @@ public class YanYuanConstant {
noSuccess.add(FAIL);
}
}
public static class Tool {
public final static byte VERSION_OLD = 0;
public final static byte VERSION_TALKING_PEN = 1;
}
public static class Evaluation {
public final static String TYPE_NLCP = "NLCP";
/**
* 共4套题
*/
public final static int TYPE_NLCP_TOTAL = 4;
public final static String TYPE_ZARIT = "ZARIT";
}
public static class Project{
public static ProjectDto.SaveProjectDto getUserProject(Long keyUserId, Long userId, String userName, Date startTime){
ProjectDto.SaveProjectDto dto = new ProjectDto.SaveProjectDto();
dto.setId(keyUserId);
dto.setName(userName + "智能训练");
startTime = startTime == null ? new Date() : startTime;
dto.setStartTime(startTime.getTime());
dto.setEndTime(startTime.getTime() + 99 * 365 * 24 * 3600 * 1000);
dto.setCode("yanyuan-user");
Set<Long> userIdList = new HashSet<>();
userIdList.add(userId);

4
src/main/resources/application-common.yml

@ -27,4 +27,6 @@ spring:
snowflake:
datacenterId: 6
workerId: 1
mini:
appId: wx733e229f00dc5c6f
secret: 9aa0a81973cc5f13c02548b5244accc2

4
src/main/resources/application-test.yml

@ -44,5 +44,5 @@ eureka:
file:
path: /home/cloud/yanyuan/uploads/
domain: https://test.tall.wiki/gateway/yanyuan
imgDomain: https://test.tall.wiki/gateway/yanyuan/uploads/
domain: https://test.tall.wiki/gateway/yanyuan/v2.0/
imgDomain: https://test.tall.wiki/gateway/yanyuan/v2.0/uploads/

115
src/main/resources/mapper_dao/EvaluationNumDao.xml

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.yanyuan.persist.dao.EvaluationNumDao">
<resultMap id="questionMessage" type="com.ccsens.yanyuan.bean.vo.QuestionVo$QuestionMessage">
<id column="id" property="id"/>
<result column="num" property="num"/>
<collection property="questions" ofType="com.ccsens.yanyuan.bean.vo.QuestionVo$QuestionPage">
<id column="qPage" property="page"/>
<collection property="positions" ofType="com.ccsens.yanyuan.bean.vo.QuestionVo$QuestionPosition">
<id column="qPosition" property="position"/>
<collection property="contents" ofType="com.ccsens.yanyuan.bean.vo.QuestionVo$QuestionContent">
<id column="qId"/>
<result column="qContent" property="content"/>
<result column="qShowType" property="showType"/>
</collection>
</collection>
</collection>
<collection property="options" ofType="com.ccsens.yanyuan.bean.vo.QuestionVo$Option">
<id column="oPage" property="page"/>
<collection property="positions" ofType="com.ccsens.yanyuan.bean.vo.QuestionVo$OptionRow">
<id column="row" property="row"/>
<collection property="contents" ofType="com.ccsens.yanyuan.bean.vo.QuestionVo$OptionCol">
<id column="oId" property="id"/>
<result column="oContent" property="content"/>
<result column="oShowType" property="showType"/>
<result column="col" property="col"/>
<result column="choose" property="chooseStatus"/>
</collection>
</collection>
</collection>
</resultMap>
<select id="queryRandomIds" resultType="java.lang.Long">
SELECT
n.id
FROM
(
SELECT CODE,
num,
floor( rand()* #{total} ) + 1 AS sort
FROM
t_evaluation_num
WHERE
CODE = #{code}
AND sort = 1
AND rec_status = 0
) t,
t_evaluation_num n
WHERE
n.CODE = t.CODE
AND n.num = t.num
AND n.sort = t.sort
AND n.rec_status = 0
ORDER BY n.num
</select>
<select id="getQuestionMessage" resultMap="questionMessage">
SELECT
t.*,
IF( r.id IS NULL, 0, 1 ) AS choose
FROM
(
SELECT
n.id,
n.num,
q.id AS qId,
q.content AS qContent,
q.show_type AS qShowType,
q.page AS qPage,
q.position AS qPosition,
o.id AS oId,
o.content AS oContent,
o.page AS oPage,
o.show_type AS oShowType,
o.row,
o.col
FROM
(
<choose>
<when test="code == 'NLCP'">
SELECT
n.*
FROM
u_mental_question r,
t_evaluation_num n
WHERE
r.num_id = n.id
AND r.mental_test_id = #{reportId}
AND n.num = #{num}
AND r.rec_status = 0
AND n.rec_status = 0
</when>
<otherwise>
SELECT
n.*
FROM
t_evaluation_num n
WHERE
n.num = #{num}
AND n.rec_status = 0
</otherwise>
</choose>
) n,
t_evaluation_question q,
t_evaluation_option o
WHERE
n.id = q.num_id
AND n.id = o.num_id
AND q.rec_status = 0
AND o.rec_status = 0
) t
LEFT JOIN u_mental_record r ON r.test_id = #{reportId}
AND r.num_id = t.id
AND r.option_id = t.oId
AND r.rec_status = 0
</select>
</mapper>

11
src/main/resources/mapper_dao/MentalQuestionDao.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.yanyuan.persist.dao.MentalQuestionDao">
<insert id="insertBatch">
INSERT INTO u_mental_question ( id, mental_test_id, num_id )
VALUES
<foreach collection="list" item="item" separator="," >
(#{item.id}, #{item.mentalTestId}, #{item.numId})
</foreach>
</insert>
</mapper>

98
src/main/resources/mapper_dao/MentalTestDao.xml

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.yanyuan.persist.dao.MentalTestDao">
<select id="getRecent" resultType="com.ccsens.yanyuan.bean.po.MentalTest">
SELECT
*
FROM
u_mental_test
WHERE
key_user_id = #{keyUserId}
AND rec_status = 0
ORDER BY
create_at DESC
LIMIT 1
</select>
<select id="countNeedGenerateMental" resultType="java.lang.Long">
SELECT
count(*)
FROM
u_user u
LEFT JOIN u_mental_test t ON u.id = t.user_id AND t.test_at >= #{date} and t.finish_status = 0
where u.use_level = 1 and u.rec_status = 0 and t.id is null
</select>
<select id="queryUserIds" resultType="com.ccsens.yanyuan.bean.vo.TraineeVo$UserId">
SELECT
u.id,
u.key_id as keyUserId
FROM
u_user u
LEFT JOIN u_mental_test t ON u.id = t.user_id AND t.test_at >= #{date} and t.finish_status = 0
where u.use_level = 1 and u.rec_status = 0 and t.id is null
limit ${start}, ${size}
</select>
<select id="calculateScore" resultType="com.ccsens.yanyuan.bean.vo.MentalTestVo$Result">
SELECT
t.*,
s.grade AS gradeResult
FROM
(
SELECT
truncate(ceil( t1.menory * 100 / t2.menory )/ 100,2) AS memoryNum,
truncate(ceil( t1.express * 100 / t2.express )/ 100,2) AS expressNum,
truncate(ceil( t1.VIEW * 100 / t2.VIEW )/ 100,2) AS viewNum,
truncate(ceil( t1.attention * 100 / t2.attention )/ 100,2) AS attentionNum,
truncate(ceil( t1.direction * 100 / t2.direction )/ 100,2) AS directionNum,
truncate(ceil( t1.count * 100 / t2.count )/ 100,2) AS countNum,
truncate(ceil( t1.logic * 100 / t2.logic )/ 100,2) AS logicNum,
truncate(ceil((
t1.menory + t1.express + t1.VIEW + t1.attention + t1.direction + t1.count + t1.logic
)* 100 /(
t2.menory + t2.express + t2.VIEW + t2.attention + t2.direction + t2.count + t2.logic
))/ 100,2) AS grade
FROM
(
SELECT
sum( memory_score ) AS menory,
sum( express_score ) AS express,
sum( view_score ) AS VIEW,
sum( attention_score ) AS attention,
sum( direction_score ) AS direction,
sum( count_score ) AS count,
sum( logic_score ) AS logic
FROM
u_mental_record r,
t_evaluation_num n,
t_evaluation_option o,
u_score s
WHERE
r.test_id = #{mentalTestId}
AND r.num_id = n.id
AND r.option_id = o.id
AND o.score > 0
AND n.num = s.num
AND r.rec_status = 0
AND n.rec_status = 0
AND o.rec_status = 0
) t1,
(
SELECT
sum( memory_score ) AS menory,
sum( express_score ) AS express,
sum( view_score ) AS VIEW,
sum( attention_score ) AS attention,
sum( direction_score ) AS direction,
sum( count_score ) AS count,
sum( logic_score ) AS logic
FROM
u_score
) t2
) t,
s_grade s
WHERE
t.grade &gt;= s.minValue
AND t.grade &lt;= s.MAXVALUE
</select>
</mapper>

2
src/main/resources/mapper_dao/TraineeDao.xml

@ -15,7 +15,7 @@
<select id="queryUserInfo" resultType="com.ccsens.yanyuan.bean.vo.TraineeVo$UserInfoSimple">
SELECT
u.key_id AS keyUserId,
u.nick_name AS userName,
u.user_name AS userName,
u.sex AS sex
FROM
u_user u,

275
src/main/resources/mapper_raw/EvaluationNumMapper.xml

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.yanyuan.persist.mapper.EvaluationNumMapper">
<resultMap id="BaseResultMap" type="com.ccsens.yanyuan.bean.po.EvaluationNum">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, code, num, sort, remark, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.EvaluationNumExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_evaluation_num
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_evaluation_num
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_evaluation_num
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.yanyuan.bean.po.EvaluationNumExample">
delete from t_evaluation_num
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.EvaluationNum">
insert into t_evaluation_num (id, code, num,
sort, remark, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
#{sort,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.yanyuan.bean.po.EvaluationNum">
insert into t_evaluation_num
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="code != null">
code,
</if>
<if test="num != null">
num,
</if>
<if test="sort != null">
sort,
</if>
<if test="remark != null">
remark,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="num != null">
#{num,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.yanyuan.bean.po.EvaluationNumExample" resultType="java.lang.Long">
select count(*) from t_evaluation_num
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_evaluation_num
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.num != null">
num = #{record.num,jdbcType=INTEGER},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_evaluation_num
set id = #{record.id,jdbcType=BIGINT},
code = #{record.code,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER},
sort = #{record.sort,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.yanyuan.bean.po.EvaluationNum">
update t_evaluation_num
<set>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="num != null">
num = #{num,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.yanyuan.bean.po.EvaluationNum">
update t_evaluation_num
set code = #{code,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

59
src/main/resources/mapper_raw/EvaluationOptionMapper.xml

@ -3,14 +3,13 @@
<mapper namespace="com.ccsens.yanyuan.persist.mapper.EvaluationOptionMapper">
<resultMap id="BaseResultMap" type="com.ccsens.yanyuan.bean.po.EvaluationOption">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="question_id" jdbcType="BIGINT" property="questionId" />
<result column="num_id" jdbcType="BIGINT" property="numId" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="score" jdbcType="TINYINT" property="score" />
<result column="page" jdbcType="TINYINT" property="page" />
<result column="show_type" jdbcType="TINYINT" property="showType" />
<result column="row" jdbcType="TINYINT" property="row" />
<result column="col" jdbcType="TINYINT" property="col" />
<result column="positon" jdbcType="TINYINT" property="positon" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operator" jdbcType="BIGINT" property="operator" />
@ -77,8 +76,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, question_id, content, score, page, show_type, row, col, positon, sort, remark,
operator, created_at, updated_at, rec_status
id, num_id, content, score, page, show_type, row, col, sort, remark, operator, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.EvaluationOptionExample" resultMap="BaseResultMap">
select
@ -111,18 +110,16 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.EvaluationOption">
insert into t_evaluation_option (id, question_id, content,
insert into t_evaluation_option (id, num_id, content,
score, page, show_type,
row, col, positon,
sort, remark, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{questionId,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR},
row, col, sort, remark,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{numId,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR},
#{score,jdbcType=TINYINT}, #{page,jdbcType=TINYINT}, #{showType,jdbcType=TINYINT},
#{row,jdbcType=TINYINT}, #{col,jdbcType=TINYINT}, #{positon,jdbcType=TINYINT},
#{sort,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
#{row,jdbcType=TINYINT}, #{col,jdbcType=TINYINT}, #{sort,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.yanyuan.bean.po.EvaluationOption">
insert into t_evaluation_option
@ -130,8 +127,8 @@
<if test="id != null">
id,
</if>
<if test="questionId != null">
question_id,
<if test="numId != null">
num_id,
</if>
<if test="content != null">
content,
@ -151,9 +148,6 @@
<if test="col != null">
col,
</if>
<if test="positon != null">
positon,
</if>
<if test="sort != null">
sort,
</if>
@ -177,8 +171,8 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="questionId != null">
#{questionId,jdbcType=BIGINT},
<if test="numId != null">
#{numId,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
@ -198,9 +192,6 @@
<if test="col != null">
#{col,jdbcType=TINYINT},
</if>
<if test="positon != null">
#{positon,jdbcType=TINYINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
@ -233,8 +224,8 @@
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.questionId != null">
question_id = #{record.questionId,jdbcType=BIGINT},
<if test="record.numId != null">
num_id = #{record.numId,jdbcType=BIGINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
@ -254,9 +245,6 @@
<if test="record.col != null">
col = #{record.col,jdbcType=TINYINT},
</if>
<if test="record.positon != null">
positon = #{record.positon,jdbcType=TINYINT},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
@ -283,14 +271,13 @@
<update id="updateByExample" parameterType="map">
update t_evaluation_option
set id = #{record.id,jdbcType=BIGINT},
question_id = #{record.questionId,jdbcType=BIGINT},
num_id = #{record.numId,jdbcType=BIGINT},
content = #{record.content,jdbcType=VARCHAR},
score = #{record.score,jdbcType=TINYINT},
page = #{record.page,jdbcType=TINYINT},
show_type = #{record.showType,jdbcType=TINYINT},
row = #{record.row,jdbcType=TINYINT},
col = #{record.col,jdbcType=TINYINT},
positon = #{record.positon,jdbcType=TINYINT},
sort = #{record.sort,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
@ -304,8 +291,8 @@
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.yanyuan.bean.po.EvaluationOption">
update t_evaluation_option
<set>
<if test="questionId != null">
question_id = #{questionId,jdbcType=BIGINT},
<if test="numId != null">
num_id = #{numId,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
@ -325,9 +312,6 @@
<if test="col != null">
col = #{col,jdbcType=TINYINT},
</if>
<if test="positon != null">
positon = #{positon,jdbcType=TINYINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
@ -351,14 +335,13 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.yanyuan.bean.po.EvaluationOption">
update t_evaluation_option
set question_id = #{questionId,jdbcType=BIGINT},
set num_id = #{numId,jdbcType=BIGINT},
content = #{content,jdbcType=VARCHAR},
score = #{score,jdbcType=TINYINT},
page = #{page,jdbcType=TINYINT},
show_type = #{showType,jdbcType=TINYINT},
row = #{row,jdbcType=TINYINT},
col = #{col,jdbcType=TINYINT},
positon = #{positon,jdbcType=TINYINT},
sort = #{sort,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},

81
src/main/resources/mapper_raw/EvaluationQuestionMapper.xml

@ -3,12 +3,11 @@
<mapper namespace="com.ccsens.yanyuan.persist.mapper.EvaluationQuestionMapper">
<resultMap id="BaseResultMap" type="com.ccsens.yanyuan.bean.po.EvaluationQuestion">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="num_id" jdbcType="BIGINT" property="numId" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="show_type" jdbcType="TINYINT" property="showType" />
<result column="page" jdbcType="TINYINT" property="page" />
<result column="positon" jdbcType="TINYINT" property="positon" />
<result column="position" jdbcType="TINYINT" property="position" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operator" jdbcType="BIGINT" property="operator" />
@ -75,7 +74,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, code, num, content, show_type, page, positon, sort, remark, operator, created_at,
id, num_id, content, show_type, page, position, sort, remark, operator, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.EvaluationQuestionExample" resultMap="BaseResultMap">
@ -109,16 +108,16 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.EvaluationQuestion">
insert into t_evaluation_question (id, code, num,
content, show_type, page,
positon, sort, remark,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
#{content,jdbcType=VARCHAR}, #{showType,jdbcType=TINYINT}, #{page,jdbcType=TINYINT},
#{positon,jdbcType=TINYINT}, #{sort,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
insert into t_evaluation_question (id, num_id, content,
show_type, page, position,
sort, remark, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{numId,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR},
#{showType,jdbcType=TINYINT}, #{page,jdbcType=TINYINT}, #{position,jdbcType=TINYINT},
#{sort,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.yanyuan.bean.po.EvaluationQuestion">
insert into t_evaluation_question
@ -126,11 +125,8 @@
<if test="id != null">
id,
</if>
<if test="code != null">
code,
</if>
<if test="num != null">
num,
<if test="numId != null">
num_id,
</if>
<if test="content != null">
content,
@ -141,8 +137,8 @@
<if test="page != null">
page,
</if>
<if test="positon != null">
positon,
<if test="position != null">
position,
</if>
<if test="sort != null">
sort,
@ -167,11 +163,8 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="num != null">
#{num,jdbcType=INTEGER},
<if test="numId != null">
#{numId,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
@ -182,8 +175,8 @@
<if test="page != null">
#{page,jdbcType=TINYINT},
</if>
<if test="positon != null">
#{positon,jdbcType=TINYINT},
<if test="position != null">
#{position,jdbcType=TINYINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
@ -217,11 +210,8 @@
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.num != null">
num = #{record.num,jdbcType=INTEGER},
<if test="record.numId != null">
num_id = #{record.numId,jdbcType=BIGINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
@ -232,8 +222,8 @@
<if test="record.page != null">
page = #{record.page,jdbcType=TINYINT},
</if>
<if test="record.positon != null">
positon = #{record.positon,jdbcType=TINYINT},
<if test="record.position != null">
position = #{record.position,jdbcType=TINYINT},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
@ -261,12 +251,11 @@
<update id="updateByExample" parameterType="map">
update t_evaluation_question
set id = #{record.id,jdbcType=BIGINT},
code = #{record.code,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER},
num_id = #{record.numId,jdbcType=BIGINT},
content = #{record.content,jdbcType=VARCHAR},
show_type = #{record.showType,jdbcType=TINYINT},
page = #{record.page,jdbcType=TINYINT},
positon = #{record.positon,jdbcType=TINYINT},
position = #{record.position,jdbcType=TINYINT},
sort = #{record.sort,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
@ -280,11 +269,8 @@
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.yanyuan.bean.po.EvaluationQuestion">
update t_evaluation_question
<set>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="num != null">
num = #{num,jdbcType=INTEGER},
<if test="numId != null">
num_id = #{numId,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
@ -295,8 +281,8 @@
<if test="page != null">
page = #{page,jdbcType=TINYINT},
</if>
<if test="positon != null">
positon = #{positon,jdbcType=TINYINT},
<if test="position != null">
position = #{position,jdbcType=TINYINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
@ -321,12 +307,11 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.yanyuan.bean.po.EvaluationQuestion">
update t_evaluation_question
set code = #{code,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER},
set num_id = #{numId,jdbcType=BIGINT},
content = #{content,jdbcType=VARCHAR},
show_type = #{showType,jdbcType=TINYINT},
page = #{page,jdbcType=TINYINT},
positon = #{positon,jdbcType=TINYINT},
position = #{position,jdbcType=TINYINT},
sort = #{sort,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},

28
src/main/resources/mapper_raw/MentalQuestionMapper.xml

@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.ccsens.yanyuan.bean.po.MentalQuestion">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="mental_test_id" jdbcType="BIGINT" property="mentalTestId" />
<result column="question_id" jdbcType="BIGINT" property="questionId" />
<result column="num_id" jdbcType="BIGINT" property="numId" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
@ -70,7 +70,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, mental_test_id, question_id, remark, operator, created_at, updated_at, rec_status
id, mental_test_id, num_id, remark, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.MentalQuestionExample" resultMap="BaseResultMap">
select
@ -103,10 +103,10 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.MentalQuestion">
insert into u_mental_question (id, mental_test_id, question_id,
insert into u_mental_question (id, mental_test_id, num_id,
remark, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{mentalTestId,jdbcType=BIGINT}, #{questionId,jdbcType=BIGINT},
values (#{id,jdbcType=BIGINT}, #{mentalTestId,jdbcType=BIGINT}, #{numId,jdbcType=BIGINT},
#{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
@ -119,8 +119,8 @@
<if test="mentalTestId != null">
mental_test_id,
</if>
<if test="questionId != null">
question_id,
<if test="numId != null">
num_id,
</if>
<if test="remark != null">
remark,
@ -145,8 +145,8 @@
<if test="mentalTestId != null">
#{mentalTestId,jdbcType=BIGINT},
</if>
<if test="questionId != null">
#{questionId,jdbcType=BIGINT},
<if test="numId != null">
#{numId,jdbcType=BIGINT},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
@ -180,8 +180,8 @@
<if test="record.mentalTestId != null">
mental_test_id = #{record.mentalTestId,jdbcType=BIGINT},
</if>
<if test="record.questionId != null">
question_id = #{record.questionId,jdbcType=BIGINT},
<if test="record.numId != null">
num_id = #{record.numId,jdbcType=BIGINT},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
@ -207,7 +207,7 @@
update u_mental_question
set id = #{record.id,jdbcType=BIGINT},
mental_test_id = #{record.mentalTestId,jdbcType=BIGINT},
question_id = #{record.questionId,jdbcType=BIGINT},
num_id = #{record.numId,jdbcType=BIGINT},
remark = #{record.remark,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -223,8 +223,8 @@
<if test="mentalTestId != null">
mental_test_id = #{mentalTestId,jdbcType=BIGINT},
</if>
<if test="questionId != null">
question_id = #{questionId,jdbcType=BIGINT},
<if test="numId != null">
num_id = #{numId,jdbcType=BIGINT},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
@ -247,7 +247,7 @@
<update id="updateByPrimaryKey" parameterType="com.ccsens.yanyuan.bean.po.MentalQuestion">
update u_mental_question
set mental_test_id = #{mentalTestId,jdbcType=BIGINT},
question_id = #{questionId,jdbcType=BIGINT},
num_id = #{numId,jdbcType=BIGINT},
remark = #{remark,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},

56
src/main/resources/mapper_raw/MentalRecordMapper.xml

@ -4,9 +4,8 @@
<resultMap id="BaseResultMap" type="com.ccsens.yanyuan.bean.po.MentalRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="test_id" jdbcType="BIGINT" property="testId" />
<result column="question_id" jdbcType="BIGINT" property="questionId" />
<result column="num_id" jdbcType="BIGINT" property="numId" />
<result column="option_id" jdbcType="BIGINT" property="optionId" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
@ -72,8 +71,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, test_id, question_id, option_id, code, remark, operator, created_at, updated_at,
rec_status
id, test_id, num_id, option_id, remark, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.MentalRecordExample" resultMap="BaseResultMap">
select
@ -106,14 +104,14 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.MentalRecord">
insert into u_mental_record (id, test_id, question_id,
option_id, code, remark,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{testId,jdbcType=BIGINT}, #{questionId,jdbcType=BIGINT},
#{optionId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
insert into u_mental_record (id, test_id, num_id,
option_id, remark, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{testId,jdbcType=BIGINT}, #{numId,jdbcType=BIGINT},
#{optionId,jdbcType=BIGINT}, #{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.yanyuan.bean.po.MentalRecord">
insert into u_mental_record
@ -124,15 +122,12 @@
<if test="testId != null">
test_id,
</if>
<if test="questionId != null">
question_id,
<if test="numId != null">
num_id,
</if>
<if test="optionId != null">
option_id,
</if>
<if test="code != null">
code,
</if>
<if test="remark != null">
remark,
</if>
@ -156,15 +151,12 @@
<if test="testId != null">
#{testId,jdbcType=BIGINT},
</if>
<if test="questionId != null">
#{questionId,jdbcType=BIGINT},
<if test="numId != null">
#{numId,jdbcType=BIGINT},
</if>
<if test="optionId != null">
#{optionId,jdbcType=BIGINT},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
@ -197,15 +189,12 @@
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=BIGINT},
</if>
<if test="record.questionId != null">
question_id = #{record.questionId,jdbcType=BIGINT},
<if test="record.numId != null">
num_id = #{record.numId,jdbcType=BIGINT},
</if>
<if test="record.optionId != null">
option_id = #{record.optionId,jdbcType=BIGINT},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
@ -230,9 +219,8 @@
update u_mental_record
set id = #{record.id,jdbcType=BIGINT},
test_id = #{record.testId,jdbcType=BIGINT},
question_id = #{record.questionId,jdbcType=BIGINT},
num_id = #{record.numId,jdbcType=BIGINT},
option_id = #{record.optionId,jdbcType=BIGINT},
code = #{record.code,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -248,15 +236,12 @@
<if test="testId != null">
test_id = #{testId,jdbcType=BIGINT},
</if>
<if test="questionId != null">
question_id = #{questionId,jdbcType=BIGINT},
<if test="numId != null">
num_id = #{numId,jdbcType=BIGINT},
</if>
<if test="optionId != null">
option_id = #{optionId,jdbcType=BIGINT},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
@ -278,9 +263,8 @@
<update id="updateByPrimaryKey" parameterType="com.ccsens.yanyuan.bean.po.MentalRecord">
update u_mental_record
set test_id = #{testId,jdbcType=BIGINT},
question_id = #{questionId,jdbcType=BIGINT},
num_id = #{numId,jdbcType=BIGINT},
option_id = #{optionId,jdbcType=BIGINT},
code = #{code,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},

14
src/main/resources/mapper_raw/MentalTestMapper.xml

@ -6,7 +6,7 @@
<result column="key_user_id" jdbcType="BIGINT" property="keyUserId" />
<result column="key_id" jdbcType="BIGINT" property="keyId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="finish_status" jdbcType="INTEGER" property="finishStatus" />
<result column="finish_status" jdbcType="TINYINT" property="finishStatus" />
<result column="memory_num" jdbcType="DECIMAL" property="memoryNum" />
<result column="express_num" jdbcType="DECIMAL" property="expressNum" />
<result column="view_num" jdbcType="DECIMAL" property="viewNum" />
@ -127,7 +127,7 @@
status, pdf_url, rec_status
)
values (#{id,jdbcType=VARCHAR}, #{keyUserId,jdbcType=BIGINT}, #{keyId,jdbcType=BIGINT},
#{userId,jdbcType=VARCHAR}, #{finishStatus,jdbcType=INTEGER}, #{memoryNum,jdbcType=DECIMAL},
#{userId,jdbcType=VARCHAR}, #{finishStatus,jdbcType=TINYINT}, #{memoryNum,jdbcType=DECIMAL},
#{expressNum,jdbcType=DECIMAL}, #{viewNum,jdbcType=DECIMAL}, #{attentionNum,jdbcType=DECIMAL},
#{directionNum,jdbcType=DECIMAL}, #{countNum,jdbcType=DECIMAL}, #{logicNum,jdbcType=DECIMAL},
#{averageNum,jdbcType=DECIMAL}, #{fromType,jdbcType=BIT}, #{gradeResult,jdbcType=INTEGER},
@ -216,7 +216,7 @@
#{userId,jdbcType=VARCHAR},
</if>
<if test="finishStatus != null">
#{finishStatus,jdbcType=INTEGER},
#{finishStatus,jdbcType=TINYINT},
</if>
<if test="memoryNum != null">
#{memoryNum,jdbcType=DECIMAL},
@ -290,7 +290,7 @@
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.finishStatus != null">
finish_status = #{record.finishStatus,jdbcType=INTEGER},
finish_status = #{record.finishStatus,jdbcType=TINYINT},
</if>
<if test="record.memoryNum != null">
memory_num = #{record.memoryNum,jdbcType=DECIMAL},
@ -351,7 +351,7 @@
key_user_id = #{record.keyUserId,jdbcType=BIGINT},
key_id = #{record.keyId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=VARCHAR},
finish_status = #{record.finishStatus,jdbcType=INTEGER},
finish_status = #{record.finishStatus,jdbcType=TINYINT},
memory_num = #{record.memoryNum,jdbcType=DECIMAL},
express_num = #{record.expressNum,jdbcType=DECIMAL},
view_num = #{record.viewNum,jdbcType=DECIMAL},
@ -385,7 +385,7 @@
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="finishStatus != null">
finish_status = #{finishStatus,jdbcType=INTEGER},
finish_status = #{finishStatus,jdbcType=TINYINT},
</if>
<if test="memoryNum != null">
memory_num = #{memoryNum,jdbcType=DECIMAL},
@ -443,7 +443,7 @@
set key_user_id = #{keyUserId,jdbcType=BIGINT},
key_id = #{keyId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=VARCHAR},
finish_status = #{finishStatus,jdbcType=INTEGER},
finish_status = #{finishStatus,jdbcType=TINYINT},
memory_num = #{memoryNum,jdbcType=DECIMAL},
express_num = #{expressNum,jdbcType=DECIMAL},
view_num = #{viewNum,jdbcType=DECIMAL},

45
src/main/resources/mapper_raw/ToolMapper.xml

@ -6,6 +6,8 @@
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="version" jdbcType="TINYINT" property="version" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
@ -71,7 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, code, name, description, user_id, operator, created_at, updated_at, rec_status
id, code, name, description, version, url, user_id, operator, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.ToolExample" resultMap="BaseResultMap">
select
@ -105,13 +108,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.Tool">
insert into t_tool (id, code, name,
description, user_id, operator,
created_at, updated_at, rec_status
)
description, version, url,
user_id, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
#{description,jdbcType=VARCHAR}, #{version,jdbcType=TINYINT}, #{url,jdbcType=VARCHAR},
#{userId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.yanyuan.bean.po.Tool">
insert into t_tool
@ -128,6 +131,12 @@
<if test="description != null">
description,
</if>
<if test="version != null">
version,
</if>
<if test="url != null">
url,
</if>
<if test="userId != null">
user_id,
</if>
@ -157,6 +166,12 @@
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="version != null">
#{version,jdbcType=TINYINT},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
@ -195,6 +210,12 @@
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.version != null">
version = #{record.version,jdbcType=TINYINT},
</if>
<if test="record.url != null">
url = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
@ -221,6 +242,8 @@
code = #{record.code,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
version = #{record.version,jdbcType=TINYINT},
url = #{record.url,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -242,6 +265,12 @@
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="version != null">
version = #{version,jdbcType=TINYINT},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
@ -265,6 +294,8 @@
set code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
version = #{version,jdbcType=TINYINT},
url = #{url,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},

15
src/main/resources/mbg.xml

@ -55,14 +55,15 @@
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<table tableName="s_config" domainObjectName="Config"></table>
<table tableName="u_mental_test" domainObjectName="MentalTest"></table>
<!--<table tableName="s_config" domainObjectName="Config"></table>
<table tableName="s_grade" domainObjectName="Grade"></table>
<table tableName="t_evaluation_option" domainObjectName="EvaluationOption"></table>
<table tableName="t_evaluation_question" domainObjectName="EvaluationQuestion"></table>
<table tableName="t_evaluation_type" domainObjectName="EvaluationType"></table>
<table tableName="t_tool" domainObjectName="Tool"></table>
<table tableName="t_tool_card" domainObjectName="ToolCard"></table>
<table tableName="t_evaluation_num" domainObjectName="EvaluationNum"></table>
<table tableName="t_evaluation_question" domainObjectName="EvaluationQuestion"></table>-->
<!--<table tableName="t_evaluation_type" domainObjectName="EvaluationType"></table>
<table tableName="t_tool" domainObjectName="Tool"></table>-->
<!--<table tableName="t_tool_card" domainObjectName="ToolCard"></table>
<table tableName="t_tool_equipment" domainObjectName="ToolEquipment"></table>
<table tableName="t_tool_find_difference" domainObjectName="ToolFindDifference"></table>
<table tableName="t_train_aid" domainObjectName="TrainAid"></table>
@ -84,7 +85,7 @@
<table tableName="u_user" domainObjectName="User"></table>
<table tableName="u_user_family" domainObjectName="UserFamily"></table>
<table tableName="u_user_relation" domainObjectName="UserRelation"></table>
<table tableName="u_user_type" domainObjectName="UserType"></table>
<table tableName="u_user_type" domainObjectName="UserType"></table>-->
<!-- 有些表的字段需要指定java类型
<table schema="" tableName="">

Loading…
Cancel
Save