|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
+import org.apache.ibatis.annotations.Update;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.CaseFrontsheetSurgery;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.GetOutSheet;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.SheetOverview;
|
|
@@ -12,8 +13,9 @@ import java.util.List;
|
|
|
|
|
|
@Mapper
|
|
|
public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery> {
|
|
|
+
|
|
|
@Select("select " +
|
|
|
- "b.sign_date,fileStatus=0, " +
|
|
|
+ "fileStatus=0, " +
|
|
|
"bedNo=rtrim(a.bed_no), " +
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
@@ -21,9 +23,6 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.sex,a.admiss_date, " +
|
|
|
"deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
|
|
|
"doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
- "b.late_flag, " +
|
|
|
- "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
- "lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
"a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
@@ -32,7 +31,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.admiss_times=b.zycs and " +
|
|
|
"a.dis_date>=#{start} and " +
|
|
|
"a.dis_date<=#{end} and " +
|
|
|
- "isnull(a.file_status, 0)=0 order by a.zk_ward,b.zyys")
|
|
|
+ "isnull(a.file_status, 0)!=1 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByBah(GetOutSheet param);
|
|
|
|
|
|
@Select("select sign_date,file_status,bah,name, " +
|
|
@@ -51,7 +50,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
List<SheetOverview> selectSignApply(@Param("bah") String bah, @Param("status") int status);
|
|
|
|
|
|
@Select("select " +
|
|
|
- "b.sign_date,fileStatus=0, " +
|
|
|
+ "fileStatus=0, " +
|
|
|
"bedNo=rtrim(a.bed_no), " +
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
@@ -59,9 +58,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.sex,a.admiss_date, " +
|
|
|
"deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
|
|
|
"doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
- "b.late_flag, " +
|
|
|
- "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
- "lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
+ "lateCount=(select count(1) from t_case_frontsheet_main with(nolock) where late_flag=1 and admiss_doctor=b.zyys), " +
|
|
|
"a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
@@ -72,7 +69,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.dis_date>=#{start} and " +
|
|
|
"a.dis_date<=#{end} and " +
|
|
|
"a.zk_ward = #{ward} and " +
|
|
|
- "isnull(a.file_status, 0)=0 and " +
|
|
|
+ "isnull(a.file_status, 0)!=1 and " +
|
|
|
"charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByWard(GetOutSheet param);
|
|
|
|
|
@@ -85,7 +82,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
List<SheetOverview> selectPatientsForBasByWard2(GetOutSheet param);
|
|
|
|
|
|
@Select("select " +
|
|
|
- "b.sign_date,fileStatus=0, " +
|
|
|
+ "fileStatus=0, " +
|
|
|
"bedNo=rtrim(a.bed_no), " +
|
|
|
"bah=rtrim(a.inpatient_no), " +
|
|
|
"times=rtrim(a.admiss_times), " +
|
|
@@ -93,9 +90,6 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.sex,a.admiss_date, " +
|
|
|
"deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
|
|
|
"doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
|
|
|
- "b.late_flag, " +
|
|
|
- "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
|
|
|
- "lateDays=datediff(day, a.dis_date, b.sign_date), " +
|
|
|
"a.dis_date " +
|
|
|
"from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
|
|
|
"where " +
|
|
@@ -105,7 +99,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"a.admiss_times=b.zycs and " +
|
|
|
"a.dis_date>=#{start} and " +
|
|
|
"a.dis_date<=#{end} and " +
|
|
|
- "isnull(a.file_status, 0)=0 and " +
|
|
|
+ "isnull(a.file_status, 0)!=1 and " +
|
|
|
"charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
|
|
|
List<SheetOverview> selectPatientsForBasByFileStatus(GetOutSheet param);
|
|
|
|
|
@@ -116,4 +110,8 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
|
|
|
"where dismiss_date>=#{start} and dismiss_date<=#{end} " +
|
|
|
"order by trans_dept,admiss_doctor")
|
|
|
List<SheetOverview> selectPatientsForBasByFileStatus2(GetOutSheet param);
|
|
|
+
|
|
|
+ @Update("update zy_actpatient set file_status=#{status} where inpatient_no=#{bah} and admiss_times=#{times};" +
|
|
|
+ "update zy_inactpatient set file_status=#{status} where inpatient_no=#{bah} and admiss_times=#{times};")
|
|
|
+ void updateActFileStatus(@Param("bah") String bah, @Param("times") int times, @Param("status") int status);
|
|
|
}
|