Browse Source

修改po

recovery
wang1007152140 5 years ago
parent
commit
8b0cca9ab1
  1. 15
      tcm/src/main/java/com/ccsens/tcm/api/PatientController.java
  2. 22
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  3. 12
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java
  4. 40
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java
  5. 2
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  6. 20
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  7. 26
      tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml

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

@ -26,13 +26,24 @@ public class PatientController {
// disease_time
private IPatientService patientService;
@MustLogin
@ApiOperation(value = "添加患者基本信息", notes = "zy:添加一个活动公告,本平台默认审核通过")
@ApiOperation(value = "添加患者基本信息", notes = "w:添加患者基本信息")
@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("添加患者基本成功");
log.info("添加患者基本信息成功");
return JsonResponse.newInstance().ok();
}
@MustLogin
@ApiOperation(value = "保存患者病例信息", notes = "w:提交患者的相关病例信息")
@RequestMapping(value = "/saveCaseMes", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse saveCaseMes(@ApiParam @Validated @RequestBody QueryDto<PatientDto.saveCaseMes> params) {
log.info("添加患者病例信息:{}",params);
patientService.saveCaseMes(params.getParam(),params.getUserId());
log.info("添加患者病例信息成功");
return JsonResponse.newInstance().ok();
}
}

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

@ -1,11 +1,13 @@
package com.ccsens.tcm.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import sun.awt.ConstrainableGraphics;
import java.util.Date;
import java.util.List;
/**
* @author wang
@ -24,4 +26,24 @@ public class PatientDto {
@ApiModelProperty("医院id")
private Integer hospitalId;
}
@Data
@ApiModel("保存患者的多个病例信息")
public static class saveCaseMes {
List<saveCaseMesSig> list;
}
@Data
@ApiModel("患者的某个病例信息")
public static class saveCaseMesSig {
@ApiModelProperty("患者id")
private Long patientId;
@ApiModelProperty("问题id")
private Long testQuestionsId;
@ApiModelProperty("内容")
private String contents;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("诊断时间")
private Date timeSlot;
}
}

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

@ -6,9 +6,9 @@ import java.util.Date;
public class patientRecord implements Serializable {
private Long id;
private Integer patientId;
private Long patientId;
private Integer testQuestionsId;
private Long testQuestionsId;
private String contents;
@ -34,19 +34,19 @@ public class patientRecord implements Serializable {
this.id = id;
}
public Integer getPatientId() {
public Long getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
public void setPatientId(Long patientId) {
this.patientId = patientId;
}
public Integer getTestQuestionsId() {
public Long getTestQuestionsId() {
return testQuestionsId;
}
public void setTestQuestionsId(Integer testQuestionsId) {
public void setTestQuestionsId(Long testQuestionsId) {
this.testQuestionsId = testQuestionsId;
}

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

@ -175,52 +175,52 @@ public class patientRecordExample {
return (Criteria) this;
}
public Criteria andPatientIdEqualTo(Integer value) {
public Criteria andPatientIdEqualTo(Long value) {
addCriterion("patient_id =", value, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdNotEqualTo(Integer value) {
public Criteria andPatientIdNotEqualTo(Long value) {
addCriterion("patient_id <>", value, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdGreaterThan(Integer value) {
public Criteria andPatientIdGreaterThan(Long value) {
addCriterion("patient_id >", value, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdGreaterThanOrEqualTo(Integer value) {
public Criteria andPatientIdGreaterThanOrEqualTo(Long value) {
addCriterion("patient_id >=", value, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdLessThan(Integer value) {
public Criteria andPatientIdLessThan(Long value) {
addCriterion("patient_id <", value, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdLessThanOrEqualTo(Integer value) {
public Criteria andPatientIdLessThanOrEqualTo(Long value) {
addCriterion("patient_id <=", value, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdIn(List<Integer> values) {
public Criteria andPatientIdIn(List<Long> values) {
addCriterion("patient_id in", values, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdNotIn(List<Integer> values) {
public Criteria andPatientIdNotIn(List<Long> values) {
addCriterion("patient_id not in", values, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdBetween(Integer value1, Integer value2) {
public Criteria andPatientIdBetween(Long value1, Long value2) {
addCriterion("patient_id between", value1, value2, "patientId");
return (Criteria) this;
}
public Criteria andPatientIdNotBetween(Integer value1, Integer value2) {
public Criteria andPatientIdNotBetween(Long value1, Long value2) {
addCriterion("patient_id not between", value1, value2, "patientId");
return (Criteria) this;
}
@ -235,52 +235,52 @@ public class patientRecordExample {
return (Criteria) this;
}
public Criteria andTestQuestionsIdEqualTo(Integer value) {
public Criteria andTestQuestionsIdEqualTo(Long value) {
addCriterion("test_questions_id =", value, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdNotEqualTo(Integer value) {
public Criteria andTestQuestionsIdNotEqualTo(Long value) {
addCriterion("test_questions_id <>", value, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdGreaterThan(Integer value) {
public Criteria andTestQuestionsIdGreaterThan(Long value) {
addCriterion("test_questions_id >", value, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdGreaterThanOrEqualTo(Integer value) {
public Criteria andTestQuestionsIdGreaterThanOrEqualTo(Long value) {
addCriterion("test_questions_id >=", value, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdLessThan(Integer value) {
public Criteria andTestQuestionsIdLessThan(Long value) {
addCriterion("test_questions_id <", value, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdLessThanOrEqualTo(Integer value) {
public Criteria andTestQuestionsIdLessThanOrEqualTo(Long value) {
addCriterion("test_questions_id <=", value, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdIn(List<Integer> values) {
public Criteria andTestQuestionsIdIn(List<Long> values) {
addCriterion("test_questions_id in", values, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdNotIn(List<Integer> values) {
public Criteria andTestQuestionsIdNotIn(List<Long> values) {
addCriterion("test_questions_id not in", values, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdBetween(Integer value1, Integer value2) {
public Criteria andTestQuestionsIdBetween(Long value1, Long value2) {
addCriterion("test_questions_id between", value1, value2, "testQuestionsId");
return (Criteria) this;
}
public Criteria andTestQuestionsIdNotBetween(Integer value1, Integer value2) {
public Criteria andTestQuestionsIdNotBetween(Long value1, Long value2) {
addCriterion("test_questions_id not between", value1, value2, "testQuestionsId");
return (Criteria) this;
}

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

@ -7,4 +7,6 @@ import com.ccsens.tcm.bean.dto.PatientDto;
*/
public interface IPatientService {
void savePatient(PatientDto.SavePatient param, Long userId);
void saveCaseMes(PatientDto.saveCaseMes param, Long userId);
}

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

@ -4,6 +4,8 @@ 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 com.ccsens.tcm.persist.mapper.ReportCodeMapper;
import com.ccsens.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -20,6 +22,10 @@ public class PatientService implements IPatientService {
private PatientInformationMapper patientInformationMapper;
@Resource
private Snowflake snowflake;
@Resource
private RedisUtil redisUtil;
@Resource
private ReportCodeMapper reportCodeMapper;
@Override
public void savePatient(PatientDto.SavePatient param, Long userId) {
@ -28,4 +34,18 @@ public class PatientService implements IPatientService {
patientInformation.setId(snowflake.nextId());
patientInformationMapper.insertSelective(patientInformation);
}
@Override
public void saveCaseMes(PatientDto.saveCaseMes param, Long userId) {
Integer.parseInt((String) redisUtil.get("disease_time"));
if(param.getList().size()>0) {
for (int i = 0; i < param.getList().size(); i++) {
//先查询试题id
reportCodeMapper.selectByPrimaryKey(param.getList().get(i).getTestQuestionsId());
}
}
}
}

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

@ -3,8 +3,8 @@
<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="patient_id" jdbcType="BIGINT" property="patientId" />
<result column="test_questions_id" jdbcType="BIGINT" 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" />
@ -113,7 +113,7 @@
user_id, collect_time, time_slot,
created_at, update_at, rec_status
)
values (#{patientId,jdbcType=INTEGER}, #{testQuestionsId,jdbcType=INTEGER}, #{contents,jdbcType=VARCHAR},
values (#{patientId,jdbcType=BIGINT}, #{testQuestionsId,jdbcType=BIGINT}, #{contents,jdbcType=VARCHAR},
#{userId,jdbcType=BIGINT}, #{collectTime,jdbcType=INTEGER}, #{timeSlot,jdbcType=TIMESTAMP},
#{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
@ -154,10 +154,10 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">
#{patientId,jdbcType=INTEGER},
#{patientId,jdbcType=BIGINT},
</if>
<if test="testQuestionsId != null">
#{testQuestionsId,jdbcType=INTEGER},
#{testQuestionsId,jdbcType=BIGINT},
</if>
<if test="contents != null">
#{contents,jdbcType=VARCHAR},
@ -195,10 +195,10 @@
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.patientId != null">
patient_id = #{record.patientId,jdbcType=INTEGER},
patient_id = #{record.patientId,jdbcType=BIGINT},
</if>
<if test="record.testQuestionsId != null">
test_questions_id = #{record.testQuestionsId,jdbcType=INTEGER},
test_questions_id = #{record.testQuestionsId,jdbcType=BIGINT},
</if>
<if test="record.contents != null">
contents = #{record.contents,jdbcType=VARCHAR},
@ -229,8 +229,8 @@
<update id="updateByExample" parameterType="map">
update t_patient_record
set id = #{record.id,jdbcType=BIGINT},
patient_id = #{record.patientId,jdbcType=INTEGER},
test_questions_id = #{record.testQuestionsId,jdbcType=INTEGER},
patient_id = #{record.patientId,jdbcType=BIGINT},
test_questions_id = #{record.testQuestionsId,jdbcType=BIGINT},
contents = #{record.contents,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT},
collect_time = #{record.collectTime,jdbcType=INTEGER},
@ -246,10 +246,10 @@
update t_patient_record
<set>
<if test="patientId != null">
patient_id = #{patientId,jdbcType=INTEGER},
patient_id = #{patientId,jdbcType=BIGINT},
</if>
<if test="testQuestionsId != null">
test_questions_id = #{testQuestionsId,jdbcType=INTEGER},
test_questions_id = #{testQuestionsId,jdbcType=BIGINT},
</if>
<if test="contents != null">
contents = #{contents,jdbcType=VARCHAR},
@ -277,8 +277,8 @@
</update>
<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},
set patient_id = #{patientId,jdbcType=BIGINT},
test_questions_id = #{testQuestionsId,jdbcType=BIGINT},
contents = #{contents,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT},
collect_time = #{collectTime,jdbcType=INTEGER},

Loading…
Cancel
Save