|
@@ -568,6 +568,7 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
|
|
|
|
|
|
@Select("select *, " +
|
|
|
"duplicated=(select count(1) from t_case_frontsheet_duplicate where bah=#{bah} and times=#{times})," +
|
|
|
+ "lendout=(select count(1) from t_case_frontsheet_lendout where bah=#{bah} and times=#{times} and state='LEND_OUT')," +
|
|
|
"closedown=(select count(1) from t_case_frontsheet_closedown where bah=#{bah} and times=#{times}) " +
|
|
|
"from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times} and file_status=1")
|
|
|
CaseFrontsheetMain selectStoredSheetMain(@Param("bah") String bah, @Param("times") Integer times);
|
|
@@ -672,13 +673,14 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
|
|
|
@Delete("delete from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times}")
|
|
|
void deleteOldSheet(String bah, int times);
|
|
|
|
|
|
- @Insert("insert into t_case_frontsheet_duplicate (bah, times, duplicate_staff, " +
|
|
|
- "visit_staff, remark) " +
|
|
|
- "values (#{bah},#{times},#{opStaff},#{visitStaff},#{remark})")
|
|
|
+ @Insert("insert into t_case_frontsheet_duplicate (bah,times,duplicate_time,duplicate_staff, " +
|
|
|
+ "visit_staff,remark) " +
|
|
|
+ "values (#{bah},#{times},#{markTime},#{opStaff},#{visitStaff},#{remark})")
|
|
|
int executeDuplicate(MarkStateRequest request);
|
|
|
|
|
|
- @Insert("insert into t_case_frontsheet_closedown (bah, times, closedown_staff, remark) " +
|
|
|
- "values (#{bah},#{times},#{opStaff},#{remark})")
|
|
|
+ @Insert("insert into t_case_frontsheet_closedown (bah,times,closedown_time,closedown_staff," +
|
|
|
+ "remark,visit_staff) " +
|
|
|
+ "values (#{bah},#{times},#{markTime},#{opStaff},#{remark},#{visitStaff})")
|
|
|
int executeClosedown(MarkStateRequest request);
|
|
|
|
|
|
@Select("select bah,admiss_times as times,name,sex,sign_staff, " +
|
|
@@ -703,12 +705,13 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
|
|
|
List<SheetOverview> getSimpleSheetForLendOut(String bah);
|
|
|
|
|
|
@Insert("<script>" +
|
|
|
- "insert into t_case_frontsheet_lendout (bah,times,lend_staff,remark,op_staff, " +
|
|
|
- "pat_name,dis_date,dis_dept) " +
|
|
|
+ "insert into t_case_frontsheet_lendout (bah,times,lend_staff,lend_time,remark,op_staff, " +
|
|
|
+ "pat_name,dis_date,dis_dept,lend_staff_phone) " +
|
|
|
"values " +
|
|
|
"<foreach collection='list' item='item' separator=','>" +
|
|
|
- "(#{item.bah},#{item.times},#{lendStaff}," +
|
|
|
- "#{remark},#{opStaff},#{item.name},#{item.disDate},#{item.deptName})" +
|
|
|
+ "(#{item.bah},#{item.times},#{lendStaff},#{lendTime}," +
|
|
|
+ "#{remark},#{opStaff},#{item.name},#{item.disDate}," +
|
|
|
+ "#{item.deptName},#{lendStaffPhone})" +
|
|
|
"</foreach>" +
|
|
|
"</script>")
|
|
|
int insertLendOutInfo(LendOutRequest request);
|
|
@@ -718,4 +721,24 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
|
|
|
|
|
|
@Update("update t_case_frontsheet_lendout set state='RETURNED',return_time=getdate() where id=#{id}")
|
|
|
int returnSheet(int id);
|
|
|
+
|
|
|
+ @Select("select top 1 bah,times, " +
|
|
|
+ "opStaff=(select rtrim(d.name) from a_employee_mi d where d.code=duplicate_staff), " +
|
|
|
+ "visit_staff,remark,duplicate_time as markTime " +
|
|
|
+ "from t_case_frontsheet_duplicate a where a.bah=#{bah} and a.times=#{times} " +
|
|
|
+ "order by duplicate_time desc")
|
|
|
+ MarkStateRequest selectExistRequest(String bah, int times);
|
|
|
+
|
|
|
+ @Select("select top 1 bah,times, " +
|
|
|
+ "opStaff=(select rtrim(d.name) from a_employee_mi d where d.code=closedown_staff), " +
|
|
|
+ "visit_staff,remark,closedown_time as markTime " +
|
|
|
+ "from t_case_frontsheet_closedown a where a.bah=#{bah} and a.times=#{times} " +
|
|
|
+ "order by closedown_time desc")
|
|
|
+ MarkStateRequest selectExistRequest2(String bah, int times);
|
|
|
+
|
|
|
+ @Select("select top 1 bah,times,lend_staff,lend_staff_phone,remark,lend_time, " +
|
|
|
+ "opStaff=(select rtrim(d.name) from a_employee_mi d where d.code=op_staff) " +
|
|
|
+ "from t_case_frontsheet_lendout where bah=#{bah} and times=#{times} and state='LEND_OUT' " +
|
|
|
+ "order by lend_time desc")
|
|
|
+ LendOutRequest selectExistLendOut(String bah, int times);
|
|
|
}
|