Browse Source

试题配置

sd
zhizhi wu 4 years ago
parent
commit
b27038d615
  1. 128
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShow.java
  2. 821
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShowExample.java
  3. 63
      ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java
  4. 59
      ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java
  5. 17
      ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionShowDao.java
  6. 30
      ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionShowMapper.java
  7. 27
      ht/src/main/java/com/ccsens/ht/service/ImportService.java
  8. 40
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  9. 24
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  10. 4
      ht/src/main/resources/application.yml
  11. 13
      ht/src/main/resources/mapper_dao/HtQuestionShowDao.xml
  12. 291
      ht/src/main/resources/mapper_raw/HtQuestionShowMapper.xml
  13. 147
      util/src/test/java/com/ccsens/util/JsonTest.java

128
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShow.java

@ -0,0 +1,128 @@
package com.ccsens.ht.bean.po;
import java.io.Serializable;
import java.util.Date;
public class HtQuestionShow implements Serializable {
private Long id;
private Long questionId;
private Byte showType;
private Byte showNode;
private String param;
private Byte sort;
private String remark;
private Date createTime;
private Date updateTime;
private Byte isDel;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getQuestionId() {
return questionId;
}
public void setQuestionId(Long questionId) {
this.questionId = questionId;
}
public Byte getShowType() {
return showType;
}
public void setShowType(Byte showType) {
this.showType = showType;
}
public Byte getShowNode() {
return showNode;
}
public void setShowNode(Byte showNode) {
this.showNode = showNode;
}
public String getParam() {
return param;
}
public void setParam(String param) {
this.param = param == null ? null : param.trim();
}
public Byte getSort() {
return sort;
}
public void setSort(Byte sort) {
this.sort = sort;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getIsDel() {
return isDel;
}
public void setIsDel(Byte isDel) {
this.isDel = isDel;
}
@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(", questionId=").append(questionId);
sb.append(", showType=").append(showType);
sb.append(", showNode=").append(showNode);
sb.append(", param=").append(param);
sb.append(", sort=").append(sort);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append("]");
return sb.toString();
}
}

821
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShowExample.java

@ -0,0 +1,821 @@
package com.ccsens.ht.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class HtQuestionShowExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public HtQuestionShowExample() {
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 andQuestionIdIsNull() {
addCriterion("question_id is null");
return (Criteria) this;
}
public Criteria andQuestionIdIsNotNull() {
addCriterion("question_id is not null");
return (Criteria) this;
}
public Criteria andQuestionIdEqualTo(Long value) {
addCriterion("question_id =", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdNotEqualTo(Long value) {
addCriterion("question_id <>", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThan(Long value) {
addCriterion("question_id >", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdGreaterThanOrEqualTo(Long value) {
addCriterion("question_id >=", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThan(Long value) {
addCriterion("question_id <", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdLessThanOrEqualTo(Long value) {
addCriterion("question_id <=", value, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdIn(List<Long> values) {
addCriterion("question_id in", values, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdNotIn(List<Long> values) {
addCriterion("question_id not in", values, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdBetween(Long value1, Long value2) {
addCriterion("question_id between", value1, value2, "questionId");
return (Criteria) this;
}
public Criteria andQuestionIdNotBetween(Long value1, Long value2) {
addCriterion("question_id not between", value1, value2, "questionId");
return (Criteria) this;
}
public Criteria andShowTypeIsNull() {
addCriterion("show_type is null");
return (Criteria) this;
}
public Criteria andShowTypeIsNotNull() {
addCriterion("show_type is not null");
return (Criteria) this;
}
public Criteria andShowTypeEqualTo(Byte value) {
addCriterion("show_type =", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotEqualTo(Byte value) {
addCriterion("show_type <>", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThan(Byte value) {
addCriterion("show_type >", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("show_type >=", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeLessThan(Byte value) {
addCriterion("show_type <", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeLessThanOrEqualTo(Byte value) {
addCriterion("show_type <=", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeIn(List<Byte> values) {
addCriterion("show_type in", values, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotIn(List<Byte> values) {
addCriterion("show_type not in", values, "showType");
return (Criteria) this;
}
public Criteria andShowTypeBetween(Byte value1, Byte value2) {
addCriterion("show_type between", value1, value2, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotBetween(Byte value1, Byte value2) {
addCriterion("show_type not between", value1, value2, "showType");
return (Criteria) this;
}
public Criteria andShowNodeIsNull() {
addCriterion("show_node is null");
return (Criteria) this;
}
public Criteria andShowNodeIsNotNull() {
addCriterion("show_node is not null");
return (Criteria) this;
}
public Criteria andShowNodeEqualTo(Byte value) {
addCriterion("show_node =", value, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeNotEqualTo(Byte value) {
addCriterion("show_node <>", value, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeGreaterThan(Byte value) {
addCriterion("show_node >", value, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeGreaterThanOrEqualTo(Byte value) {
addCriterion("show_node >=", value, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeLessThan(Byte value) {
addCriterion("show_node <", value, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeLessThanOrEqualTo(Byte value) {
addCriterion("show_node <=", value, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeIn(List<Byte> values) {
addCriterion("show_node in", values, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeNotIn(List<Byte> values) {
addCriterion("show_node not in", values, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeBetween(Byte value1, Byte value2) {
addCriterion("show_node between", value1, value2, "showNode");
return (Criteria) this;
}
public Criteria andShowNodeNotBetween(Byte value1, Byte value2) {
addCriterion("show_node not between", value1, value2, "showNode");
return (Criteria) this;
}
public Criteria andParamIsNull() {
addCriterion("param is null");
return (Criteria) this;
}
public Criteria andParamIsNotNull() {
addCriterion("param is not null");
return (Criteria) this;
}
public Criteria andParamEqualTo(String value) {
addCriterion("param =", value, "param");
return (Criteria) this;
}
public Criteria andParamNotEqualTo(String value) {
addCriterion("param <>", value, "param");
return (Criteria) this;
}
public Criteria andParamGreaterThan(String value) {
addCriterion("param >", value, "param");
return (Criteria) this;
}
public Criteria andParamGreaterThanOrEqualTo(String value) {
addCriterion("param >=", value, "param");
return (Criteria) this;
}
public Criteria andParamLessThan(String value) {
addCriterion("param <", value, "param");
return (Criteria) this;
}
public Criteria andParamLessThanOrEqualTo(String value) {
addCriterion("param <=", value, "param");
return (Criteria) this;
}
public Criteria andParamLike(String value) {
addCriterion("param like", value, "param");
return (Criteria) this;
}
public Criteria andParamNotLike(String value) {
addCriterion("param not like", value, "param");
return (Criteria) this;
}
public Criteria andParamIn(List<String> values) {
addCriterion("param in", values, "param");
return (Criteria) this;
}
public Criteria andParamNotIn(List<String> values) {
addCriterion("param not in", values, "param");
return (Criteria) this;
}
public Criteria andParamBetween(String value1, String value2) {
addCriterion("param between", value1, value2, "param");
return (Criteria) this;
}
public Criteria andParamNotBetween(String value1, String value2) {
addCriterion("param not between", value1, value2, "param");
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(Byte value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotEqualTo(Byte value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThan(Byte value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(Byte value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThan(Byte value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(Byte value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
public Criteria andSortIn(List<Byte> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<Byte> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(Byte value1, Byte value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(Byte value1, Byte 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 andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andIsDelIsNull() {
addCriterion("is_del is null");
return (Criteria) this;
}
public Criteria andIsDelIsNotNull() {
addCriterion("is_del is not null");
return (Criteria) this;
}
public Criteria andIsDelEqualTo(Byte value) {
addCriterion("is_del =", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotEqualTo(Byte value) {
addCriterion("is_del <>", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThan(Byte value) {
addCriterion("is_del >", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThanOrEqualTo(Byte value) {
addCriterion("is_del >=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThan(Byte value) {
addCriterion("is_del <", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThanOrEqualTo(Byte value) {
addCriterion("is_del <=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelIn(List<Byte> values) {
addCriterion("is_del in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotIn(List<Byte> values) {
addCriterion("is_del not in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelBetween(Byte value1, Byte value2) {
addCriterion("is_del between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotBetween(Byte value1, Byte value2) {
addCriterion("is_del not between", value1, value2, "isDel");
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);
}
}
}

63
ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java

@ -0,0 +1,63 @@
package com.ccsens.ht.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/6/10 16:29
*/
public class QuestionShowVo {
@Data
@ApiModel("显示信息")
public static class Show{
@ApiModelProperty("类型 0:倒计时 1:限制选项数量 2:选中某些指定选项执行操作")
private byte showType;
}
@Data
@ApiModel("选项限制")
public static class OptionLimit extends Show{
@ApiModelProperty("限制类型 0:限制数量")
private byte type;
@ApiModelProperty("属性")
private String name;
@ApiModelProperty("最大")
private byte max;
@ApiModelProperty("最小")
private byte min;
}
@Data
@ApiModel("特殊指定-返回")
public static class OptionSpecial extends Show{
@ApiModelProperty("限制类型 0:选中选项数量达到最大后,内容非指定选项,则显示对应信息")
private byte type;
@ApiModelProperty("选项ID")
private List<Long> optionIds = new ArrayList<>();
@ApiModelProperty("选项序号")
private List<Byte> optionNums;
@ApiModelProperty("显示类型 0:图片")
private byte show;
@ApiModelProperty("内容")
private String content;
}
@ApiModel("倒计时配置")
@Data
public static class MesTimer {
@ApiModelProperty("限制类型 0:选中选项数量达到最大后,内容非指定选项,则显示对应信息")
private byte type;
@ApiModelProperty("量表")
private String code;
@ApiModelProperty("序号")
private byte sort;
@ApiModelProperty("时长")
private int time;
}
}

59
ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java

@ -1,13 +1,16 @@
package com.ccsens.ht.bean.vo;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ht.bean.po.HtPatientQuestionRecord;
import com.ccsens.ht.bean.po.HtQuestion;
import com.ccsens.ht.bean.po.HtQuestionIntroducer;
import com.ccsens.ht.bean.po.HtQuestionShow;
import com.ccsens.ht.uitl.Constant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.javassist.runtime.Desc;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
@ -46,13 +49,13 @@ public class QuestionVo {
super();
}
public Query(Question question, List<Option> options, List<Introduce> introduces, List<Record> records, int maxSort) {
public Query(Question question, List<Option> options, List<Introduce> introduces, List<Record> records, List<HtQuestionShow> shows, int maxSort) {
this.question = question;
this.introduces = introduces;
this.optionJsons = new ArrayList<>();
//方便后续把相同属性的选项放到一个对象的List中
Map<String, OptionJson> map = new HashMap<>();
if (CollectionUtil.isNotEmpty(options)) {
//方便后续把相同属性的选项放到一个对象的List中
Map<String, OptionJson> map = new HashMap<>();
options.forEach(option -> {
if (map.get(option.getName()) == null) {
OptionJson json = new OptionJson();
@ -68,7 +71,51 @@ public class QuestionVo {
this.records = records;
this.isLast = question.getSort().intValue() == maxSort;
this.isFirst = question.getSort().intValue() == 1;
if (CollectionUtil.isEmpty(shows)) {
return;
}
List<? extends QuestionShowVo.Show> questionShows = new ArrayList<>();
List<? extends QuestionShowVo.Show> optionShows = new ArrayList<>();
shows.forEach(show->{
if (StrUtil.isBlank(show.getParam())) {
return;
}
switch (show.getShowType()) {
case Constant.Ht.QuestionShow.SHOW_TYPE_LIMIT:
QuestionShowVo.OptionLimit limit = JSONObject.parseObject(show.getParam(), QuestionShowVo.OptionLimit.class);
limit.setShowType(Constant.Ht.QuestionShow.SHOW_TYPE_LIMIT);
// 对选项要求追加到对应name下
OptionJson optionJson = map.get(limit.getName());
if (optionJson == null) {
return;
}
if (optionJson.getOptionShows() == null) {
optionJson.setOptionShows(new ArrayList<>());
}
optionJson.getOptionShows().add(limit);
break;
case Constant.Ht.QuestionShow.SHOW_TYPE_SPECIAL:
QuestionShowVo.OptionSpecial special = JSONObject.parseObject(show.getParam(), QuestionShowVo.OptionSpecial.class);
special.setShowType(Constant.Ht.QuestionShow.SHOW_TYPE_SPECIAL);
if (special.getOptionNums() == null) {
break;
}
// 根据选项序号获取对应的选项ID
special.getOptionNums().forEach(num -> {
if (options.size() >= num) {
special.getOptionIds().add(options.get(num - 1).getId());
}
});
// 追加到题目信息里
question.getQuestionShows().add(special);
break;
default:
break;
}
});
}
}
@Data
@ -153,6 +200,8 @@ public class QuestionVo {
List<QuestionOption> relationQuestions = new ArrayList<>();
@ApiModelProperty("补充内容")
List<QuestionRecord> questionRecords;
@ApiModelProperty("补充显示内容")
List<? super QuestionShowVo.Show> questionShows = new ArrayList<>();
/**
* 将HtQuestion转化成Question
* @param question
@ -256,6 +305,8 @@ public class QuestionVo {
public static class OptionJson {
private String name;
private List<Option> options = new ArrayList<>();
@ApiModelProperty("补充显示内容")
List<? super QuestionShowVo.Show> optionShows = new ArrayList<>();
public void addOption(Option option){
options.add(option);
}

17
ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionShowDao.java

@ -0,0 +1,17 @@
package com.ccsens.ht.persist.dao;
import com.ccsens.ht.bean.po.HtQuestionShow;
import com.ccsens.ht.persist.mapper.HtQuestionShowMapper;
import java.util.List;
/**
* @author whj
*/
public interface HtQuestionShowDao extends HtQuestionShowMapper {
/**
* 批量添加题目显示
* @param showList
*/
void insertBatch(List<HtQuestionShow> showList);
}

30
ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionShowMapper.java

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

27
ht/src/main/java/com/ccsens/ht/service/ImportService.java

@ -57,6 +57,8 @@ public class ImportService implements IImportService {
private HtQuestionRecordOptionDao htQuestionRecordOptionDao;
@Resource
private HtQuestionOptionDescDao htQuestionOptionDescDao;
@Resource
private HtQuestionShowDao htQuestionShowDao;
@Override
@ -284,6 +286,7 @@ public class ImportService implements IImportService {
List<HtQuestionRecordOption> questionRecordOptionList = new ArrayList<>();
List<HtQuestionOptionDesc> optionDescList = new ArrayList<>();
List<Long> optionDescDelList = new ArrayList<>();
List<HtQuestionShow> showList = new ArrayList<>();
//记录那类型题是关联试题
Map<String, String> parentCode = new HashMap<>();
for(Object[] objs : questions) {
@ -294,7 +297,7 @@ public class ImportService implements IImportService {
int sort = objs.length > 3 && StringUtil.checkNum(String.valueOf(objs[3]), false) ? Integer.parseInt(String.valueOf(objs[3])) : 1;
String type = String.valueOf(objs[0]);
initData(evaluationCode, questionList, optionList, introduceList, ruleList, questionRecordList, questionRecordOptionList, optionDescList, optionDescDelList, parentCode, objs, sort, type);
initData(evaluationCode, questionList, showList, optionList, introduceList, ruleList, questionRecordList, questionRecordOptionList, optionDescList, optionDescDelList, parentCode, objs, sort, type);
}
if (!questionList.isEmpty()) {
@ -321,18 +324,29 @@ public class ImportService implements IImportService {
if (!optionDescList.isEmpty()) {
htQuestionOptionDescDao.insertBatch(optionDescList);
}
if (!showList.isEmpty()) {
htQuestionShowDao.insertBatch(showList);
}
}
/**
* 试题导入将obj[] 转换成 对应的data
*/
private void initData(String evaluationCode, List<HtQuestion> questionList, List<HtQuestionOption> optionList, List<HtQuestionIntroducer> introduceList, List<HtQuestionScoringRule> ruleList, List<HtQuestionRecord> questionRecordList, List<HtQuestionRecordOption> questionRecordOptionList, List<HtQuestionOptionDesc> optionDescList, List<Long> optionDescDelList, Map<String, String> parentCode, Object[] objs, int sort, String type) {
private void initData(String evaluationCode, List<HtQuestion> questionList, List<HtQuestionShow> showList, List<HtQuestionOption> optionList, List<HtQuestionIntroducer> introduceList, List<HtQuestionScoringRule> ruleList, List<HtQuestionRecord> questionRecordList, List<HtQuestionRecordOption> questionRecordOptionList, List<HtQuestionOptionDesc> optionDescList, List<Long> optionDescDelList, Map<String, String> parentCode, Object[] objs, int sort, String type) {
switch (type) {
case Constant.Import.EVALUATION_QUESTION :
HtQuestion question = initQuestion(objs, evaluationCode, sort);
question.setEvaluationCode(parentCode.getOrDefault(question.getParentCode(), question.getEvaluationCode()));
questionList.add(question);
break;
case Constant.Import.EVALUATION_QUESTION_SHOW :
if (CollectionUtil.isEmpty(questionList)) {
break;
}
HtQuestionShow questionShow = initQuestionShow(objs, sort);
questionShow.setQuestionId(questionList.get(questionList.size() - 1).getId());
showList.add(questionShow);
break;
case Constant.Import.EVALUATION_RELATION:
HtQuestion relationQuestion = initQuestion(objs, evaluationCode, sort);
relationQuestion.setEvaluationCode(parentCode.getOrDefault(relationQuestion.getParentCode(), relationQuestion.getEvaluationCode()));
@ -380,6 +394,15 @@ public class ImportService implements IImportService {
}
}
private HtQuestionShow initQuestionShow(Object[] objs, int sort) {
String content = (String)objs[2];
HtQuestionShow show = JSONObject.parseObject(content, HtQuestionShow.class);
show.setId(snowflake.nextId());
show.setSort((byte)sort);
show.setRemark(StrUtil.isEmpty(show.getRemark()) ? "" : show.getRemark());
return show;
}
/**
* 封装record option
* @param objs 一列

40
ht/src/main/java/com/ccsens/ht/service/QuestionService.java

@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ht.bean.dto.QuestionDto;
import com.ccsens.ht.bean.po.*;
import com.ccsens.ht.bean.vo.QuestionShowVo;
import com.ccsens.ht.bean.vo.QuestionVo;
import com.ccsens.ht.persist.dao.*;
import com.ccsens.ht.persist.mapper.*;
@ -32,6 +33,9 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
@ -69,6 +73,8 @@ public class QuestionService implements IQuestionService {
private HtPatientCanvasLineMapper patientCanvasLineMapper;
@Resource
private HtPatientReportRecordDescDao htPatientReportRecordDescDao;
@Resource
private HtQuestionShowDao htQuestionShowDao;
@ -83,6 +89,11 @@ public class QuestionService implements IQuestionService {
if (questionVo == null) {
throw new BaseException(CodeEnum.QUESTION_NOT_FOUND);
}
// 查询试题的其他显示相关的信息
HtQuestionShowExample showExample = new HtQuestionShowExample();
showExample.createCriteria().andQuestionIdEqualTo(questionVo.getId()).andShowNodeIn(Constant.Ht.QuestionShow.SHOW_NODE_RUNNING);
List<HtQuestionShow> shows = htQuestionShowDao.selectByExample(showExample);
//获取code信息及补充信息
QuestionVo.Report reportVo = htReportDao.queryReportAndRecord(questionVo.getParentCode(), query.getPatientReportId());
@ -159,7 +170,7 @@ public class QuestionService implements IQuestionService {
}
//封装返回
QuestionVo.Query data = new QuestionVo.Query(questionVo, optionList, introduceVos, recordVos,maxSort);
QuestionVo.Query data = new QuestionVo.Query(questionVo, optionList, introduceVos, recordVos, shows, maxSort);
data.setReport(reportVo);
log.info("试题信息:{}", data);
return data;
@ -275,7 +286,32 @@ public class QuestionService implements IQuestionService {
saveAnswerRecord(score, question);
//修改报告单是否完成一次测评
changeShowStatus(report, question);
changeShowStatus(report, question);
// 查询提交后要执行的任务
HtQuestionShowExample showExample = new HtQuestionShowExample();
showExample.createCriteria().andQuestionIdEqualTo(question.getId()).andShowNodeIn(Constant.Ht.QuestionShow.SHOW_NODE_RUN);
List<HtQuestionShow> shows = htQuestionShowDao.selectByExample(showExample);
if (CollectionUtil.isEmpty(shows)) {
return CodeEnum.SUCCESS;
}
log.info("执行提交后的任务");
ScheduledExecutorService executor = Executors.newScheduledThreadPool(shows.size());
shows.forEach(show -> {
switch (show.getShowType()) {
case Constant.Ht.QuestionShow.SHOW_TYPE_COUNT_DOWN:
QuestionShowVo.MesTimer mesTimer = JSONObject.parseObject(show.getParam(), QuestionShowVo.MesTimer.class);
executor.schedule(new Thread(new Runnable() {
@Override
public void run() {
// TODO 消息推送
}
}), mesTimer.getTime(), TimeUnit.SECONDS);
break;
default:
break;
}
});
return CodeEnum.SUCCESS;
}

24
ht/src/main/java/com/ccsens/ht/uitl/Constant.java

@ -28,6 +28,7 @@ public class Constant {
public final static String EVALUATION_RECORD = "其他记录";
public final static String EVALUATION_QUESTION = "题目";
public final static String EVALUATION_QUESTION_SHOW = "题目显示";
public final static String EVALUATION_OPTION = "选项";
public final static String EVALUATION_RELATION = "关联题目";
public final static String EVALUATION_PARSE = "解析";
@ -150,6 +151,29 @@ public class Constant {
default: return "其他";
}
}
public static final class QuestionShow{
/**结点:提交后*/
public static final byte SHOW_NODE_SUBMIT = 0;
/**结点:选择时*/
public static final byte SHOW_NODE_CHOOSING = 1;
/**结点:选择结束*/
public static final byte SHOW_NODE_CHOSE = 2;
/**类型:倒计时*/
public static final byte SHOW_TYPE_COUNT_DOWN = 0;
/**类型:限制选项数量*/
public static final byte SHOW_TYPE_LIMIT = 1;
/**类型:选中某些指定选项执行操作*/
public static final byte SHOW_TYPE_SPECIAL = 2;
public static final List<Byte> SHOW_NODE_RUNNING = new ArrayList<>();
public static final List<Byte> SHOW_NODE_RUN = new ArrayList<>();
static {
SHOW_NODE_RUNNING.add(SHOW_NODE_CHOOSING);
SHOW_NODE_RUNNING.add(SHOW_NODE_CHOSE);
SHOW_NODE_RUN.add(SHOW_NODE_SUBMIT);
}
}
public static final class Option{
public final static String NUMBER_SCORE = "numberScore";
public final static String NUMBER_TIME = "numberTime";

4
ht/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring:
profiles:
active: test
include: common, util-test
active: dev
include: common, util-dev

13
ht/src/main/resources/mapper_dao/HtQuestionShowDao.xml

@ -0,0 +1,13 @@
<?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.ht.persist.dao.HtQuestionShowDao">
<insert id="insertBatch">
replace into t_ht_question_show(id, question_id,show_type,show_node,param, sort, remark) values
<foreach collection="list" item="show" separator=",">
(
#{show.id},#{show.questionId},#{show.showType},#{show.showNode},#{show.param},#{show.sort},#{show.remark}
)
</foreach>
</insert>
</mapper>

291
ht/src/main/resources/mapper_raw/HtQuestionShowMapper.xml

@ -0,0 +1,291 @@
<?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.ht.persist.mapper.HtQuestionShowMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtQuestionShow">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="question_id" jdbcType="BIGINT" property="questionId" />
<result column="show_type" jdbcType="TINYINT" property="showType" />
<result column="show_node" jdbcType="TINYINT" property="showNode" />
<result column="param" jdbcType="VARCHAR" property="param" />
<result column="sort" jdbcType="TINYINT" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
</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, question_id, show_type, show_node, param, sort, remark, create_time, update_time,
is_del
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionShowExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_ht_question_show
<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_ht_question_show
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_ht_question_show
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionShowExample">
delete from t_ht_question_show
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ht.bean.po.HtQuestionShow">
insert into t_ht_question_show (id, question_id, show_type,
show_node, param, sort,
remark, create_time, update_time,
is_del)
values (#{id,jdbcType=BIGINT}, #{questionId,jdbcType=BIGINT}, #{showType,jdbcType=TINYINT},
#{showNode,jdbcType=TINYINT}, #{param,jdbcType=VARCHAR}, #{sort,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtQuestionShow">
insert into t_ht_question_show
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="questionId != null">
question_id,
</if>
<if test="showType != null">
show_type,
</if>
<if test="showNode != null">
show_node,
</if>
<if test="param != null">
param,
</if>
<if test="sort != null">
sort,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDel != null">
is_del,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="questionId != null">
#{questionId,jdbcType=BIGINT},
</if>
<if test="showType != null">
#{showType,jdbcType=TINYINT},
</if>
<if test="showNode != null">
#{showNode,jdbcType=TINYINT},
</if>
<if test="param != null">
#{param,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=TINYINT},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionShowExample" resultType="java.lang.Long">
select count(*) from t_ht_question_show
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_ht_question_show
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.questionId != null">
question_id = #{record.questionId,jdbcType=BIGINT},
</if>
<if test="record.showType != null">
show_type = #{record.showType,jdbcType=TINYINT},
</if>
<if test="record.showNode != null">
show_node = #{record.showNode,jdbcType=TINYINT},
</if>
<if test="record.param != null">
param = #{record.param,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=TINYINT},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_ht_question_show
set id = #{record.id,jdbcType=BIGINT},
question_id = #{record.questionId,jdbcType=BIGINT},
show_type = #{record.showType,jdbcType=TINYINT},
show_node = #{record.showNode,jdbcType=TINYINT},
param = #{record.param,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ht.bean.po.HtQuestionShow">
update t_ht_question_show
<set>
<if test="questionId != null">
question_id = #{questionId,jdbcType=BIGINT},
</if>
<if test="showType != null">
show_type = #{showType,jdbcType=TINYINT},
</if>
<if test="showNode != null">
show_node = #{showNode,jdbcType=TINYINT},
</if>
<if test="param != null">
param = #{param,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=TINYINT},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ht.bean.po.HtQuestionShow">
update t_ht_question_show
set question_id = #{questionId,jdbcType=BIGINT},
show_type = #{showType,jdbcType=TINYINT},
show_node = #{showNode,jdbcType=TINYINT},
param = #{param,jdbcType=VARCHAR},
sort = #{sort,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

147
util/src/test/java/com/ccsens/util/JsonTest.java

@ -0,0 +1,147 @@
package com.ccsens.util;
import com.alibaba.fastjson.JSONObject;
import org.junit.Test;
import java.io.Serializable;
import java.util.Date;
/**
* @description:
* @author: whj
* @time: 2021/6/10 14:41
*/
public class JsonTest {
@Test
public void test01(){
String content = "{\"showType\":1,\"showNode\":1,\"param\":{\"type\":0,\"name\":\"one\",\"max\":2,\"min\":2}}";
JSONObject.parseObject("{\"showType\":0,\"showNode\":0,\"param\":{\"type\":\"0\",\"code\":\"AVLT\",\"sort\":4,\"time\":300}}");
HtQuestionShow show = JSONObject.parseObject(content, HtQuestionShow.class);
System.out.println(show);
}
public static class HtQuestionShow implements Serializable {
private Long id;
private Long questionId;
private Byte showType;
private Byte showNode;
private String param;
private Byte sort;
private String remark;
private Date createTime;
private Date updateTime;
private Byte isDel;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getQuestionId() {
return questionId;
}
public void setQuestionId(Long questionId) {
this.questionId = questionId;
}
public Byte getShowType() {
return showType;
}
public void setShowType(Byte showType) {
this.showType = showType;
}
public Byte getShowNode() {
return showNode;
}
public void setShowNode(Byte showNode) {
this.showNode = showNode;
}
public String getParam() {
return param;
}
public void setParam(String param) {
this.param = param == null ? null : param.trim();
}
public Byte getSort() {
return sort;
}
public void setSort(Byte sort) {
this.sort = sort;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getIsDel() {
return isDel;
}
public void setIsDel(Byte isDel) {
this.isDel = isDel;
}
@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(", questionId=").append(questionId);
sb.append(", showType=").append(showType);
sb.append(", showNode=").append(showNode);
sb.append(", param=").append(param);
sb.append(", sort=").append(sort);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append("]");
return sb.toString();
}
}
}
Loading…
Cancel
Save