Browse Source

创建po

recovery
wang1007152140 5 years ago
parent
commit
9a0a902fc7
  1. 24
      tcm/src/main/java/com/ccsens/tcm/api/PatientController.java
  2. 27
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  3. 13
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java
  4. 64
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java
  5. 23
      tcm/src/main/java/com/ccsens/tcm/bean/po/ReportCode.java
  6. 116
      tcm/src/main/java/com/ccsens/tcm/bean/po/ReportCodeExample.java
  7. 26
      tcm/src/main/java/com/ccsens/tcm/persist/mapper/PatientRecordMapper.java
  8. 10
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  9. 31
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  10. 57
      tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml
  11. 65
      tcm/src/main/resources/mapper_raw/ReportCodeMapper.xml

24
tcm/src/main/java/com/ccsens/tcm/api/PatientController.java

@ -1,14 +1,38 @@
package com.ccsens.tcm.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.service.IPatientService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
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;
/**
* @author wang
*/
@Api(tags = "患者相关接口", description = "患者相关接口")
@RestController
@RequestMapping("/patient")
@Slf4j
public class PatientController {
// disease_time
private IPatientService patientService;
@MustLogin
@ApiOperation(value = "添加患者基本信息", notes = "zy:添加一个活动公告,本平台默认审核通过")
@RequestMapping(value = "/savePatientMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse saveActivity(@ApiParam @Validated @RequestBody QueryDto<PatientDto.SavePatient> params) {
log.info("添加患者基本信息:{}",params);
patientService.savePatient(params.getParam(),params.getUserId());
log.info("添加患者基本成功");
return JsonResponse.newInstance().ok();
}
}

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

@ -0,0 +1,27 @@
package com.ccsens.tcm.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import sun.awt.ConstrainableGraphics;
import java.util.Date;
/**
* @author wang
*/
@Data
public class PatientDto {
@Data
@ApiModel("保存患者基本信息")
public static class SavePatient {
@ApiModelProperty("住院号")
private String hospitalization;
@ApiModelProperty("对照组id")
private Integer inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")
private Byte inputStatus;
@ApiModelProperty("医院id")
private Integer hospitalId;
}
}

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

@ -3,7 +3,7 @@ package com.ccsens.tcm.bean.po;
import java.io.Serializable;
import java.util.Date;
public class PatientRecord implements Serializable {
public class patientRecord implements Serializable {
private Long id;
private Integer patientId;
@ -16,6 +16,8 @@ public class PatientRecord implements Serializable {
private Integer collectTime;
private Date timeSlot;
private Date createdAt;
private Date updateAt;
@ -72,6 +74,14 @@ public class PatientRecord implements Serializable {
this.collectTime = collectTime;
}
public Date getTimeSlot() {
return timeSlot;
}
public void setTimeSlot(Date timeSlot) {
this.timeSlot = timeSlot;
}
public Date getCreatedAt() {
return createdAt;
}
@ -108,6 +118,7 @@ public class PatientRecord implements Serializable {
sb.append(", contents=").append(contents);
sb.append(", userId=").append(userId);
sb.append(", collectTime=").append(collectTime);
sb.append(", timeSlot=").append(timeSlot);
sb.append(", createdAt=").append(createdAt);
sb.append(", updateAt=").append(updateAt);
sb.append(", recStatus=").append(recStatus);

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

@ -4,14 +4,14 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class PatientRecordExample {
public class patientRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PatientRecordExample() {
public patientRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
@ -475,6 +475,66 @@ public class PatientRecordExample {
return (Criteria) this;
}
public Criteria andTimeSlotIsNull() {
addCriterion("time_slot is null");
return (Criteria) this;
}
public Criteria andTimeSlotIsNotNull() {
addCriterion("time_slot is not null");
return (Criteria) this;
}
public Criteria andTimeSlotEqualTo(Date value) {
addCriterion("time_slot =", value, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotNotEqualTo(Date value) {
addCriterion("time_slot <>", value, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotGreaterThan(Date value) {
addCriterion("time_slot >", value, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotGreaterThanOrEqualTo(Date value) {
addCriterion("time_slot >=", value, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotLessThan(Date value) {
addCriterion("time_slot <", value, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotLessThanOrEqualTo(Date value) {
addCriterion("time_slot <=", value, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotIn(List<Date> values) {
addCriterion("time_slot in", values, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotNotIn(List<Date> values) {
addCriterion("time_slot not in", values, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotBetween(Date value1, Date value2) {
addCriterion("time_slot between", value1, value2, "timeSlot");
return (Criteria) this;
}
public Criteria andTimeSlotNotBetween(Date value1, Date value2) {
addCriterion("time_slot not between", value1, value2, "timeSlot");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;

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

@ -10,7 +10,7 @@ public class ReportCode implements Serializable {
private String name;
private String parentId;
private String parentCode;
private Byte must;
@ -20,6 +20,8 @@ public class ReportCode implements Serializable {
private String remark;
private Byte reportType;
private Long operator;
private Date createdAt;
@ -54,12 +56,12 @@ public class ReportCode implements Serializable {
this.name = name == null ? null : name.trim();
}
public String getParentId() {
return parentId;
public String getParentCode() {
return parentCode;
}
public void setParentId(String parentId) {
this.parentId = parentId == null ? null : parentId.trim();
public void setParentCode(String parentCode) {
this.parentCode = parentCode == null ? null : parentCode.trim();
}
public Byte getMust() {
@ -94,6 +96,14 @@ public class ReportCode implements Serializable {
this.remark = remark == null ? null : remark.trim();
}
public Byte getReportType() {
return reportType;
}
public void setReportType(Byte reportType) {
this.reportType = reportType;
}
public Long getOperator() {
return operator;
}
@ -135,11 +145,12 @@ public class ReportCode implements Serializable {
sb.append(", id=").append(id);
sb.append(", code=").append(code);
sb.append(", name=").append(name);
sb.append(", parentId=").append(parentId);
sb.append(", parentCode=").append(parentCode);
sb.append(", must=").append(must);
sb.append(", level=").append(level);
sb.append(", sort=").append(sort);
sb.append(", remark=").append(remark);
sb.append(", reportType=").append(reportType);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);

116
tcm/src/main/java/com/ccsens/tcm/bean/po/ReportCodeExample.java

@ -305,73 +305,73 @@ public class ReportCodeExample {
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
public Criteria andParentCodeIsNull() {
addCriterion("parent_code is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parent_id is not null");
public Criteria andParentCodeIsNotNull() {
addCriterion("parent_code is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(String value) {
addCriterion("parent_id =", value, "parentId");
public Criteria andParentCodeEqualTo(String value) {
addCriterion("parent_code =", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(String value) {
addCriterion("parent_id <>", value, "parentId");
public Criteria andParentCodeNotEqualTo(String value) {
addCriterion("parent_code <>", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(String value) {
addCriterion("parent_id >", value, "parentId");
public Criteria andParentCodeGreaterThan(String value) {
addCriterion("parent_code >", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(String value) {
addCriterion("parent_id >=", value, "parentId");
public Criteria andParentCodeGreaterThanOrEqualTo(String value) {
addCriterion("parent_code >=", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdLessThan(String value) {
addCriterion("parent_id <", value, "parentId");
public Criteria andParentCodeLessThan(String value) {
addCriterion("parent_code <", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(String value) {
addCriterion("parent_id <=", value, "parentId");
public Criteria andParentCodeLessThanOrEqualTo(String value) {
addCriterion("parent_code <=", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdLike(String value) {
addCriterion("parent_id like", value, "parentId");
public Criteria andParentCodeLike(String value) {
addCriterion("parent_code like", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdNotLike(String value) {
addCriterion("parent_id not like", value, "parentId");
public Criteria andParentCodeNotLike(String value) {
addCriterion("parent_code not like", value, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdIn(List<String> values) {
addCriterion("parent_id in", values, "parentId");
public Criteria andParentCodeIn(List<String> values) {
addCriterion("parent_code in", values, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<String> values) {
addCriterion("parent_id not in", values, "parentId");
public Criteria andParentCodeNotIn(List<String> values) {
addCriterion("parent_code not in", values, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdBetween(String value1, String value2) {
addCriterion("parent_id between", value1, value2, "parentId");
public Criteria andParentCodeBetween(String value1, String value2) {
addCriterion("parent_code between", value1, value2, "parentCode");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(String value1, String value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
public Criteria andParentCodeNotBetween(String value1, String value2) {
addCriterion("parent_code not between", value1, value2, "parentCode");
return (Criteria) this;
}
@ -625,6 +625,66 @@ public class ReportCodeExample {
return (Criteria) this;
}
public Criteria andReportTypeIsNull() {
addCriterion("report_type is null");
return (Criteria) this;
}
public Criteria andReportTypeIsNotNull() {
addCriterion("report_type is not null");
return (Criteria) this;
}
public Criteria andReportTypeEqualTo(Byte value) {
addCriterion("report_type =", value, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeNotEqualTo(Byte value) {
addCriterion("report_type <>", value, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeGreaterThan(Byte value) {
addCriterion("report_type >", value, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("report_type >=", value, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeLessThan(Byte value) {
addCriterion("report_type <", value, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeLessThanOrEqualTo(Byte value) {
addCriterion("report_type <=", value, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeIn(List<Byte> values) {
addCriterion("report_type in", values, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeNotIn(List<Byte> values) {
addCriterion("report_type not in", values, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeBetween(Byte value1, Byte value2) {
addCriterion("report_type between", value1, value2, "reportType");
return (Criteria) this;
}
public Criteria andReportTypeNotBetween(Byte value1, Byte value2) {
addCriterion("report_type not between", value1, value2, "reportType");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;

26
tcm/src/main/java/com/ccsens/tcm/persist/mapper/PatientRecordMapper.java

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

10
tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java

@ -0,0 +1,10 @@
package com.ccsens.tcm.service;
import com.ccsens.tcm.bean.dto.PatientDto;
/**
* @author wang
*/
public interface IPatientService {
void savePatient(PatientDto.SavePatient param, Long userId);
}

31
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -0,0 +1,31 @@
package com.ccsens.tcm.service;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.bean.po.PatientInformation;
import com.ccsens.tcm.persist.mapper.PatientInformationMapper;
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;
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class PatientService implements IPatientService {
@Resource
private PatientInformationMapper patientInformationMapper;
@Resource
private Snowflake snowflake;
@Override
public void savePatient(PatientDto.SavePatient param, Long userId) {
PatientInformation patientInformation=new PatientInformation();
BeanUtils.copyProperties(param,patientInformation);
patientInformation.setId(snowflake.nextId());
patientInformationMapper.insertSelective(patientInformation);
}
}

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

@ -1,13 +1,14 @@
<?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.tcm.persist.mapper.PatientRecordMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tcm.bean.po.PatientRecord">
<mapper namespace="com.ccsens.tcm.persist.mapper.patientRecordMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tcm.bean.po.patientRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="patient_id" jdbcType="INTEGER" property="patientId" />
<result column="test_questions_id" jdbcType="INTEGER" property="testQuestionsId" />
<result column="contents" jdbcType="VARCHAR" property="contents" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="collect_time" jdbcType="INTEGER" property="collectTime" />
<result column="time_slot" jdbcType="TIMESTAMP" property="timeSlot" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="update_at" jdbcType="TIMESTAMP" property="updateAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
@ -71,10 +72,10 @@
</where>
</sql>
<sql id="Base_Column_List">
id, patient_id, test_questions_id, contents, user_id, collect_time, created_at, update_at,
rec_status
id, patient_id, test_questions_id, contents, user_id, collect_time, time_slot, created_at,
update_at, rec_status
</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
<if test="distinct">
distinct
@ -98,28 +99,31 @@
delete from t_patient_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tcm.bean.po.PatientRecordExample">
<delete id="deleteByExample" parameterType="com.ccsens.tcm.bean.po.patientRecordExample">
delete from t_patient_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.PatientRecord">
insert into t_patient_record (id, patient_id, test_questions_id,
contents, user_id, collect_time,
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.patientRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into t_patient_record (patient_id, test_questions_id, contents,
user_id, collect_time, time_slot,
created_at, update_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=INTEGER}, #{testQuestionsId,jdbcType=INTEGER},
#{contents,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{collectTime,jdbcType=INTEGER},
values (#{patientId,jdbcType=INTEGER}, #{testQuestionsId,jdbcType=INTEGER}, #{contents,jdbcType=VARCHAR},
#{userId,jdbcType=BIGINT}, #{collectTime,jdbcType=INTEGER}, #{timeSlot,jdbcType=TIMESTAMP},
#{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.PatientRecord">
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.patientRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into t_patient_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="patientId != null">
patient_id,
</if>
@ -135,6 +139,9 @@
<if test="collectTime != null">
collect_time,
</if>
<if test="timeSlot != null">
time_slot,
</if>
<if test="createdAt != null">
created_at,
</if>
@ -146,9 +153,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="patientId != null">
#{patientId,jdbcType=INTEGER},
</if>
@ -164,6 +168,9 @@
<if test="collectTime != null">
#{collectTime,jdbcType=INTEGER},
</if>
<if test="timeSlot != null">
#{timeSlot,jdbcType=TIMESTAMP},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
@ -175,7 +182,7 @@
</if>
</trim>
</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">
select count(*) from t_patient_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
@ -202,6 +209,9 @@
<if test="record.collectTime != null">
collect_time = #{record.collectTime,jdbcType=INTEGER},
</if>
<if test="record.timeSlot != null">
time_slot = #{record.timeSlot,jdbcType=TIMESTAMP},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
@ -224,6 +234,7 @@
contents = #{record.contents,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT},
collect_time = #{record.collectTime,jdbcType=INTEGER},
time_slot = #{record.timeSlot,jdbcType=TIMESTAMP},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
update_at = #{record.updateAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
@ -231,7 +242,7 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tcm.bean.po.PatientRecord">
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tcm.bean.po.patientRecord">
update t_patient_record
<set>
<if test="patientId != null">
@ -249,6 +260,9 @@
<if test="collectTime != null">
collect_time = #{collectTime,jdbcType=INTEGER},
</if>
<if test="timeSlot != null">
time_slot = #{timeSlot,jdbcType=TIMESTAMP},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
@ -261,13 +275,14 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tcm.bean.po.PatientRecord">
<update id="updateByPrimaryKey" parameterType="com.ccsens.tcm.bean.po.patientRecord">
update t_patient_record
set patient_id = #{patientId,jdbcType=INTEGER},
test_questions_id = #{testQuestionsId,jdbcType=INTEGER},
contents = #{contents,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT},
collect_time = #{collectTime,jdbcType=INTEGER},
time_slot = #{timeSlot,jdbcType=TIMESTAMP},
created_at = #{createdAt,jdbcType=TIMESTAMP},
update_at = #{updateAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}

65
tcm/src/main/resources/mapper_raw/ReportCodeMapper.xml

@ -5,11 +5,12 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="parent_code" jdbcType="VARCHAR" property="parentCode" />
<result column="must" jdbcType="TINYINT" property="must" />
<result column="level" jdbcType="TINYINT" property="level" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="report_type" jdbcType="TINYINT" property="reportType" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
@ -74,8 +75,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, code, name, parent_id, must, level, sort, remark, operator, created_at, updated_at,
rec_status
id, code, name, parent_code, must, level, sort, remark, report_type, operator, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.ReportCodeExample" resultMap="BaseResultMap">
select
@ -108,31 +109,34 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.ReportCode">
insert into t_report_code (id, code, name,
parent_id, must, level,
sort, remark, operator,
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into t_report_code (code, name, parent_code,
must, level, sort,
remark, report_type, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{parentId,jdbcType=VARCHAR}, #{must,jdbcType=TINYINT}, #{level,jdbcType=TINYINT},
#{sort,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR},
#{must,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{sort,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR}, #{reportType,jdbcType=TINYINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.ReportCode">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into t_report_code
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="code != null">
code,
</if>
<if test="name != null">
name,
</if>
<if test="parentId != null">
parent_id,
<if test="parentCode != null">
parent_code,
</if>
<if test="must != null">
must,
@ -146,6 +150,9 @@
<if test="remark != null">
remark,
</if>
<if test="reportType != null">
report_type,
</if>
<if test="operator != null">
operator,
</if>
@ -160,17 +167,14 @@
</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="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
<if test="parentCode != null">
#{parentCode,jdbcType=VARCHAR},
</if>
<if test="must != null">
#{must,jdbcType=TINYINT},
@ -184,6 +188,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="reportType != null">
#{reportType,jdbcType=TINYINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
@ -216,8 +223,8 @@
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=VARCHAR},
<if test="record.parentCode != null">
parent_code = #{record.parentCode,jdbcType=VARCHAR},
</if>
<if test="record.must != null">
must = #{record.must,jdbcType=TINYINT},
@ -231,6 +238,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.reportType != null">
report_type = #{record.reportType,jdbcType=TINYINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
@ -253,11 +263,12 @@
set id = #{record.id,jdbcType=BIGINT},
code = #{record.code,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=VARCHAR},
parent_code = #{record.parentCode,jdbcType=VARCHAR},
must = #{record.must,jdbcType=TINYINT},
level = #{record.level,jdbcType=TINYINT},
sort = #{record.sort,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
report_type = #{record.reportType,jdbcType=TINYINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@ -275,8 +286,8 @@
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
<if test="parentCode != null">
parent_code = #{parentCode,jdbcType=VARCHAR},
</if>
<if test="must != null">
must = #{must,jdbcType=TINYINT},
@ -290,6 +301,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="reportType != null">
report_type = #{reportType,jdbcType=TINYINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
@ -309,11 +323,12 @@
update t_report_code
set code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR},
parent_code = #{parentCode,jdbcType=VARCHAR},
must = #{must,jdbcType=TINYINT},
level = #{level,jdbcType=TINYINT},
sort = #{sort,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
report_type = #{reportType,jdbcType=TINYINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},

Loading…
Cancel
Save