诊断记录-历史备份
							parent
							
								
									3b6106c7d3
								
							
						
					
					
						commit
						0405f918d1
					
				| @ -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,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…
					
					
				
		Reference in New Issue