诊断记录-历史备份

master
parent 3b6106c7d3
commit 0405f918d1

@ -66,6 +66,9 @@ public class AppController extends BaseController
@Resource @Resource
private ISysConfigService configService; private ISysConfigService configService;
@Resource
private ITRecordHistoryService recordHistoryService;
@Resource @Resource
private ITImageService imageService; private ITImageService imageService;
@ -202,6 +205,10 @@ public class AppController extends BaseController
@PostMapping("/record/diagnostic/upload") @PostMapping("/record/diagnostic/upload")
public AjaxResult diagnosticRecordsUploaded(@RequestBody AppRecordReq appRecordReq) public AjaxResult diagnosticRecordsUploaded(@RequestBody AppRecordReq appRecordReq)
{ {
//覆盖recode记录前先备份数据
//备份历史记录
recordHistoryService.saveHistory(appRecordReq.getId());
TRecord tRecord = new TRecord(); TRecord tRecord = new TRecord();
BeanUtils.copyProperties(appRecordReq, tRecord); BeanUtils.copyProperties(appRecordReq, tRecord);
if (null == tRecord.getAiResultModifyTime()) { if (null == tRecord.getAiResultModifyTime()) {

@ -9,6 +9,8 @@ import com.ruoyi.system.domain.TPatientHospitalDoctor;
import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.TRecord;
import com.ruoyi.system.domain.resp.PatientHistoryRecordResp; import com.ruoyi.system.domain.resp.PatientHistoryRecordResp;
import com.ruoyi.system.domain.resp.TRecordResp; import com.ruoyi.system.domain.resp.TRecordResp;
import com.ruoyi.system.service.ITImageHistoryService;
import com.ruoyi.system.service.ITRecordHistoryService;
import com.ruoyi.system.service.ITRecordService; import com.ruoyi.system.service.ITRecordService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -28,6 +30,11 @@ import java.util.stream.Collectors;
public class MpController extends BaseController { public class MpController extends BaseController {
@Autowired @Autowired
private ITRecordService tRecordService; private ITRecordService tRecordService;
@Autowired
private ITRecordHistoryService recordHistoryService;
@Autowired
private ITImageHistoryService imageHistoryService;
@ApiOperation("患者诊断记录") @ApiOperation("患者诊断记录")
@GetMapping("/patient/history/record") @GetMapping("/patient/history/record")
@ -51,14 +58,22 @@ public class MpController extends BaseController {
public AjaxResult reschedule(@PathVariable("recordId") Long recordId){ public AjaxResult reschedule(@PathVariable("recordId") Long recordId){
// 逻辑删除本条记录 // 逻辑删除本条记录
TRecord tRecord = tRecordService.selectTRecordById(recordId); TRecord tRecord = tRecordService.selectTRecordById(recordId);
//备份历史记录
recordHistoryService.saveHistory(recordId);
TRecord delRecord = new TRecord(); TRecord delRecord = new TRecord();
delRecord.setId(recordId); delRecord.setId(recordId);
delRecord.setDelFlag("2"); delRecord.setDelFlag("2");
tRecordService.updateTRecord(delRecord); tRecordService.updateTRecord(delRecord);
// 重新生成一条记录 // 重新生成一条记录
tRecord.setId(null); tRecord.setId(null);
tRecord.setDelFlag("0"); tRecord.setDelFlag("0");
tRecord.setStatus("0"); tRecord.setStatus("0");
tRecord.setUpdateResult(null);
tRecord.setUpdateResult2(null);
tRecordService.insertTRecord(tRecord); tRecordService.insertTRecord(tRecord);
AjaxResult success = AjaxResult.success(); AjaxResult success = AjaxResult.success();
success.put("recordId", tRecord.getId()); success.put("recordId", tRecord.getId());

@ -0,0 +1,81 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* t_image_history
*
* @author ruoyi
* @date 2022-09-13
*/
public class TImageHistory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** ID */
private Long id;
/** thirdID */
@Excel(name = "thirdID")
private Long thirdId;
/** 路径 */
@Excel(name = "路径")
private String path;
/** 名称 */
@Excel(name = "名称")
private String name;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setThirdId(Long thirdId)
{
this.thirdId = thirdId;
}
public Long getThirdId()
{
return thirdId;
}
public void setPath(String path)
{
this.path = path;
}
public String getPath()
{
return path;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("thirdId", getThirdId())
.append("path", getPath())
.append("name", getName())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,276 @@
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* t_record_history
*
* @author ruoyi
* @date 2022-09-13
*/
public class TRecordHistory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** ID */
private Long id;
/** 患者 */
@Excel(name = "患者")
private Long patientId;
/** 医生 */
@Excel(name = "医生")
private Long doctorId;
/** 医院 */
@Excel(name = "医院")
private Long hospitalId;
/** 状态0预约 1就诊 */
@Excel(name = "状态", readConverterExp = "0=预约,1=就诊")
private String status;
/** ai诊断结果 */
@Excel(name = "ai诊断结果")
private String aiResult;
/** ai诊断结果无图片 */
@Excel(name = "ai诊断结果无图片")
private String aiResult2;
/** 医生诊断结果 */
@Excel(name = "医生诊断结果")
private String updateResult;
/** 医生诊断结果,无图片 */
@Excel(name = "医生诊断结果,无图片")
private String updateResult2;
/** 上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date uploadTime;
/** 舌下 */
@Excel(name = "舌下")
private String imgSx;
/** 舌上 */
@Excel(name = "舌上")
private String imgSm;
/** 响应时长 */
@Excel(name = "响应时长")
private Long responseTime;
/** ai结果返回时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "ai结果返回时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date aiResultReturnTime;
/** ai结果修改时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "ai结果修改时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date aiResultModifyTime;
/**
*
*/
private String appointmentTime;
/**
* 0: 1:
*/
private String delFlag;
private Long recodeId;
public Long getRecodeId() {
return recodeId;
}
public void setRecodeId(Long recodeId) {
this.recodeId = recodeId;
}
public String getAppointmentTime() {
return appointmentTime;
}
public void setAppointmentTime(String appointmentTime) {
this.appointmentTime = appointmentTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPatientId(Long patientId)
{
this.patientId = patientId;
}
public Long getPatientId()
{
return patientId;
}
public void setDoctorId(Long doctorId)
{
this.doctorId = doctorId;
}
public Long getDoctorId()
{
return doctorId;
}
public void setHospitalId(Long hospitalId)
{
this.hospitalId = hospitalId;
}
public Long getHospitalId()
{
return hospitalId;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setAiResult(String aiResult)
{
this.aiResult = aiResult;
}
public String getAiResult()
{
return aiResult;
}
public void setAiResult2(String aiResult2)
{
this.aiResult2 = aiResult2;
}
public String getAiResult2()
{
return aiResult2;
}
public void setUpdateResult(String updateResult)
{
this.updateResult = updateResult;
}
public String getUpdateResult()
{
return updateResult;
}
public void setUpdateResult2(String updateResult2)
{
this.updateResult2 = updateResult2;
}
public String getUpdateResult2()
{
return updateResult2;
}
public void setUploadTime(Date uploadTime)
{
this.uploadTime = uploadTime;
}
public Date getUploadTime()
{
return uploadTime;
}
public void setImgSx(String imgSx)
{
this.imgSx = imgSx;
}
public String getImgSx()
{
return imgSx;
}
public void setImgSm(String imgSm)
{
this.imgSm = imgSm;
}
public String getImgSm()
{
return imgSm;
}
public void setResponseTime(Long responseTime)
{
this.responseTime = responseTime;
}
public Long getResponseTime()
{
return responseTime;
}
public void setAiResultReturnTime(Date aiResultReturnTime)
{
this.aiResultReturnTime = aiResultReturnTime;
}
public Date getAiResultReturnTime()
{
return aiResultReturnTime;
}
public void setAiResultModifyTime(Date aiResultModifyTime)
{
this.aiResultModifyTime = aiResultModifyTime;
}
public Date getAiResultModifyTime()
{
return aiResultModifyTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("patientId", getPatientId())
.append("doctorId", getDoctorId())
.append("hospitalId", getHospitalId())
.append("status", getStatus())
.append("aiResult", getAiResult())
.append("aiResult2", getAiResult2())
.append("updateResult", getUpdateResult())
.append("updateResult2", getUpdateResult2())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("uploadTime", getUploadTime())
.append("imgSx", getImgSx())
.append("imgSm", getImgSm())
.append("responseTime", getResponseTime())
.append("aiResultReturnTime", getAiResultReturnTime())
.append("aiResultModifyTime", getAiResultModifyTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.TImageHistory;
/**
* Mapper
*
* @author ruoyi
* @date 2022-09-13
*/
public interface TImageHistoryMapper
{
/**
*
*
* @param id
* @return
*/
public TImageHistory selectTImageHistoryById(Long id);
/**
*
*
* @param tImageHistory
* @return
*/
public List<TImageHistory> selectTImageHistoryList(TImageHistory tImageHistory);
/**
*
*
* @param tImageHistory
* @return
*/
public int insertTImageHistory(TImageHistory tImageHistory);
/**
*
*
* @param tImageHistory
* @return
*/
public int updateTImageHistory(TImageHistory tImageHistory);
/**
*
*
* @param id
* @return
*/
public int deleteTImageHistoryById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteTImageHistoryByIds(Long[] ids);
}

@ -0,0 +1,63 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.TRecordHistory;
import org.springframework.stereotype.Repository;
/**
* Mapper
*
* @author ruoyi
* @date 2022-09-13
*/
@Repository
public interface TRecordHistoryMapper
{
/**
*
*
* @param id
* @return
*/
public TRecordHistory selectTRecordHistoryById(Long id);
/**
*
*
* @param tRecordHistory
* @return
*/
public List<TRecordHistory> selectTRecordHistoryList(TRecordHistory tRecordHistory);
/**
*
*
* @param tRecordHistory
* @return
*/
public int insertTRecordHistory(TRecordHistory tRecordHistory);
/**
*
*
* @param tRecordHistory
* @return
*/
public int updateTRecordHistory(TRecordHistory tRecordHistory);
/**
*
*
* @param id
* @return
*/
public int deleteTRecordHistoryById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteTRecordHistoryByIds(Long[] ids);
}

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.TImageHistory;
/**
* Service
*
* @author ruoyi
* @date 2022-09-13
*/
public interface ITImageHistoryService
{
/**
*
*
* @param id
* @return
*/
public TImageHistory selectTImageHistoryById(Long id);
/**
*
*
* @param tImageHistory
* @return
*/
public List<TImageHistory> selectTImageHistoryList(TImageHistory tImageHistory);
/**
*
*
* @param tImageHistory
* @return
*/
public int insertTImageHistory(TImageHistory tImageHistory);
/**
*
*
* @param tImageHistory
* @return
*/
public int updateTImageHistory(TImageHistory tImageHistory);
/**
*
*
* @param ids
* @return
*/
public int deleteTImageHistoryByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteTImageHistoryById(Long id);
}

@ -0,0 +1,63 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.TRecordHistory;
/**
* Service
*
* @author ruoyi
* @date 2022-09-13
*/
public interface ITRecordHistoryService
{
/**
*
*
* @param id
* @return
*/
public TRecordHistory selectTRecordHistoryById(Long id);
/**
*
*
* @param tRecordHistory
* @return
*/
public List<TRecordHistory> selectTRecordHistoryList(TRecordHistory tRecordHistory);
/**
*
*
* @param tRecordHistory
* @return
*/
public int insertTRecordHistory(TRecordHistory tRecordHistory);
/**
*
*
* @param tRecordHistory
* @return
*/
public int updateTRecordHistory(TRecordHistory tRecordHistory);
/**
*
*
* @param ids
* @return
*/
public int deleteTRecordHistoryByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteTRecordHistoryById(Long id);
void saveHistory(Long recordId);
}

@ -0,0 +1,95 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TImageHistoryMapper;
import com.ruoyi.system.domain.TImageHistory;
import com.ruoyi.system.service.ITImageHistoryService;
/**
* Service
*
* @author ruoyi
* @date 2022-09-13
*/
@Service
public class TImageHistoryServiceImpl implements ITImageHistoryService
{
@Autowired
private TImageHistoryMapper tImageHistoryMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TImageHistory selectTImageHistoryById(Long id)
{
return tImageHistoryMapper.selectTImageHistoryById(id);
}
/**
*
*
* @param tImageHistory
* @return
*/
@Override
public List<TImageHistory> selectTImageHistoryList(TImageHistory tImageHistory)
{
return tImageHistoryMapper.selectTImageHistoryList(tImageHistory);
}
/**
*
*
* @param tImageHistory
* @return
*/
@Override
public int insertTImageHistory(TImageHistory tImageHistory)
{
tImageHistory.setCreateTime(DateUtils.getNowDate());
return tImageHistoryMapper.insertTImageHistory(tImageHistory);
}
/**
*
*
* @param tImageHistory
* @return
*/
@Override
public int updateTImageHistory(TImageHistory tImageHistory)
{
return tImageHistoryMapper.updateTImageHistory(tImageHistory);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTImageHistoryByIds(Long[] ids)
{
return tImageHistoryMapper.deleteTImageHistoryByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTImageHistoryById(Long id)
{
return tImageHistoryMapper.deleteTImageHistoryById(id);
}
}

@ -0,0 +1,136 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TImage;
import com.ruoyi.system.domain.TImageHistory;
import com.ruoyi.system.domain.TRecord;
import com.ruoyi.system.service.ITImageHistoryService;
import com.ruoyi.system.service.ITImageService;
import com.ruoyi.system.service.ITRecordService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TRecordHistoryMapper;
import com.ruoyi.system.domain.TRecordHistory;
import com.ruoyi.system.service.ITRecordHistoryService;
/**
* Service
*
* @author ruoyi
* @date 2022-09-13
*/
@Service
public class TRecordHistoryServiceImpl implements ITRecordHistoryService
{
@Autowired
private TRecordHistoryMapper tRecordHistoryMapper;
@Autowired
private ITRecordService tRecordService;
@Autowired
private ITImageHistoryService imageHistoryService;
@Autowired
private ITImageService imageService;
/**
*
*
* @param id
* @return
*/
@Override
public TRecordHistory selectTRecordHistoryById(Long id)
{
return tRecordHistoryMapper.selectTRecordHistoryById(id);
}
/**
*
*
* @param tRecordHistory
* @return
*/
@Override
public List<TRecordHistory> selectTRecordHistoryList(TRecordHistory tRecordHistory)
{
return tRecordHistoryMapper.selectTRecordHistoryList(tRecordHistory);
}
/**
*
*
* @param tRecordHistory
* @return
*/
@Override
public int insertTRecordHistory(TRecordHistory tRecordHistory)
{
tRecordHistory.setCreateTime(DateUtils.getNowDate());
return tRecordHistoryMapper.insertTRecordHistory(tRecordHistory);
}
/**
*
*
* @param tRecordHistory
* @return
*/
@Override
public int updateTRecordHistory(TRecordHistory tRecordHistory)
{
tRecordHistory.setUpdateTime(DateUtils.getNowDate());
return tRecordHistoryMapper.updateTRecordHistory(tRecordHistory);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTRecordHistoryByIds(Long[] ids)
{
return tRecordHistoryMapper.deleteTRecordHistoryByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTRecordHistoryById(Long id)
{
return tRecordHistoryMapper.deleteTRecordHistoryById(id);
}
@Override
public void saveHistory(Long recordId) {
TRecord tRecord = tRecordService.selectTRecordById(recordId);
TRecordHistory tRecordHistory = new TRecordHistory();
BeanUtils.copyProperties(tRecord,tRecordHistory);
tRecordHistory.setRecodeId(recordId);
tRecordHistory.setId(null);
//备份记录表
tRecordHistoryMapper.insertTRecordHistory(tRecordHistory);
//备份图片表
TImage tImage = new TImage();
tImage.setThirdId(recordId);
List<TImage> images = imageService.selectTImageList(tImage);
images.parallelStream().forEach(x->{
TImageHistory tImageHistory=new TImageHistory();
BeanUtils.copyProperties(x,tImageHistory);
tImageHistory.setId(null);
tImageHistory.setThirdId(tRecordHistory.getId());
imageHistoryService.insertTImageHistory(tImageHistory);
});
}
}

@ -0,0 +1,70 @@
<?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.ruoyi.system.mapper.TImageHistoryMapper">
<resultMap type="TImageHistory" id="TImageHistoryResult">
<result property="id" column="id" />
<result property="thirdId" column="third_id" />
<result property="path" column="path" />
<result property="name" column="name" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectTImageHistoryVo">
select id, third_id, path, name, create_time from t_image_history
</sql>
<select id="selectTImageHistoryList" parameterType="TImageHistory" resultMap="TImageHistoryResult">
<include refid="selectTImageHistoryVo"/>
<where>
<if test="thirdId != null "> and third_id = #{thirdId}</if>
<if test="path != null and path != ''"> and path = #{path}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
</where>
</select>
<select id="selectTImageHistoryById" parameterType="Long" resultMap="TImageHistoryResult">
<include refid="selectTImageHistoryVo"/>
where id = #{id}
</select>
<insert id="insertTImageHistory" parameterType="TImageHistory" useGeneratedKeys="true" keyProperty="id">
insert into t_image_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="thirdId != null">third_id,</if>
<if test="path != null">path,</if>
<if test="name != null">name,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="thirdId != null">#{thirdId},</if>
<if test="path != null">#{path},</if>
<if test="name != null">#{name},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateTImageHistory" parameterType="TImageHistory">
update t_image_history
<trim prefix="SET" suffixOverrides=",">
<if test="thirdId != null">third_id = #{thirdId},</if>
<if test="path != null">path = #{path},</if>
<if test="name != null">name = #{name},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTImageHistoryById" parameterType="Long">
delete from t_image_history where id = #{id}
</delete>
<delete id="deleteTImageHistoryByIds" parameterType="String">
delete from t_image_history where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,135 @@
<?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.ruoyi.system.mapper.TRecordHistoryMapper">
<resultMap type="TRecordHistory" id="TRecordHistoryResult">
<result property="id" column="id" />
<result property="patientId" column="patient_id" />
<result property="doctorId" column="doctor_id" />
<result property="hospitalId" column="hospital_id" />
<result property="status" column="status" />
<result property="aiResult" column="ai_result" />
<result property="aiResult2" column="ai_result2" />
<result property="updateResult" column="update_result" />
<result property="updateResult2" column="update_result2" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="uploadTime" column="upload_time" />
<result property="imgSx" column="img_sx" />
<result property="imgSm" column="img_sm" />
<result property="responseTime" column="response_time" />
<result property="aiResultReturnTime" column="ai_result_return_time" />
<result property="aiResultModifyTime" column="ai_result_modify_time" />
<result property="delFlag" column="del_flag" />
<result property="recodeId" column="recode_id" />
</resultMap>
<sql id="selectTRecordHistoryVo">
select id, patient_id, doctor_id, hospital_id, status, ai_result, ai_result2, update_result, update_result2, create_time, update_time, upload_time, img_sx, img_sm, response_time, ai_result_return_time, ai_result_modify_time from t_record_history
</sql>
<select id="selectTRecordHistoryList" parameterType="TRecordHistory" resultMap="TRecordHistoryResult">
<include refid="selectTRecordHistoryVo"/>
<where>
<if test="patientId != null "> and patient_id = #{patientId}</if>
<if test="doctorId != null "> and doctor_id = #{doctorId}</if>
<if test="hospitalId != null "> and hospital_id = #{hospitalId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="aiResult != null and aiResult != ''"> and ai_result = #{aiResult}</if>
<if test="aiResult2 != null and aiResult2 != ''"> and ai_result2 = #{aiResult2}</if>
<if test="updateResult != null and updateResult != ''"> and update_result = #{updateResult}</if>
<if test="updateResult2 != null and updateResult2 != ''"> and update_result2 = #{updateResult2}</if>
<if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
<if test="imgSx != null and imgSx != ''"> and img_sx = #{imgSx}</if>
<if test="imgSm != null and imgSm != ''"> and img_sm = #{imgSm}</if>
<if test="responseTime != null "> and response_time = #{responseTime}</if>
<if test="aiResultReturnTime != null "> and ai_result_return_time = #{aiResultReturnTime}</if>
<if test="aiResultModifyTime != null "> and ai_result_modify_time = #{aiResultModifyTime}</if>
</where>
</select>
<select id="selectTRecordHistoryById" parameterType="Long" resultMap="TRecordHistoryResult">
<include refid="selectTRecordHistoryVo"/>
where id = #{id}
</select>
<insert id="insertTRecordHistory" parameterType="TRecordHistory" useGeneratedKeys="true" keyProperty="id">
insert into t_record_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">patient_id,</if>
<if test="doctorId != null">doctor_id,</if>
<if test="hospitalId != null">hospital_id,</if>
<if test="status != null">status,</if>
<if test="aiResult != null">ai_result,</if>
<if test="aiResult2 != null">ai_result2,</if>
<if test="updateResult != null">update_result,</if>
<if test="updateResult2 != null">update_result2,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="uploadTime != null">upload_time,</if>
<if test="imgSx != null">img_sx,</if>
<if test="imgSm != null">img_sm,</if>
<if test="responseTime != null">response_time,</if>
<if test="aiResultReturnTime != null">ai_result_return_time,</if>
<if test="aiResultModifyTime != null">ai_result_modify_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="recodeId != null">recode_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},</if>
<if test="doctorId != null">#{doctorId},</if>
<if test="hospitalId != null">#{hospitalId},</if>
<if test="status != null">#{status},</if>
<if test="aiResult != null">#{aiResult},</if>
<if test="aiResult2 != null">#{aiResult2},</if>
<if test="updateResult != null">#{updateResult},</if>
<if test="updateResult2 != null">#{updateResult2},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="uploadTime != null">#{uploadTime},</if>
<if test="imgSx != null">#{imgSx},</if>
<if test="imgSm != null">#{imgSm},</if>
<if test="responseTime != null">#{responseTime},</if>
<if test="aiResultReturnTime != null">#{aiResultReturnTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="recodeId != null">#{recodeId},</if>
</trim>
</insert>
<update id="updateTRecordHistory" parameterType="TRecordHistory">
update t_record_history
<trim prefix="SET" suffixOverrides=",">
<if test="patientId != null">patient_id = #{patientId},</if>
<if test="doctorId != null">doctor_id = #{doctorId},</if>
<if test="hospitalId != null">hospital_id = #{hospitalId},</if>
<if test="status != null">status = #{status},</if>
<if test="aiResult != null">ai_result = #{aiResult},</if>
<if test="aiResult2 != null">ai_result2 = #{aiResult2},</if>
<if test="updateResult != null">update_result = #{updateResult},</if>
<if test="updateResult2 != null">update_result2 = #{updateResult2},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
<if test="imgSx != null">img_sx = #{imgSx},</if>
<if test="imgSm != null">img_sm = #{imgSm},</if>
<if test="responseTime != null">response_time = #{responseTime},</if>
<if test="aiResultReturnTime != null">ai_result_return_time = #{aiResultReturnTime},</if>
<if test="aiResultModifyTime != null">ai_result_modify_time = #{aiResultModifyTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTRecordHistoryById" parameterType="Long">
delete from t_record_history where id = #{id}
</delete>
<delete id="deleteTRecordHistoryByIds" parameterType="String">
delete from t_record_history where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save