Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zy_Java 4 years ago
parent
commit
d299a7f660
  1. 23
      tcm/src/main/java/com/ccsens/tcm/bean/po/Question.java
  2. 121
      tcm/src/main/java/com/ccsens/tcm/bean/po/QuestionExample.java
  3. 10
      tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java
  4. 14
      tcm/src/main/java/com/ccsens/tcm/service/ImportService.java
  5. 6
      tcm/src/main/resources/application-dev.yml
  6. 4
      tcm/src/main/resources/application.yml
  7. 14
      tcm/src/main/resources/mapper_dao/QuestionDao.xml
  8. 48
      tcm/src/main/resources/mapper_raw/QuestionMapper.xml

23
tcm/src/main/java/com/ccsens/tcm/bean/po/Question.java

@ -1,6 +1,7 @@
package com.ccsens.tcm.bean.po;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class Question implements Serializable {
@ -16,6 +17,10 @@ public class Question implements Serializable {
private Byte type;
private BigDecimal referenceLower;
private BigDecimal referenceUpper;
private Long relevanceOptionId;
private Byte searchCriteria;
@ -80,6 +85,22 @@ public class Question implements Serializable {
this.type = type;
}
public BigDecimal getReferenceLower() {
return referenceLower;
}
public void setReferenceLower(BigDecimal referenceLower) {
this.referenceLower = referenceLower;
}
public BigDecimal getReferenceUpper() {
return referenceUpper;
}
public void setReferenceUpper(BigDecimal referenceUpper) {
this.referenceUpper = referenceUpper;
}
public Long getRelevanceOptionId() {
return relevanceOptionId;
}
@ -148,6 +169,8 @@ public class Question implements Serializable {
sb.append(", sort=").append(sort);
sb.append(", units=").append(units);
sb.append(", type=").append(type);
sb.append(", referenceLower=").append(referenceLower);
sb.append(", referenceUpper=").append(referenceUpper);
sb.append(", relevanceOptionId=").append(relevanceOptionId);
sb.append(", searchCriteria=").append(searchCriteria);
sb.append(", remark=").append(remark);

121
tcm/src/main/java/com/ccsens/tcm/bean/po/QuestionExample.java

@ -1,5 +1,6 @@
package com.ccsens.tcm.bean.po;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -495,6 +496,126 @@ public class QuestionExample {
return (Criteria) this;
}
public Criteria andReferenceLowerIsNull() {
addCriterion("reference_lower is null");
return (Criteria) this;
}
public Criteria andReferenceLowerIsNotNull() {
addCriterion("reference_lower is not null");
return (Criteria) this;
}
public Criteria andReferenceLowerEqualTo(BigDecimal value) {
addCriterion("reference_lower =", value, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerNotEqualTo(BigDecimal value) {
addCriterion("reference_lower <>", value, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerGreaterThan(BigDecimal value) {
addCriterion("reference_lower >", value, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("reference_lower >=", value, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerLessThan(BigDecimal value) {
addCriterion("reference_lower <", value, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerLessThanOrEqualTo(BigDecimal value) {
addCriterion("reference_lower <=", value, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerIn(List<BigDecimal> values) {
addCriterion("reference_lower in", values, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerNotIn(List<BigDecimal> values) {
addCriterion("reference_lower not in", values, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("reference_lower between", value1, value2, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceLowerNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("reference_lower not between", value1, value2, "referenceLower");
return (Criteria) this;
}
public Criteria andReferenceUpperIsNull() {
addCriterion("reference_upper is null");
return (Criteria) this;
}
public Criteria andReferenceUpperIsNotNull() {
addCriterion("reference_upper is not null");
return (Criteria) this;
}
public Criteria andReferenceUpperEqualTo(BigDecimal value) {
addCriterion("reference_upper =", value, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperNotEqualTo(BigDecimal value) {
addCriterion("reference_upper <>", value, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperGreaterThan(BigDecimal value) {
addCriterion("reference_upper >", value, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("reference_upper >=", value, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperLessThan(BigDecimal value) {
addCriterion("reference_upper <", value, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperLessThanOrEqualTo(BigDecimal value) {
addCriterion("reference_upper <=", value, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperIn(List<BigDecimal> values) {
addCriterion("reference_upper in", values, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperNotIn(List<BigDecimal> values) {
addCriterion("reference_upper not in", values, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("reference_upper between", value1, value2, "referenceUpper");
return (Criteria) this;
}
public Criteria andReferenceUpperNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("reference_upper not between", value1, value2, "referenceUpper");
return (Criteria) this;
}
public Criteria andRelevanceOptionIdIsNull() {
addCriterion("relevance_option_id is null");
return (Criteria) this;

10
tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java

@ -3,6 +3,8 @@ package com.ccsens.tcm.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
@ -58,6 +60,10 @@ public class QuestionVo {
private Byte searchCriteria;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("参考范围 下限")
private BigDecimal referenceLower;
@ApiModelProperty("参考范围 上限")
private BigDecimal referenceUpper;
@ApiModelProperty("选项信息")
private List<QuestionOptionVo> optionVos;
}
@ -140,6 +146,10 @@ public class QuestionVo {
private String units;
@ApiModelProperty("类型 1单行文本,2多行文本,3单选,4多选,5下拉菜单,6日期,7图片(文件),8单选+其他,9多选+其他,10下拉+其他,11多选+其他+说明,12单选+关联其他内容 13数字类型")
private byte type;
@ApiModelProperty("参考范围 下限")
private BigDecimal referenceLower;
@ApiModelProperty("参考范围 上限")
private BigDecimal referenceUpper;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("答题记录id")

14
tcm/src/main/java/com/ccsens/tcm/service/ImportService.java

@ -22,6 +22,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
/**
@ -220,6 +221,19 @@ public class ImportService implements IImportService {
question.setUnits(objs.length>5 && StringUtils.isEmpty(objs[5]) ? Constant.STRING_DEFAULT : String.valueOf(objs[5]));
question.setSearchCriteria(objs.length>6 && StringUtil.checkNum(String.valueOf(objs[6]), false) ? Byte.parseByte(String.valueOf(objs[6])) : Constant.Question.SEARCH_CRITERIA);
question.setRemark(objs.length > 8 && !StringUtils.isEmpty(objs[8]) ? (String) objs[8] : Constant.STRING_DEFAULT);
int referenceIndex = 9;
if (objs.length > referenceIndex && !StringUtils.isEmpty(objs[referenceIndex])) {
String references = (String) objs[referenceIndex];
String[] split = references.split("--");
boolean lower = split.length > 0 && StringUtil.isMatch(split[0], StringUtil.NUMBER_DOUBLE) ;
if (lower) {
question.setReferenceLower(new BigDecimal(split[0]));
}
boolean upper = split.length > 1 && StringUtil.isMatch(split[1], StringUtil.NUMBER_DOUBLE);
if (upper) {
question.setReferenceUpper(new BigDecimal(split[1]));
}
}
question.setRelevanceOptionId(optionId == null ? 0 : optionId);
log.info("导入试题:{}", question);

6
tcm/src/main/resources/application-dev.yml

@ -10,10 +10,10 @@ spring:
rabbitmq:
# host: 192.144.182.42
# host: test.tall.wiki
host: 127.0.0.1
password: guest
host: 192.168.31.13
password: 111111
port: 5672
username: guest
username: admin
redis:
database: 0
host: 127.0.0.1

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

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

14
tcm/src/main/resources/mapper_dao/QuestionDao.xml

@ -19,12 +19,14 @@
<insert id="insertBatch">
replace into t_question (id, question, code,
sort, units, type,
relevance_option_id, search_criteria, remark)
relevance_option_id, search_criteria, remark,
reference_lower, reference_upper)
values
<foreach collection="list" item="question" separator=",">
(#{question.id,jdbcType=BIGINT}, #{question.question,jdbcType=VARCHAR}, #{question.code,jdbcType=VARCHAR},
#{question.sort,jdbcType=INTEGER}, #{question.units,jdbcType=VARCHAR}, #{question.type,jdbcType=TINYINT},
#{question.relevanceOptionId,jdbcType=BIGINT}, #{question.searchCriteria,jdbcType=TINYINT}, #{question.remark,jdbcType=VARCHAR})
#{question.relevanceOptionId,jdbcType=BIGINT}, #{question.searchCriteria,jdbcType=TINYINT},
#{question.remark,jdbcType=VARCHAR},#{question.referenceLower,jdbcType=DECIMAL},#{question.referenceUpper,jdbcType=DECIMAL})
</foreach>
</insert>
@ -38,6 +40,8 @@
<result column="qrelevance_option_id" jdbcType="BIGINT" property="relevanceOptionId" />
<result column="qsearch_criteria" jdbcType="TINYINT" property="searchCriteria" />
<result column="qremark" jdbcType="VARCHAR" property="remark" />
<result column="referenceLower" jdbcType="DECIMAL" property="referenceLower" />
<result column="referenceUpper" jdbcType="DECIMAL" property="referenceUpper" />
<collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$QuestionOptionVo">
<id column="oid" jdbcType="BIGINT" property="id" />
<result column="oquestion_id" jdbcType="BIGINT" property="questionId" />
@ -59,6 +63,8 @@
q.relevance_option_id as qrelevance_option_id,
q.search_criteria as qsearch_criteria,
q.remark as qremark,
q.reference_lower as referenceLower,
q.reference_upper as referenceUpper,
o.id as oid,
o.question_id as oquestion_id,
o.sort as osort,
@ -105,6 +111,8 @@
<result column="qsort" jdbcType="INTEGER" property="sort" />
<result column="qunits" jdbcType="VARCHAR" property="units" />
<result column="qtype" jdbcType="TINYINT" property="type" />
<result column="referenceLower" jdbcType="DECIMAL" property="referenceLower" />
<result column="referenceUpper" jdbcType="DECIMAL" property="referenceUpper" />
<result column="qremark" jdbcType="VARCHAR" property="remark" />
<result column="recordId" jdbcType="VARCHAR" property="recordId" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
@ -133,6 +141,8 @@
q.sort as qsort,
q.units as qunits,
q.type as qtype,
q.reference_lower as referenceLower,
q.reference_upper as referenceUpper,
q.remark as qremark,
o.id as oid,
o.sort as osort,

48
tcm/src/main/resources/mapper_raw/QuestionMapper.xml

@ -8,6 +8,8 @@
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="units" jdbcType="VARCHAR" property="units" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="reference_lower" jdbcType="DECIMAL" property="referenceLower" />
<result column="reference_upper" jdbcType="DECIMAL" property="referenceUpper" />
<result column="relevance_option_id" jdbcType="BIGINT" property="relevanceOptionId" />
<result column="search_criteria" jdbcType="TINYINT" property="searchCriteria" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
@ -75,8 +77,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, question, code, sort, units, type, relevance_option_id, search_criteria, remark,
operator, created_at, updated_at, rec_status
id, question, code, sort, units, type, reference_lower, reference_upper, relevance_option_id,
search_criteria, remark, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.QuestionExample" resultMap="BaseResultMap">
select
@ -111,14 +113,16 @@
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.Question">
insert into t_question (id, question, code,
sort, units, type,
relevance_option_id, search_criteria, remark,
operator, created_at, updated_at,
rec_status)
reference_lower, reference_upper, relevance_option_id,
search_criteria, remark, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{question,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{units,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
#{relevanceOptionId,jdbcType=BIGINT}, #{searchCriteria,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{referenceLower,jdbcType=DECIMAL}, #{referenceUpper,jdbcType=DECIMAL}, #{relevanceOptionId,jdbcType=BIGINT},
#{searchCriteria,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.Question">
insert into t_question
@ -141,6 +145,12 @@
<if test="type != null">
type,
</if>
<if test="referenceLower != null">
reference_lower,
</if>
<if test="referenceUpper != null">
reference_upper,
</if>
<if test="relevanceOptionId != null">
relevance_option_id,
</if>
@ -182,6 +192,12 @@
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="referenceLower != null">
#{referenceLower,jdbcType=DECIMAL},
</if>
<if test="referenceUpper != null">
#{referenceUpper,jdbcType=DECIMAL},
</if>
<if test="relevanceOptionId != null">
#{relevanceOptionId,jdbcType=BIGINT},
</if>
@ -232,6 +248,12 @@
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.referenceLower != null">
reference_lower = #{record.referenceLower,jdbcType=DECIMAL},
</if>
<if test="record.referenceUpper != null">
reference_upper = #{record.referenceUpper,jdbcType=DECIMAL},
</if>
<if test="record.relevanceOptionId != null">
relevance_option_id = #{record.relevanceOptionId,jdbcType=BIGINT},
</if>
@ -266,6 +288,8 @@
sort = #{record.sort,jdbcType=INTEGER},
units = #{record.units,jdbcType=VARCHAR},
type = #{record.type,jdbcType=TINYINT},
reference_lower = #{record.referenceLower,jdbcType=DECIMAL},
reference_upper = #{record.referenceUpper,jdbcType=DECIMAL},
relevance_option_id = #{record.relevanceOptionId,jdbcType=BIGINT},
search_criteria = #{record.searchCriteria,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR},
@ -295,6 +319,12 @@
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="referenceLower != null">
reference_lower = #{referenceLower,jdbcType=DECIMAL},
</if>
<if test="referenceUpper != null">
reference_upper = #{referenceUpper,jdbcType=DECIMAL},
</if>
<if test="relevanceOptionId != null">
relevance_option_id = #{relevanceOptionId,jdbcType=BIGINT},
</if>
@ -326,6 +356,8 @@
sort = #{sort,jdbcType=INTEGER},
units = #{units,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
reference_lower = #{referenceLower,jdbcType=DECIMAL},
reference_upper = #{referenceUpper,jdbcType=DECIMAL},
relevance_option_id = #{relevanceOptionId,jdbcType=BIGINT},
search_criteria = #{searchCriteria,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},

Loading…
Cancel
Save