Browse Source

提交po

recovery
wang1007152140 5 years ago
parent
commit
d16004fa16
  1. 2
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  2. 2
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java
  3. 4
      tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java
  4. 26
      tcm/src/main/java/com/ccsens/tcm/persist/mapper/PatientRecordMapper.java
  5. 14
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  6. 18
      tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml

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

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import sun.awt.ConstrainableGraphics;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@ -42,6 +43,7 @@ public class PatientDto {
private Long testQuestionsId;
@ApiModelProperty("内容")
private String contents;
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("诊断时间")
private Date timeSlot;

2
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 Long patientId;

4
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>();
}

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);
}

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

@ -3,6 +3,7 @@ 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.bean.po.ReportCode;
import com.ccsens.tcm.persist.mapper.PatientInformationMapper;
import com.ccsens.tcm.persist.mapper.ReportCodeMapper;
import com.ccsens.util.RedisUtil;
@ -37,12 +38,19 @@ public class PatientService implements IPatientService {
@Override
public void saveCaseMes(PatientDto.saveCaseMes param, Long userId) {
Integer.parseInt((String) redisUtil.get("disease_time"));
//获取发病时间id
Integer onsetTime=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());
ReportCode reportCode = reportCodeMapper.selectByPrimaryKey(param.getList().get(i).getTestQuestionsId());
if(reportCode.getReportType()==(byte)0){
//试题只需要记录一次的
}else if(reportCode.getReportType()==(byte)1){
//试题只需要记录3次的
}else if(reportCode.getReportType()==(byte)2){
//试题需要记录两次的
}
}

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

@ -1,7 +1,7 @@
<?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="BIGINT" property="patientId" />
<result column="test_questions_id" jdbcType="BIGINT" property="testQuestionsId" />
@ -75,7 +75,7 @@
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
@ -99,13 +99,13 @@
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 id="insert" parameterType="com.ccsens.tcm.bean.po.PatientRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
@ -118,7 +118,7 @@
#{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>
@ -182,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" />
@ -242,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">
@ -275,7 +275,7 @@
</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=BIGINT},
test_questions_id = #{testQuestionsId,jdbcType=BIGINT},

Loading…
Cancel
Save