|
@@ -942,7 +942,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
@Param("ledger") Integer ledger,
|
|
|
@Param("detailSn") Integer detailSn);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@Select("select act_order_no as order_no,exec_unit from yz_erase_order where act_order_no in " +
|
|
|
"(select order_no from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
|
|
|
"and exec_unit is null AND charge_fee < 0 and ori_detail_sn is null)")
|
|
@@ -953,7 +953,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
@Update("<script>" +
|
|
|
" <foreach collection='list' item='item' separator=';' >" +
|
|
|
"update zy_detail_charge set exec_unit = #{item.execUnit} where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
|
|
|
- "and act_order_no = #{item.orderNo} and exec_unit is null and charge_fee < 0" +
|
|
|
+ "and order_no = #{item.orderNo} and exec_unit is null and charge_fee < 0" +
|
|
|
"</foreach> " +
|
|
|
"</script> ")
|
|
|
void yiZhuTuiFeiGenXingZhiXingKeShi(@Param("inpatientNo") String inpatientNo,
|
|
@@ -981,6 +981,19 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
"</script>")
|
|
|
void genXinYaoPingPiPeiXinXi(@Param("list") List<String> list);
|
|
|
|
|
|
+
|
|
|
+ @Select("select a.charge_code_mx,case when (select top(1) rtrim(name) from zd_charge_item where code = a.charge_code_mx) != '' then " +
|
|
|
+ "(select top(1) rtrim(name) from zd_charge_item where code = a.charge_code_mx) else " +
|
|
|
+ "(select top(1) rtrim(name) from yp_zd_dict where code = a.charge_code_mx) end as name " +
|
|
|
+ "from zy_detail_charge a left join zd_charge_item_hnsgs b " +
|
|
|
+ "on (a.charge_code_mx = b.hosp_code) where " +
|
|
|
+ "inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} and infant_flag = #{infantFlag} and isnull(b.hnsyb_item_code,'') = '' " +
|
|
|
+ "group by a.charge_code_mx ")
|
|
|
+ List<WeiGuiFeiYongFenXi> gongShangWeiPiPei(@Param("inpatientNo") String inpatientNo,
|
|
|
+ @Param("admissTimes") Integer admissTimes,
|
|
|
+ @Param("ledger") Integer ledger,
|
|
|
+ @Param("infantFlag") Integer infantFlag);
|
|
|
+
|
|
|
/**
|
|
|
* 违规药品 信息 没有匹配的
|
|
|
*
|
|
@@ -989,24 +1002,24 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
* @param ledger 账页号
|
|
|
* @return 返回违规药品 没有匹配的
|
|
|
*/
|
|
|
- @Select("select charge_code_mx,b.name,national_code from zy_detail_charge a, yp_zd_dict b " +
|
|
|
- "where order_no <> 6 and trans_flag_yb not in (1,2) and charge_code like 'BILL%' " +
|
|
|
+ @Select("select charge_code_mx,b.name from zy_detail_charge a, yp_zd_dict b " +
|
|
|
+ "where trans_flag_yb not in (1,2) and charge_code like 'BILL%' " +
|
|
|
" and isnull(b.national_code,'') = '' and inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
|
|
|
"and a.infant_flag = #{infantFlag} " +
|
|
|
" and a.charge_code_mx = b.code " +
|
|
|
- "group by charge_code_mx, b.name, national_code")
|
|
|
+ "group by charge_code_mx, b.name")
|
|
|
List<WeiGuiFeiYongFenXi> weiGuiYaoPin(@Param("inpatientNo") String inpatientNo,
|
|
|
@Param("admissTimes") Integer admissTimes,
|
|
|
@Param("ledger") Integer ledger,
|
|
|
@Param("infantFlag") Integer infantFlag);
|
|
|
|
|
|
|
|
|
- @Select("select charge_code_mx,b.name,national_code from zy_detail_charge a, zd_charge_item b " +
|
|
|
- "where order_no <> 6 and trans_flag_yb not in (1,2) and charge_code not like 'BILL%' " +
|
|
|
+ @Select("select charge_code_mx,b.name from zy_detail_charge a, zd_charge_item b " +
|
|
|
+ "where trans_flag_yb not in (1,2) and charge_code not like 'BILL%' " +
|
|
|
" and isnull(b.national_code,'') = '' and inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
|
|
|
" and a.infant_flag = #{infantFlag} " +
|
|
|
" and a.charge_code_mx = b.code " +
|
|
|
- "group by charge_code_mx, b.name, national_code")
|
|
|
+ "group by charge_code_mx, b.name")
|
|
|
List<WeiGuiFeiYongFenXi> weiGuiXiangMu(@Param("inpatientNo") String inpatientNo,
|
|
|
@Param("admissTimes") Integer admissTimes,
|
|
|
@Param("ledger") Integer ledger,
|
|
@@ -1090,23 +1103,48 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
"from zy_detail_charge where " +
|
|
|
"inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and charge_code_mx = #{chargeCodeMx} " +
|
|
|
"and exec_unit = #{execUnit} and trans_flag_yb <> 2 and order_no <> 6 and" +
|
|
|
- " detail_sn in(select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and charge_code_mx = #{chargeCodeMx}" +
|
|
|
+ " detail_sn in(select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and " +
|
|
|
+ "ledger_sn = #{ledgerSn} and charge_code_mx = #{chargeCodeMx}" +
|
|
|
" and charge_fee <0 and ori_detail_sn is not null) " +
|
|
|
"union all " +
|
|
|
"select inpatient_no,admiss_times,ledger_sn,ori_detail_sn,charge_code_mx,charge_fee " +
|
|
|
"from zy_detail_charge where " +
|
|
|
"inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and charge_code_mx = #{chargeCodeMx} " +
|
|
|
"and exec_unit = #{execUnit} and trans_flag_yb <> 2 and order_no <> 6 and " +
|
|
|
- "ori_detail_sn in(select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and charge_code_mx = #{chargeCodeMx} and charge_fee <0 and ori_detail_sn is not null) " +
|
|
|
+ "ori_detail_sn in(select ori_detail_sn from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} " +
|
|
|
+ "and ledger_sn = #{ledgerSn} and charge_code_mx = #{chargeCodeMx} and charge_fee <0 and ori_detail_sn is not null) " +
|
|
|
") temp " +
|
|
|
"group by inpatient_no, admiss_times, ledger_sn, detail_sn, charge_code_mx")
|
|
|
List<ZyDetailCharge> tuiFeiYuEr1(@Param("inpatientNo") String inpatientNo,
|
|
|
@Param("admissTimes") Integer admissTimes,
|
|
|
@Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("infantFlag") Integer infantFlag,
|
|
|
@Param("chargeCodeMx") String chargeCodeMx,
|
|
|
@Param("execUnit") String execUnit);
|
|
|
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select detail_sn,ori_detail_sn,order_no,charge_fee,charge_amount,charge_code_mx,charge_date, " +
|
|
|
+ " exec_unit_name = (select rtrim(name) from zd_unit_code where code =exec_unit), " +
|
|
|
+ " ward_code = (select rtrim(name) from zd_unit_code where code = ward_code) " +
|
|
|
+ " from zy_detail_charge where " +
|
|
|
+ " inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} " +
|
|
|
+ "and infant_flag = #{infantFlag} " +
|
|
|
+ "and charge_code_mx = #{chargeCodeMx} and trans_flag_yb <> 2 and order_no <> 6 " +
|
|
|
+ "and charge_amount > 0 " +
|
|
|
+ "<if test=\"startTime != null and startTime != '' \">" +
|
|
|
+ "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ "</if>" +
|
|
|
+ "order by charge_date ${riQiPaiXu}" +
|
|
|
+ "</script>")
|
|
|
+ List<ZyDetailCharge> genJuBianMaChaZhaoZhenShuFeiYong(@Param("inpatientNo") String inpatientNo,
|
|
|
+ @Param("admissTimes") Integer admissTimes,
|
|
|
+ @Param("ledgerSn") Integer ledgerSn,
|
|
|
+ @Param("infantFlag") Integer infantFlag,
|
|
|
+ @Param("chargeCodeMx") String chargeCodeMx,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("riQiPaiXu") String riQiPaiXu);
|
|
|
+
|
|
|
@Select("<script>" +
|
|
|
"select * from zy_detail_charge " +
|
|
|
"where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and infant_flag = #{infantFlag} and detail_sn in " +
|