|
@@ -55,7 +55,10 @@ public interface UpIdCollectionDao {
|
|
|
" a.insutype as hi_type," + // -- 险种类型
|
|
|
" (select rytj from batj_ba1 where zyh = #{patNo} and zycs = #{times}) as admWay, " + // 入院途径
|
|
|
" a.setl_time as setl_end_date, " + //结算时间
|
|
|
- " a.ipt_med_type, a.hi_paymtd " + "from t_si_setlinfo a," +
|
|
|
+ " a.ipt_med_type, a.hi_paymtd, " +
|
|
|
+ " cast(fund_pay_sumamt as decimal(16,2)) as fund_pay_sumamt," +
|
|
|
+ " cast(maf_pay as decimal(16,2)) as maf_pay " +
|
|
|
+ "from t_si_setlinfo a," +
|
|
|
" t_si_pat_info b " + "where a.pat_no=b.pat_no and a.times=b.times " +
|
|
|
"and a.ledger_sn = b.ledger_sn " + "and a.pat_no = #{patNo} and a.times = #{times} " + "and a.ledger_sn = #{ledgerSn} " + "and a.revoked = 0 ")
|
|
|
SetlinfoUpld setlinfo1(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn);
|
|
@@ -69,7 +72,7 @@ public interface UpIdCollectionDao {
|
|
|
" unit_place as emp_addr /*单位地址*/,\n" +
|
|
|
" unit_phone as emp_tel /*工作单位手机*/,\n" +
|
|
|
" addr_zip_code as poscode /* 邮编*/,\n" +
|
|
|
- " nation as naty/*民族*/,\n" +
|
|
|
+ " (select wjw_code from zd_nation_code where code = nation) as naty/*民族*/,\n" +
|
|
|
" contact_name as coner_name/*联系人姓名*/,\n" +
|
|
|
" (select rtrim(yb_code)\n" +
|
|
|
" from zy_zd_relative_code\n" +
|
|
@@ -118,10 +121,10 @@ public interface UpIdCollectionDao {
|
|
|
" when '-' then 0\n" +
|
|
|
" else new_born_weight\n" +
|
|
|
" end as nwb_bir_wt/*新生儿体重*/,\n" +
|
|
|
- " case new_born_admiss_weight\n" +
|
|
|
- " when '-' then 0\n" +
|
|
|
- " else new_born_admiss_weight\n" +
|
|
|
- " end as nwb_adm_wt/*新生儿入院体重*/,\n" +
|
|
|
+// " case new_born_admiss_weight\n" +
|
|
|
+// " when '-' then 0\n" +
|
|
|
+// " else new_born_admiss_weight\n" +
|
|
|
+// " end as nwb_adm_wt/*新生儿入院体重*/,\n" +
|
|
|
" resp_nurs_code = (select yb_code\n" +
|
|
|
" from a_employee_mi\n" +
|
|
|
" where a_employee_mi.code = job_nurse) /*责任护士*/,\n" +
|
|
@@ -141,7 +144,7 @@ public interface UpIdCollectionDao {
|
|
|
|
|
|
|
|
|
@Select("select home_street as currAddr," +
|
|
|
- " nation_code as naty," +
|
|
|
+ "(select wjw_code from zd_nation_code where code = nation_code) as naty/*民族*/,\n" +
|
|
|
" relation_name as coner_name,\n" +
|
|
|
" (select yb_code from zy_zd_relative_code where code = relation_code) as patn_rlts,\n" +
|
|
|
" relation_street as conerAddr," +
|
|
@@ -264,21 +267,51 @@ public interface UpIdCollectionDao {
|
|
|
// 总金额 和 全自费 和 医疗收费项目
|
|
|
@Select("select med_chrgitm_type as med_chrgitm," +
|
|
|
"amt=cast(sum(det_item_fee_sumamt) as decimal(16,2)), " +
|
|
|
- "fulamt_ownpay_amt=cast(sum(fulamt_ownpay_amt) as decimal(16,2)), " +
|
|
|
+ "fulamt_ownpay_amt=cast(sum(det_item_fee_sumamt * (selfpay_prop)) as decimal(16,2)), " +
|
|
|
"claa_sumfee = 0,clab_amt = 0,oth_amt = 0 from t_si_setl_fee_detl " +
|
|
|
"where setl_id = #{setlId} group by med_chrgitm_type")
|
|
|
List<IteminfoUpld> amtAndOthAmt(@Param("setlId") String setlId);
|
|
|
|
|
|
+ @Select("select med_chrgitm_type as med_chrgitm," +
|
|
|
+ " sum(det_item_fee_sumamt) as amt\n" +
|
|
|
+ "from t_si_setl_fee_detl\n" +
|
|
|
+ "where setl_id = #{setlId}\n" +
|
|
|
+ "group by med_chrgitm_type")
|
|
|
+ List<IteminfoUpld> totalCost(@Param("setlId") String setlId);
|
|
|
+
|
|
|
+ @Select("select med_chrgitm_type as med_chrgitm," +
|
|
|
+ " sum(det_item_fee_sumamt * (1 - selfpay_prop)) as ${feeName} " +
|
|
|
+ "from t_si_setl_fee_detl " +
|
|
|
+ "where setl_id = #{setlId} " +
|
|
|
+ " and chrgitm_lv = #{chrgitmLv} " +
|
|
|
+ "group by med_chrgitm_type")
|
|
|
+ List<IteminfoUpld> aAndBFees(@Param("setlId") String setlId,
|
|
|
+ @Param("chrgitmLv") String chrgitmLv,
|
|
|
+ @Param("feeName") String feeName);
|
|
|
+
|
|
|
+ @Select("select med_chrgitm_type as med_chrgitm,\n" +
|
|
|
+ " sum(case\n" +
|
|
|
+ " when chrgitm_lv = '03' then det_item_fee_sumamt\n" +
|
|
|
+ " else det_item_fee_sumamt * selfpay_prop end) as fulamtOwnpayAmt\n" +
|
|
|
+ "from t_si_setl_fee_detl\n" +
|
|
|
+ "where setl_id = #{setlId}\n" +
|
|
|
+ "group by med_chrgitm_type")
|
|
|
+ List<IteminfoUpld> fulamtOwnpayAmt(@Param("setlId") String setlId);
|
|
|
+
|
|
|
// -- 01 甲类
|
|
|
@Select("select med_chrgitm_type as med_chrgitm," +
|
|
|
- "claa_sumfee=cast(sum(det_item_fee_sumamt) as decimal(16,2)) " +
|
|
|
+ "claa_sumfee=cast(sum(det_item_fee_sumamt * (1- selfpay_prop)) as decimal(16,2)) " +
|
|
|
"from t_si_setl_fee_detl " +
|
|
|
"where setl_id = #{setlId} and chrgitm_lv = '01' " +
|
|
|
"group by med_chrgitm_type")
|
|
|
List<IteminfoUpld> jiaLeiFeiYong(@Param("setlId") String setlId);
|
|
|
|
|
|
// -- 02 乙类
|
|
|
- @Select("select med_chrgitm_type as med_chrgitm," + "clab_amt=cast(sum(det_item_fee_sumamt) as decimal(16,2)) " + "from t_si_setl_fee_detl " + "where setl_id = #{setlId} and chrgitm_lv = '02' " + "group by med_chrgitm_type")
|
|
|
+ @Select("select med_chrgitm_type as med_chrgitm," +
|
|
|
+ "clab_amt=cast(sum(det_item_fee_sumamt * (1- selfpay_prop)) as decimal(16,2)) " +
|
|
|
+ "from t_si_setl_fee_detl " +
|
|
|
+ "where setl_id = #{setlId} and chrgitm_lv = '02' " +
|
|
|
+ "group by med_chrgitm_type")
|
|
|
List<IteminfoUpld> yiLeiFeiYong(@Param("setlId") String setlId);
|
|
|
|
|
|
|
|
@@ -389,14 +422,6 @@ public interface UpIdCollectionDao {
|
|
|
@Update("update t_yb_setl_modify_req set audit_flag = #{auditFlag} where id = #{id}")
|
|
|
void upAuditFlag(@Param("id") Integer id, @Param("auditFlag") Integer auditFlag);
|
|
|
|
|
|
- @Delete("delete zy_dis_diag_yb where inpatient_no = #{patNo} and admiss_times = #{times};" + "delete batj_ba4 where zyh = #{patNo} and zycs = #{times}")
|
|
|
- void delYuanShuJu(@Param("patNo") String patNo, @Param("times") Integer times);
|
|
|
-
|
|
|
-
|
|
|
- @Insert("insert into zy_dis_diag_yb (inpatient_no, admiss_times, dis_diag_no, dis_diag_type, dis_diag, " + " dis_diag_comment, op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, " + " operation, si_diag_type) " + "select inpatient_no, admiss_times, dis_diag_no, dis_diag_type, dis_diag, " + " dis_diag_comment, op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, " + " operation, si_diag_type from zy_dis_diag_yb_modify " + "where inpatient_no = #{patNo} and admiss_times = #{times}; " + "insert into batj_ba4 (bah, zyh, zycs, ssxh, ssrq, sstj, ssys, sszs1, sszs2, mzys, ssbm, ssmc, mzff, qkjb, " + " yhqk, ssbfz, fhqk, ssjb, cut_heal) " + "select bah, zyh, zycs, ssxh, ssrq, sstj, ssys, sszs1, sszs2, mzys, ssbm, ssmc, mzff, qkjb, yhqk, ssbfz, fhqk, ssjb, cut_heal " + "from batj_ba4_modify where zyh = #{patNo} and zycs = #{times};")
|
|
|
- void auditTongGuo(@Param("patNo") String patNo, @Param("times") Integer times);
|
|
|
-
|
|
|
-
|
|
|
@Update("update t_yb_setl_modify_req set audit_staff = #{auditStaff},audit_remark = #{remark},audit_name = #{auditName}," + "audit_date = getdate() " + "where id = #{id}")
|
|
|
void updateReq(@Param("id") Integer id, @Param("remark") String remark, @Param("auditStaff") String auditStaff, @Param("auditName") String auditName);
|
|
|
|
|
@@ -421,7 +446,7 @@ public interface UpIdCollectionDao {
|
|
|
@Select("select rtrim(name) from zd_country_code where si_code = #{ntly}")
|
|
|
String getNtlyName(String ntly);
|
|
|
|
|
|
- @Select("select rtrim(name) from zd_nation_code where code = #{naty}")
|
|
|
+ @Select("select rtrim(name) from zd_nation_code where wjw_code = #{naty}")
|
|
|
String getNatyName(String naty);
|
|
|
|
|
|
@Select("select rtrim(name) from t_zd_psn_cert_type where code = #{cert}")
|
|
@@ -430,7 +455,7 @@ public interface UpIdCollectionDao {
|
|
|
@Select("select rtrim(name) name from zy_occupation_code where code = #{prfs}")
|
|
|
String getPrfsName(String prfs);
|
|
|
|
|
|
- @Select("select rtrim(name) name from zy_zd_relative_code where yb_code = #{code}")
|
|
|
+ @Select("select rtrim(name) name from zy_zd_relative_code where yb_code = #{code}")
|
|
|
String getPatnRltsName(String code);
|
|
|
|
|
|
@Select("select rtrim(name) from t_si_admdvs where code = #{code} ")
|
|
@@ -480,10 +505,12 @@ public interface UpIdCollectionDao {
|
|
|
" relation_district as coner_addr, " +
|
|
|
" relation_tel as coner_tel, " +
|
|
|
" c.insuplc_admdvs as insuplc," +
|
|
|
- " b.nation_code as naty," +
|
|
|
+ " (select wjw_code from zd_nation_code where code = b.nation_code) as naty/*民族*/,\n" +
|
|
|
" '01' as patnRlts," +
|
|
|
" a.adress as conerAddr," +
|
|
|
- " '1' as hiPaymtd " +
|
|
|
+ " '1' as hiPaymtd, " +
|
|
|
+ " cast(fund_pay_sumamt as decimal(16,2)) as fund_pay_sumamt," +
|
|
|
+ " cast(maf_pay as decimal(16,2)) as maf_pay " +
|
|
|
"from mz_patient_mi a " +
|
|
|
" left join " +
|
|
|
" a_patient_mi b on (a.patient_id = b.mz_no) " +
|