|
@@ -165,10 +165,30 @@ public interface SiQueryDao {
|
|
|
"staffName=(select rtrim(name) from a_employee_mi where a_employee_mi.code=a.staff_id), " +
|
|
|
"a.balc,a.medfee_sumamt,a.hifp_pay,a.acct_pay,a.cvlserv_pay,a.psn_cash_pay, " +
|
|
|
"a.hifob_pay,a.oth_pay,a.hifmi_pay,a.maf_pay " +
|
|
|
- "from t_si_setlinfo a, t_si_pat_info b, ${table} c where a.setl_id=#{setlId} " +
|
|
|
+ "from t_si_setlinfo a, t_si_pat_info b, zy_inactpatient c where a.setl_id=#{setlId} " +
|
|
|
"and a.pat_no=b.pat_no and a.times=b.times and a.ledger_sn=b.ledger_sn and a.pat_no=c.inpatient_no " +
|
|
|
"and a.times=c.admiss_times")
|
|
|
- InptntSetlmtLst selectZySetlifo(@Param("setlId") String setlId, @Param("table") String table);
|
|
|
+ InptntSetlmtLst selectZySetlinfo(@Param("setlId") String setlId);
|
|
|
+
|
|
|
+ @Select("select a.mdtrt_id,a.psn_name,a.gend,a.age,a.psn_no,b.emp_name, " +
|
|
|
+ "a.psn_type,a.cvlserv_flag,a.pat_no,a.setl_id,b.insuplc_admdvs, " +
|
|
|
+ "tel=(select rtrim(home_tel) from a_patient_mi where a_patient_mi.inpatient_no=a.pat_no), " +
|
|
|
+ "admDeptName=(select rtrim(name) from zd_unit_code where code=isnull(c.zk_ward,c.small_dept)), " +
|
|
|
+ "c.bed_no as admBed,c.admiss_date as begntime, " +
|
|
|
+ "endtime=(select account_date from zy_ledger_file d where d.inpatient_no=a.pat_no and d.admiss_times=a.times and " +
|
|
|
+ "d.ledger_sn=a.ledger_sn), " +
|
|
|
+ "a.certno,a.mdtrt_cert_type, b.psn_idet_type, " +
|
|
|
+ "dscgMaindiagName=(select rtrim(dis_diag_comment) from zy_dis_diag_yb where zy_dis_diag_yb.inpatient_no=a.pat_no " +
|
|
|
+ "and zy_dis_diag_yb.admiss_times=a.times and zy_dis_diag_yb.dis_diag_no=1), " +
|
|
|
+ "a.med_type,a.setl_time,a.hifes_pay, " +
|
|
|
+ "chfpdrName=(select rtrim(name) from a_employee_mi where code=c.refer_physician), " +
|
|
|
+ "staffName=(select rtrim(name) from a_employee_mi where a_employee_mi.code=a.staff_id), " +
|
|
|
+ "a.balc,a.medfee_sumamt,a.hifp_pay,a.acct_pay,a.cvlserv_pay,a.psn_cash_pay, " +
|
|
|
+ "a.hifob_pay,a.oth_pay,a.hifmi_pay,a.maf_pay " +
|
|
|
+ "from t_si_setlinfo a, t_si_pat_info b, zy_actpatient c where a.setl_id=#{setlId} " +
|
|
|
+ "and a.pat_no=b.pat_no and a.times=b.times and a.ledger_sn=b.ledger_sn and a.pat_no=c.inpatient_no " +
|
|
|
+ "and a.times=c.admiss_times")
|
|
|
+ InptntSetlmtLst selectZyMidSetlinfo(@Param("setlId") String setlId);
|
|
|
|
|
|
@Select("select account_date from zy_ledger_file where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{sn}")
|
|
|
Date selectAccountDate(@Param("patNo") String patNo,
|
|
@@ -375,35 +395,35 @@ public interface SiQueryDao {
|
|
|
|
|
|
@Select("<script>" +
|
|
|
"select rtrim(a.inpatient_no) inpatient_no," +
|
|
|
- " a.admiss_times," +
|
|
|
- " rtrim(name) name," +
|
|
|
- " refer_physician_name = (select rtrim(name) from a_employee_mi where code = refer_physician)," +
|
|
|
- " small_dept_name = (select rtrim(name) from zd_unit_code where code = small_dept)," +
|
|
|
- " responce_type_name = (select rtrim(name) from zy_zd_responce_type where code = responce_type)," +
|
|
|
- " total_charge," +
|
|
|
- " sex," +
|
|
|
- " rtrim(c.dis_diag) dis_diag," +
|
|
|
- " rtrim(c.dis_diag_comment) dis_diag_comment," +
|
|
|
- " certno," +
|
|
|
- " insuplc_admdvs, " +
|
|
|
- " insuplc_admdvs_name = isnull((select name from t_region where code = insuplc_admdvs), " +
|
|
|
- " (select name from t_si_admdvs where code = insuplc_admdvs))" +
|
|
|
+ " a.admiss_times," +
|
|
|
+ " rtrim(name) name," +
|
|
|
+ " refer_physician_name = (select rtrim(name) from a_employee_mi where code = refer_physician)," +
|
|
|
+ " small_dept_name = (select rtrim(name) from zd_unit_code where code = small_dept)," +
|
|
|
+ " responce_type_name = (select rtrim(name) from zy_zd_responce_type where code = responce_type)," +
|
|
|
+ " total_charge," +
|
|
|
+ " sex," +
|
|
|
+ " rtrim(c.dis_diag) dis_diag," +
|
|
|
+ " rtrim(c.dis_diag_comment) dis_diag_comment," +
|
|
|
+ " certno," +
|
|
|
+ " insuplc_admdvs, " +
|
|
|
+ " insuplc_admdvs_name = isnull((select name from t_region where code = insuplc_admdvs), " +
|
|
|
+ " (select name from t_si_admdvs where code = insuplc_admdvs))" +
|
|
|
"from zy_actpatient a " +
|
|
|
- " left join t_si_pat_info b on (a.inpatient_no = b.pat_no and a.admiss_times = b.times) " +
|
|
|
- " left join zy_dis_diag_yb c on (a.inpatient_no = c.inpatient_no and a.admiss_times = c.admiss_times and c.dis_diag_no = 1) " +
|
|
|
+ "left join t_si_pat_info b on (a.inpatient_no = b.pat_no and a.admiss_times = b.times) " +
|
|
|
+ "left join zy_dis_diag_yb c on (a.inpatient_no = c.inpatient_no and a.admiss_times = c.admiss_times and c.dis_diag_no = 1) " +
|
|
|
"where " +
|
|
|
"setl_id is null and b.mdtrt_id is not null " +
|
|
|
"<if test=\"startTime !=null and startTime != '' \">" +
|
|
|
- " and admiss_date >= #{startTime} and admiss_date <= #{endTime} " +
|
|
|
+ "and admiss_date >= #{startTime} and admiss_date <= #{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"patNo != null and patNo != '' \">" +
|
|
|
- " and a.inpatient_no = #{patNo} /* 住院号 */ " +
|
|
|
+ "and a.inpatient_no = #{patNo} /* 住院号 */ " +
|
|
|
"</if>" +
|
|
|
"<if test=\"name != null and name != ''\">" +
|
|
|
- " and name like #{name} /*姓名*/ " +
|
|
|
+ "and name like #{name} /*姓名*/ " +
|
|
|
"</if>" +
|
|
|
"<if test=\"certno !=null and certno != '' \">" +
|
|
|
- " and certno = '' /*身份证号码*/" +
|
|
|
+ "and certno = '' /*身份证号码*/" +
|
|
|
"</if>" +
|
|
|
"</script>")
|
|
|
List<ZyActpatient> zaiYuanHuanZheXinXi(@Param("patNo") String patNo,
|