DailyPatientCountDao.java 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package thyyxxk.webserver.dao.his.scheduled;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Select;
  4. import thyyxxk.webserver.entity.scheduled.DailyPatientCount;
  5. @Mapper
  6. public interface DailyPatientCountDao {
  7. @Select("select inHospCount=((select count(1) from zy_actpatient with(nolock) where inpatient_no not like 'JT%')- " +
  8. "(select count(1) from zy_actpatient a with(nolock),yz_act_order b where a.inpatient_no not like 'JT%' " +
  9. "and a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times and b.status_flag > '2' and " +
  10. "isnull(b.group_no,'00' )='00' and b.order_code in ('06026','06053','05973'))), " +
  11. "admissCount=(select count(1) from zy_actpatient with(nolock) where datediff(day,admiss_date,getdate())=1), " +
  12. "dismissCount=((select count(1) from yz_act_order with(nolock) where status_flag > '2' and " +
  13. "datediff(day,start_time,getdate())=1 and isnull(group_no,'00' )='00' and order_code in ('06026','06053')) " +
  14. "+ (select count(1) from yz_inact_order with(nolock) where status_flag > '2' and " +
  15. "datediff(day,start_time,getdate())=1 and isnull(group_no,'00' )='00' and order_code in ('06026','06053'))), " +
  16. "deadCount=((select count(1) from yz_act_order with(nolock) where status_flag > '2' and " +
  17. "datediff(day,start_time,getdate())=1 and isnull(group_no,'00' )='00' and order_code='05973') + " +
  18. "(select count(1) from yz_inact_order with(nolock) where status_flag > '2' and " +
  19. "datediff(day,start_time,getdate())=1 and isnull(group_no,'00' )='00' and order_code='05973'))," +
  20. "heavyCount=(select count(1) from yz_act_order with(nolock) where status_flag!='5' " +
  21. "and isnull(group_no,'00' )='00' and order_code='05888'), " +
  22. "dangerCount=(select count(1) from yz_act_order with(nolock) where status_flag!='5' " +
  23. "and isnull(group_no,'00' )='00' and order_code='05887'), " +
  24. "operationCount=(select count(1) from op_record with(nolock) where status!='d' and datediff(day,op_datetime,getdate())=1), " +
  25. "clinicCount=(select count(1) from mzy_reqrec with(nolock) where datediff(day,visit_date,getdate())=1), " +
  26. "rescueCount=((select count(1) from yz_act_order with(nolock) where status_flag > '2' and " +
  27. "datediff(day,start_time,getdate())=1 and isnull(group_no,'00' )='00' and order_code in " +
  28. "('05202','04311','08893','08894','01535','01537','05243','02628','05240','05242','05241','04313','01446','06383', " +
  29. "'08897','08898','05011','01445','04312','08895','08896')) " +
  30. "+ (select count(1) from yz_inact_order with(nolock) where status_flag > '2' and " +
  31. "datediff(day,start_time,getdate())=1 and isnull(group_no,'00' )='00' and order_code in " +
  32. "('05202','04311','08893','08894','01535','01537','05243','02628','05240','05242','05241','04313','01446','06383', " +
  33. "'08897','08898','05011','01445','04312','08895','08896')))")
  34. DailyPatientCount selectDailyCount();
  35. }