Browse Source

20210224保存试题添加类型

recovery
zy_Java 4 years ago
parent
commit
d72780e02f
  1. 2
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  2. 11
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java
  3. 60
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java
  4. 25
      tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml

2
tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java

@ -69,6 +69,8 @@ public class PatientDto {
private Long testQuestionsId; private Long testQuestionsId;
@ApiModelProperty("内容") @ApiModelProperty("内容")
private String contents; private String contents;
@ApiModelProperty("内容的类型 默认为0 0普通的选项或填写的内容,1关联的其他信息,2题目的说明信息")
private byte contentsType = 0;
} }
@Data @Data
@ApiModel("查询的患者基本信息") @ApiModel("查询的患者基本信息")

11
tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java

@ -24,6 +24,8 @@ public class PatientRecord implements Serializable {
private Byte recStatus; private Byte recStatus;
private Byte contentsType;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -106,6 +108,14 @@ public class PatientRecord implements Serializable {
this.recStatus = recStatus; this.recStatus = recStatus;
} }
public Byte getContentsType() {
return contentsType;
}
public void setContentsType(Byte contentsType) {
this.contentsType = contentsType;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -122,6 +132,7 @@ public class PatientRecord implements Serializable {
sb.append(", createdAt=").append(createdAt); sb.append(", createdAt=").append(createdAt);
sb.append(", updateAt=").append(updateAt); sb.append(", updateAt=").append(updateAt);
sb.append(", recStatus=").append(recStatus); sb.append(", recStatus=").append(recStatus);
sb.append(", contentsType=").append(contentsType);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }

60
tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java

@ -714,6 +714,66 @@ public class PatientRecordExample {
addCriterion("rec_status not between", value1, value2, "recStatus"); addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andContentsTypeIsNull() {
addCriterion("contents_type is null");
return (Criteria) this;
}
public Criteria andContentsTypeIsNotNull() {
addCriterion("contents_type is not null");
return (Criteria) this;
}
public Criteria andContentsTypeEqualTo(Byte value) {
addCriterion("contents_type =", value, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeNotEqualTo(Byte value) {
addCriterion("contents_type <>", value, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeGreaterThan(Byte value) {
addCriterion("contents_type >", value, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("contents_type >=", value, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeLessThan(Byte value) {
addCriterion("contents_type <", value, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeLessThanOrEqualTo(Byte value) {
addCriterion("contents_type <=", value, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeIn(List<Byte> values) {
addCriterion("contents_type in", values, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeNotIn(List<Byte> values) {
addCriterion("contents_type not in", values, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeBetween(Byte value1, Byte value2) {
addCriterion("contents_type between", value1, value2, "contentsType");
return (Criteria) this;
}
public Criteria andContentsTypeNotBetween(Byte value1, Byte value2) {
addCriterion("contents_type not between", value1, value2, "contentsType");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

25
tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml

@ -12,6 +12,7 @@
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" /> <result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> <result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="contents_type" jdbcType="TINYINT" property="contentsType" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -73,7 +74,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, patient_id, test_questions_id, contents, user_id, collect_time, time_slot, created_at, id, patient_id, test_questions_id, contents, user_id, collect_time, time_slot, created_at,
update_at, rec_status update_at, rec_status, contents_type
</sql> </sql>
<select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.PatientRecordExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.PatientRecordExample" resultMap="BaseResultMap">
select select
@ -109,11 +110,11 @@
insert into t_patient_record (id, patient_id, test_questions_id, insert into t_patient_record (id, patient_id, test_questions_id,
contents, user_id, collect_time, contents, user_id, collect_time,
time_slot, created_at, update_at, time_slot, created_at, update_at,
rec_status) rec_status, contents_type)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{testQuestionsId,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{testQuestionsId,jdbcType=BIGINT},
#{contents,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{collectTime,jdbcType=INTEGER}, #{contents,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{collectTime,jdbcType=INTEGER},
#{timeSlot,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP}, #{timeSlot,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT}) #{recStatus,jdbcType=TINYINT}, #{contentsType,jdbcType=TINYINT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.PatientRecord"> <insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.PatientRecord">
insert into t_patient_record insert into t_patient_record
@ -148,6 +149,9 @@
<if test="recStatus != null"> <if test="recStatus != null">
rec_status, rec_status,
</if> </if>
<if test="contentsType != null">
contents_type,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -180,6 +184,9 @@
<if test="recStatus != null"> <if test="recStatus != null">
#{recStatus,jdbcType=TINYINT}, #{recStatus,jdbcType=TINYINT},
</if> </if>
<if test="contentsType != null">
#{contentsType,jdbcType=TINYINT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.tcm.bean.po.PatientRecordExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.tcm.bean.po.PatientRecordExample" resultType="java.lang.Long">
@ -221,6 +228,9 @@
<if test="record.recStatus != null"> <if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT}, rec_status = #{record.recStatus,jdbcType=TINYINT},
</if> </if>
<if test="record.contentsType != null">
contents_type = #{record.contentsType,jdbcType=TINYINT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -237,7 +247,8 @@
time_slot = #{record.timeSlot,jdbcType=TIMESTAMP}, time_slot = #{record.timeSlot,jdbcType=TIMESTAMP},
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, created_at = #{record.createdAt,jdbcType=TIMESTAMP},
update_at = #{record.updateAt,jdbcType=TIMESTAMP}, update_at = #{record.updateAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT} rec_status = #{record.recStatus,jdbcType=TINYINT},
contents_type = #{record.contentsType,jdbcType=TINYINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -272,6 +283,9 @@
<if test="recStatus != null"> <if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT}, rec_status = #{recStatus,jdbcType=TINYINT},
</if> </if>
<if test="contentsType != null">
contents_type = #{contentsType,jdbcType=TINYINT},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -285,7 +299,8 @@
time_slot = #{timeSlot,jdbcType=TIMESTAMP}, time_slot = #{timeSlot,jdbcType=TIMESTAMP},
created_at = #{createdAt,jdbcType=TIMESTAMP}, created_at = #{createdAt,jdbcType=TIMESTAMP},
update_at = #{updateAt,jdbcType=TIMESTAMP}, update_at = #{updateAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT} rec_status = #{recStatus,jdbcType=TINYINT},
contents_type = #{contentsType,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
Loading…
Cancel
Save