From e92bdc2a67de9926d6e7edc7e565ed3a2d716968 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 28 Feb 2023 14:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E9=99=A2=E5=88=A0=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=94=B9=E4=B8=BA=E9=80=BB=E8=BE=91=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20=E5=B0=B1=E8=AF=8A=E8=AE=B0=E5=BD=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=88=97=E8=A1=A8sql=E9=80=BB=E8=BE=91=20?= =?UTF-8?q?=E6=82=A3=E8=80=85=E5=88=97=E8=A1=A8=E8=8E=B7=E5=8F=96sql?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/domain/THospital.java | 11 +++++++++++ .../resources/mapper/system/THospitalMapper.xml | 11 +++++++++-- .../resources/mapper/system/TRecordMapper.xml | 15 ++++++++------- 3 files changed, 28 insertions(+), 9 deletions(-) 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}