diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java index 13ea616..cdc2e68 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java @@ -39,6 +39,17 @@ public class THospital extends BaseEntity @Excel(name = "管理员ID") private Long adminId; + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + public void setId(Long id) { this.id = id; diff --git a/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml b/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml index 472134f..8495a1b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/THospitalMapper.xml @@ -9,10 +9,11 @@ + - select id, name, num, admin_id from t_hospital + select id, name, num, admin_id, del_flag from t_hospital @@ -36,11 +38,13 @@ name, num, admin_id, + del_flag, #{name}, #{num}, #{adminId}, + #{delFlag}, @@ -50,6 +54,7 @@ name = #{name}, num = #{num}, admin_id = #{adminId}, + del_flag = #{delFlag}, where id = #{id} @@ -59,7 +64,7 @@ - delete from t_hospital where id in + update t_hospital set del_flag = '2' where id in #{id} @@ -71,11 +76,13 @@ a.name, a.num, a.admin_id as adminId, + a.del_flag as delFlag, b.user_name as adminName from t_hospital a left join sys_user b on a.admin_id = b.user_id 1=1 and a.name like concat('%', #{name}, '%') + and a.del_flag = #{delFlag} order by a.num diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 261eac0..8cf179b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -152,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tp.sex = #{sex} and tp.identifier like concat('%', #{identifier}, '%') - and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' + and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' and th.del_flag = '0' and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime} @@ -192,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" b.name from t_record a LEFT JOIN t_patient b on a.patient_id = b.id where TO_DAYS(a.create_time) = TO_DAYS(NOW()) - and b.del_flag = 0 + and b.del_flag = 0 and a.del_flag = 0 and a.doctor_id = #{doctorId} and a.hospital_id = #{hospitalId} ORDER BY a.create_time desc @@ -220,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from t_patient a inner JOIN t_record b on a.id = b.patient_id where 1 = 1 - and a.del_flag = 0 + and a.del_flag = 0 and b.del_flag = 0 and b.doctor_id = #{doctorId} and b.hospital_id = #{hospitalId} @@ -271,6 +271,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and t.doctor_id = #{doctorId} and t.hospital_id = #{hospitalId} and t.status = #{status} + and t.del_flag = '0' order by t.create_time desc @@ -310,8 +311,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tp.sex = #{sex} and tp.identifier like concat('%', #{identifier}, '%') - - and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' + + and tr.del_flag = #{delFlag} and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime} @@ -345,7 +346,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tp.sex = #{sex} and tp.identifier like concat('%', #{identifier}, '%') - and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' + and td.del_flag = '0' and tp.del_flag = '0' and tr.del_flag = '0' and th.del_flag = '0' and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime} @@ -435,7 +436,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from t_record where id in + update t_record set del_flag = '2',update_time = sysdate() where id in #{id}