123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- package thyyxxk.webserver.dao.his.inpatient;
- import org.apache.ibatis.annotations.*;
- import thyyxxk.webserver.entity.dictionary.PureCodeName;
- import thyyxxk.webserver.entity.inpatient.dismiss.*;
- import java.math.BigDecimal;
- import java.util.Date;
- import java.util.List;
- import java.util.Map;
- @Mapper
- public interface DismissDao {
- @Select("select top 1 ltrim(rtrim(name)) from a_employee_mi where code=#{code}")
- String getOperateName(@Param("code") String code);
- @Select("select isnull(max ( ledger_sn ), isnull(min ( ledger_sn ), 1)) from zy_ledger_file where " +
- "inpatient_no=#{patNo} and admiss_times=#{times}")
- Integer getLedgerSn(@Param("patNo") String patNo, @Param("times") Integer times);
- @Update("exec zy_receive_drug @in_no=#{patNo},@times=#{times},@v_no=#{patNo}, @is_infant=0")
- void acceptFeeStepOne(@Param("patNo") String patNo, @Param("times") Integer times);
- @Update("exec zy_receive_one @in_no=#{patNo},@times=#{times},@v_no=#{patNo}, @is_infant=0")
- int acceptFeeStepTwo(@Param("patNo") String patNo, @Param("times") Integer times);
- @Update("exec dbo.zy_cngl_fyjs_list_yz_1 @in_no=#{patNo}, @in_times=#{times}")
- int getOrderList(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("select ltrim(rtrim(str(act_order_no))) as actOrderNo,rtrim(order_name) as orderName," +
- "charge_date as chargeDate, rtrim(charge_code) as chargeCode,charge_fee=rtrim(charge_fee), " +
- "chargeName=rtrim(charge_name), frequCode=rtrim(frequ_code)," +
- "cxFlag=cx_flag,drugSpecification=rtrim(drug_specification)," +
- "start_time,end_time,chargeAmount=charge_amount,page_no,charge_status," +
- "supplyCode=(select rtrim(name) from view_zd_supply_type where code=supply_code)," +
- "physician=(select rtrim(name) from a_employee_mi where code=physician)," +
- "enterOper=(select rtrim(name) from a_employee_mi where code=enter_oper)," +
- "execUnit=(select rtrim(name) from zd_unit_code where code=exec_unit)," +
- "wardName=(select rtrim(name) from zd_unit_code where code=ward_code)," +
- "order_code, group_no from zy_list where charge_status in ('5','6','8')")
- List<ActOrderDetail> getActOrderDetail();
- @Update("exec zy_calc_detail_again_new @in_no=#{patNo}," +
- "@times=#{times},@sn=#{ledgerSn},@orig_type='1',@new_type='1'")
- int hasUnsettledStepOne(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Select("select isnull(sum(depo_amount),0) from zy_deposit_file where depo_type='Y' " +
- "and inpatient_no=#{patNo} and admiss_times=#{times}")
- int hasUnsettledStepTwo(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("SELECT count(1) FROM zy_detail_charge WHERE inpatient_no=#{patNo} AND " +
- "admiss_times=#{times} and ledger_sn>=1 AND charge_fee <> 0 and charge_status ='1'")
- int hasNotAccounted(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("SELECT message = N'药单号:' + CAST(page_no as VARCHAR) + " +
- " N',药品名称:' + + (select top 1 name from yp_zd_dict where charge_code = code) + " +
- " N',医嘱号:' + CAST(CAST(act_order_no AS DECIMAL) AS VARCHAR(20)) " +
- " FROM yp_zy_patient WHERE inpatient_no=#{patNo} AND " +
- "admiss_times=#{times} AND amount <> 0 and acct_sign <> '2' ")
- List<String> hasUnreceivedDrugList(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("SELECT count(1) FROM yz_zy_patient_fee WHERE inpatient_no=#{patNo} " +
- "AND admiss_times=#{times} and charge_date<=#{actOrderDisDate} AND charge_fee <> 0 " +
- "and charge_status <> '0' and charge_status <> '2' ")
- int hasUnreceivedFees(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("actOrderDisDate") Date actOrderDisDate);
- @Select("SELECT count(1) FROM yz_yp_zy_order ( nolock ) WHERE inpatient_no=#{patNo} " +
- "AND admiss_times=#{times} AND ( amount > 0 or ( amount < 0 and " +
- "drug_class <> 'd' ) ) and status_flag='1' and page_no=0")
- int hasUnSubmitDrugList(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("SELECT count(1) FROM yz_yp_zy_order ( nolock ) WHERE inpatient_no=#{patNo} " +
- "AND admiss_times=#{times} AND ( amount > 0 or ( amount < 0 and " +
- "drug_class <> 'd' ) ) and status_flag='1' and ( case when amount > 0 then " +
- "page_no else page_no_ty end > 0 ) ")
- int hasUntreatedDrugWithdrawalOrder(@Param("patNo") String patNo,
- @Param("times") Integer times);
- @Select("SELECT count(1) FROM yz_zy_patient_fee WHERE inpatient_no=#{patNo} " +
- "AND admiss_times=#{times} and charge_date<=#{actOrderDisDate} AND " +
- "charge_fee <> 0 and charge_status='3'")
- int hasUnconfirmedMedicalTech(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("actOrderDisDate") Date actOrderDisDate);
- @Select("select * from (select sum(a.charge_fee) as code,a.charge_code_mx as chargeCode,b.name from zy_detail_charge a, " +
- "zd_charge_item b where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and " +
- "a.charge_code_mx=b.code group by a.charge_code_mx,b.name union select " +
- "sum(a.charge_fee) as code,a.charge_code_mx as chargeCode,b.name from zy_detail_charge a,yp_zd_dict b " +
- "where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and a.charge_code_mx=b.code " +
- "group by a.charge_code_mx,b.name ) as x where x.code<0")
- List<NegativeFee> feeOrderNegative(@Param("patNo") String patNo, @Param("times") Integer times);
- @Delete("delete zy_tmp_settle_select_detail where inpatient_no=#{patNo} and admiss_times=#{times}")
- void deleteTemporaryTable(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("select dateadd(second,1,account_date) from zy_ledger_file where inpatient_no=#{patNo} and " +
- "admiss_times=#{times} and ledger_sn=(#{ledgerSn}-1)")
- Date selectLastLedgerAccountDate(@Param("patNo") String patNo, @Param("times") int times, @Param("ledgerSn") int ledgerSn);
- @Select("select admiss_date from ${table} where inpatient_no=#{patNo} and admiss_times=#{times}")
- Date selectAdmissDate(@Param("patNo") String patNo, @Param("times") Integer times, @Param("table") String table);
- @Select("SELECT settle_type FROM zy_ledger_file WHERE inpatient_no=#{patNo} " +
- "AND admiss_times=#{times} AND ledger_sn=#{ledgerSn}")
- int hasSettled(@Param("patNo") String patNo,
- @Param("times") Integer times, @Param("ledgerSn") int ledgerSn);
- @Select("select count(1) from zy_tmp_settle_select_detail where inpatient_no=#{patNo} " +
- "and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
- int hasUncheckedFee(@Param("patNo") String patNo,
- @Param("times") Integer times, @Param("ledgerSn") int ledgerSn);
- @Select("select count(1) from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
- "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')")
- Integer countDisActOrders(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("select count(1) from yz_inact_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
- "and status_flag > '2' and isnull(group_no,'00' )='00' and order_code in ('06026','06053','05973')")
- Integer countDisActOrders2(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("select (select isnull(sum(charge_fee),0) from zy_detail_charge where inpatient_no=#{patNo} " +
- "and admiss_times=#{times} and ledger_sn=#{ledgerSn} and isnull(charge_status, '1') <> '1') - " +
- "(select isnull(total_charge,0) from zy_ledger_file " +
- "where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn})")
- BigDecimal getFeeOffset(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Select("select isnull(sum(charge_fee),0) from zy_detail_charge where inpatient_no=#{patNo} and " +
- "admiss_times=#{times} and ledger_sn=#{ledgerSn} and isnull(charge_status, '1')!='1' and " +
- "isnull(trans_flag_yb,0)!=2 and charge_date ${compare} #{timeLimit}")
- BigDecimal selectOverTimeLimitFee(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn,
- @Param("compare") String compare,
- @Param("timeLimit") Date timeLimit);
- @Delete("delete zy_ledger_file_yb where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
- void deleteZyLedgerFileYb(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Insert("insert into zy_ledger_file_yb (inpatient_no,admiss_times,ledger_sn,total_cost,tczf,grzhzf,dbzf,xjzf," +
- "full_self_pay,part_self_pay,hospital_pay) values (#{inpatientNo},#{admissTimes},#{ledgerSn},#{totalCost}," +
- "#{tczf},#{grzhzf},#{dbzf},#{xjzf},#{fullSelfPay},#{partSelfPay},#{hospitalPay})")
- int insertZyLedgerFileYb(MedinsSettleFee settleFee);
- @Update("update zy_ledger_file set charge_yb=1 where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
- int beforeWriteReceiptTable(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Insert("insert into zy_receipt (inpatient_no,admiss_times,ledger_sn,receipt_sn,receipt_no," +
- "account_date,date_1,date_2,ward,dept,print_date,responce_unit,op_id_code,total_charge," +
- "charge1,charge2,charge3,charge4,charge5,charge6,charge7,charge8,charge9,charge10,charge11," +
- "charge12,charge13,charge14,charge15,charge16,charge17,charge18,charge19,charge20,charge21," +
- "charge22,charge23,charge24,charge25,charge26,charge27,charge28,charge29,charge30) " +
- "values (#{patNo},#{times},#{ledgerSn},#{receiptSn},'0000000',#{dismissDate}," +
- "#{admissDate},#{dismissDate},#{wardCode},#{deptCode},#{printDate},#{responceUnit},#{codeRs}," +
- "#{map.total},#{map.001},#{map.002},#{map.003},#{map.004},#{map.005},#{map.006},#{map.007},#{map.008},#{map.009},#{map.010}," +
- "#{map.011},#{map.012},#{map.013},#{map.014},#{map.015},#{map.016},#{map.017},#{map.018},#{map.019},#{map.020},#{map.021},#{map.022}," +
- "#{map.023},#{map.024},#{map.025},#{map.026},#{map.027},#{map.028},'0.00','0.00')")
- int writeReceiptTable(@Param("patNo") String patNo, @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn, @Param("receiptSn") int receiptSn,
- @Param("admissDate") Date admissDate, @Param("dismissDate") Date dismissDate,
- @Param("wardCode") String wardCode, @Param("deptCode") String deptCode,
- @Param("printDate") Date printDate, @Param("responceUnit") String responceUnit,
- @Param("codeRs") String codeRs, @Param("map") Map<String, String> map);
- @Select("select max(infant_flag) FROM zy_detail_charge WHERE inpatient_no=#{patNo} and admiss_times=#{times}")
- int hasInfant(@Param("patNo") String patNo, @Param("times") Integer times);
- @Update("update zy_ledger_file set account_date=#{zjdzDatetime},settle_type='1',balance=0,dept_code=#{deptCode}," +
- "last_balance=total_charge,settle=deposit-total_charge,ward_code=#{wardCode},op_id_code=#{staffId}," +
- "responce_type='01',charge_yb=0,fund_pay_sumamt=0,acct_pay=0 from zy_ledger_file " +
- "where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes} and ledger_sn=#{ledgerSn}")
- int updateZifeiCostStatus(MedinsSettleFee settleFee);
- @Update("update zy_ledger_file set account_date=#{zjdzDatetime},settle_type='1',balance=0,last_balance=#{xjzf}, " +
- "settle=(deposit-#{xjzf}),ward_code=#{wardCode},dept_code=#{deptCode},op_id_code=#{staffId},charge_yb=0," +
- "fund_pay_sumamt=#{tczf},acct_pay=#{grzhzf} where inpatient_no=#{inpatientNo} and " +
- "admiss_times=#{admissTimes} and ledger_sn=#{ledgerSn}")
- int updateCostStatusWithoutInfant(MedinsSettleFee settleFee);
- @Update("update zy_ledger_file set account_date=#{zjdzDatetime},settle_type='1',balance=0,charge_yb=0, " +
- "last_balance=(total_charge-#{tczf}-#{grzhzf}),settle=(deposit-total_charge+#{tczf}+#{grzhzf}), " +
- "ward_code=#{wardCode},dept_code=#{deptCode},op_id_code=#{staffId},fund_pay_sumamt=#{tczf},acct_pay=#{grzhzf} " +
- "where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes} and ledger_sn=#{ledgerSn}")
- int updateCostStatusWithInfant(MedinsSettleFee settleFee);
- @Update("update zy_detail_charge set charge_status=3 where charge_status=2 and " +
- "inpatient_no=#{patNo} AND admiss_times=#{times} AND ledger_sn=#{ledgerSn}")
- int updateZyDetailCharge(@Param("patNo") String patNo,
- @Param("times") Integer times, @Param("ledgerSn") int ledgerSn);
- @Select("select start_time from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
- "and status_flag > '1' and isnull(group_no, '00')='00' and order_code in ('06026','06053','05973')")
- Date selectActOrderDisDate(@Param("patNo") String patNo, @Param("times") Integer times);
- @Select("select start_time from yz_inact_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
- "and status_flag > '1' and isnull(group_no, '00')='00' and order_code in ('06026','06053','05973')")
- Date selectActOrderDisDate2(@Param("patNo") String patNo, @Param("times") Integer times);
- @Update("update ${table} SET dis_date=#{disDate},dis_ward=ward,dis_dept=dept,job_nurse=#{codeRs}," +
- "bed_status='5' WHERE inpatient_no=#{patNo} AND admiss_times=#{times}")
- int updateZyActpatient(@Param("patNo") String patNo, @Param("times") Integer times,
- @Param("disDate") Date disDate, @Param("codeRs") String codeRs, @Param("table") String table);
- @Delete("DELETE FROM zy_inactpatient WHERE inpatient_no=#{patNo} AND admiss_times=#{times}")
- void deleteZyInactpatient(@Param("patNo") String patNo, @Param("times") Integer times);
- @Insert("INSERT INTO zy_inactpatient SELECT * FROM zy_actpatient WHERE inpatient_no=#{patNo} AND admiss_times=#{times}")
- int insertZyInactpatient(@Param("patNo") String patNo, @Param("times") Integer times);
- @Update("update ${table} SET dis_date=#{disDate},dis_ward=ward,dis_dept=dept WHERE inpatient_no >=#{patNo1} " +
- "and inpatient_no <= #{patNo6} and admiss_times=#{times}")
- void updateZyActpatientAgain(@Param("patNo1") String patNo1,
- @Param("patNo6") String patNo6,
- @Param("times") Integer times,
- @Param("disDate") Date disDate, @Param("table") String table);
- @Insert("INSERT INTO zy_inactpatient SELECT * FROM zy_actpatient WHERE inpatient_no >=#{patNo1} " +
- "and inpatient_no <= #{patNo6} and admiss_times=#{times}")
- void insertZyInactpatientAgain(@Param("patNo1") String patNo1,
- @Param("patNo6") String patNo6,
- @Param("times") Integer times);
- @Update("update zy_adt SET dis_date=#{disDate},orig_ward=#{wardCode},orig_dept=#{deptCode},orig_bed=#{bedNo} " +
- "WHERE inpatient_no=#{patNo} AND admiss_times=#{times} AND trans_times=0")
- int updateZyAdt(@Param("patNo") String patNo, @Param("times") Integer times,
- @Param("wardCode") String wardCode, @Param("deptCode") String deptCode,
- @Param("bedNo") String bedNo, @Param("disDate") Date disDate);
- @Update("update zy_bed_mi SET bed_status='1',admiss_times=NULL,inpatient_no=NULL WHERE " +
- "inpatient_no=#{patNo} AND admiss_times=#{times}")
- void updateZyBedMi(@Param("patNo") String patNo, @Param("times") Integer times);
- @Delete("DELETE FROM zy_actpatient WHERE inpatient_no=#{patNo}")
- void deleteZyActpatient(@Param("patNo") String patNo);
- @Delete("DELETE FROM zy_actpatient WHERE inpatient_no >= #{patNo1} and inpatient_no <= #{patNo6} " +
- " and admiss_times=#{times}")
- void deleteZyActpatientAgain(@Param("patNo1") String patNo1, @Param("patNo6") String patNo6,
- @Param("times") Integer times);
- @Insert("insert into zy_work_log (inpatient_no,admiss_times,ledger_sn,op_id,op_date,log_type," +
- "dept_code,ward_code,name) values (#{patNo},#{times},#{ledgerSn},#{codeRs}," +
- "getDate(),#{logType},#{deptCode},#{wardCode},#{userName})")
- int insertNewZyWorkLog(@Param("patNo") String patNo, @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn, @Param("wardCode") String wardCode,
- @Param("logType") String logType, @Param("deptCode") String deptCode,
- @Param("codeRs") String codeRs, @Param("userName") String userName);
- @Update("update ${table} set times_billed=(times_billed+1) where " +
- "inpatient_no=#{patNo} and admiss_times=#{times}")
- void updateTimesBilledByIncreaseOne(@Param("patNo") String patNo, @Param("times") Integer times, @Param("table") String table);
- @Insert("INSERT INTO zy_ledger_file (inpatient_no, admiss_times, ledger_sn, op_id_code, deposit, balance, " +
- "total_charge, charge1, charge2, charge3, charge4, charge5, charge6, charge7, charge8, charge9, " +
- "charge10, charge11, charge12, charge13, charge14, charge15, charge16, charge17, charge18, " +
- "charge19, charge20, last_balance, settle, settle_type) VALUES " +
- "(#{patNo}, #{times}, #{ledgerSn}, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " +
- "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0')")
- void insertNewLedgerFile(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Update("update zy_ledger_file set total_charge=" +
- "(select isnull(sum(charge_fee),0) from zy_detail_charge where inpatient_no=#{patNo} and " +
- "admiss_times=#{times} and ledger_sn=#{ledgerSn}) where inpatient_no=#{patNo} " +
- "and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
- void updateZyLedgerFileTotalCharge(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Update("update zy_detail_charge set ledger_sn=#{ledgerSn} where inpatient_no=#{patNo} " +
- "and admiss_times=#{times} and ledger_sn=#{lastSn} and charge_date>#{zjdzDate}")
- void updateFeesLedgerSn(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn,
- @Param("lastSn") int lastSn,
- @Param("zjdzDate") Date zjdzDate);
- @Update("update zy_actpatient set responce_type='01', visit_type='01', yb_type='', treat_type=''," +
- "yb_register_date=#{date} where inpatient_no=#{patNo} and admiss_times=#{times}")
- void clearMedinsInfo(@Param("patNo") String patNo, @Param("times") Integer times, @Param("date") Date date);
- @Select("select rtrim(hic_no_new) from a_patient_mi where inpatient_no=#{zyh}")
- String getHicNoNew(@Param("zyh") String zyh);
- @Update("update a_patient_mi set cpy=#{hicNew} where inpatient_no=#{zyh}")
- void updateCpy(@Param("zyh") String zyh, @Param("hicNew") String hicNew);
- @Update("update a_patient_mi set hic_no=#{hicNew} where inpatient_no=#{zyh}")
- void updateHic(@Param("zyh") String zyh, @Param("hicNew") String hicNew);
- @Select("select mdtrt_id,med_type from t_si_pat_info where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
- BriefMdtrtInfo selectMdtrtId(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Select("select serial_no from t_injury_si_pat_info where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
- String selectInjurySerialNo(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("ledgerSn") int ledgerSn);
- @Select("select count(1) from zy_dis_diag_yb where inpatient_no=#{patNo} and admiss_times=#{times}")
- int hasDismissDiag(@Param("patNo") String patNo,
- @Param("times") Integer times);
- @Update("update zy_actpatient set total_charge=#{map.total},charge1=#{map.001},charge2=#{map.002}, " +
- "charge3=#{map.003},charge4=#{map.004},charge5=#{map.005},charge6=#{map.006},charge7=#{map.007}, " +
- "charge8=#{map.008},charge9=#{map.009},charge10=#{map.010},charge11=#{map.011},charge12=#{map.012}, " +
- "charge13=#{map.013},charge14=#{map.014},charge15=#{map.015},charge16=#{map.016},charge17=#{map.017}, " +
- "charge18=#{map.018},charge19=#{map.019},charge20=#{map.020},charge21=#{map.021},charge22=#{map.022}," +
- "charge23=#{map.023},charge24=#{map.024},charge25=#{map.025},charge26=#{map.026},charge27=#{map.027}, " +
- "charge28=#{map.028},charge29=0,charge30=0 where inpatient_no>=#{patNo1} and inpatient_no<=#{patNo6} and " +
- "admiss_times=#{times} ")
- void updateInfantfee(@Param("patNo1") String patNo1,
- @Param("patNo6") String patNo6,
- @Param("times") int times,
- @Param("map") Map<String, String> map);
- @Select("select b.bill_item_zy as bill_code, ledger_fee=sum(a.charge_fee), " +
- "infant_fee=sum(case when isnull(infant_flag,0)=1 then charge_fee else 0 end), " +
- "adult_fee=sum(case when isnull(infant_flag,0)!=1 then charge_fee else 0 end) " +
- "from zy_detail_charge a, zd_charge_item b " +
- "where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and " +
- "a.ledger_sn=#{ledgerSn} and a.charge_status!='1' and " +
- "a.charge_date>=#{begntime} and a.charge_date<=#{endtime} and " +
- "a.charge_code=b.code group by b.bill_item_zy, a.ledger_sn")
- List<ReceiptFee> selectLedgerFees(@Param("patNo") String patNo,
- @Param("times") int times,
- @Param("ledgerSn") int ledgerSn,
- @Param("begntime") Date begntime,
- @Param("endtime") Date endtime);
- @Select("select code from zy_bill_item")
- List<String> selectBillCodes();
- @Select("select code from zy_zd_responce_type where med_type=(select med_type from t_si_pat_info " +
- "where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn} and isnull(mdtrt_id,'')!='')")
- String selectResponceType(@Param("patNo") String patNo,
- @Param("times") int times,
- @Param("ledgerSn") int ledgerSn);
- @Select("select cast(isnull(sum(depo_amount),0) as varchar(16)) from zy_deposit_file where " +
- "inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn} and status in (1,2) ")
- String selectDepositSumamt(@Param("patNo") String patNo,
- @Param("times") int times,
- @Param("ledgerSn") int ledgerSn);
- @Update("update zy_ledger_file set deposit=#{deposit}, balance=#{balance}, responce_type=#{restype}, " +
- "total_charge=#{map.total},charge1=#{map.001},charge2=#{map.002}, charge3=#{map.003},charge4=#{map.004}, " +
- "charge5=#{map.005},charge6=#{map.006},charge7=#{map.007}, charge8=#{map.008},charge9=#{map.009}, " +
- "charge10=#{map.010},charge11=#{map.011},charge12=#{map.012}, charge13=#{map.013},charge14=#{map.014}, " +
- "charge15=#{map.015},charge16=#{map.016},charge17=#{map.017}, charge18=#{map.018},charge19=#{map.019}, " +
- "charge20=#{map.020},charge21=#{map.021},charge22=#{map.022}, charge23=#{map.023},charge24=#{map.024}, " +
- "charge25=#{map.025},charge26=#{map.026},charge27=#{map.027}, charge28=#{map.028},charge29=0,charge30=0 " +
- "where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
- void updateZyLedgerFileCharges(@Param("patNo") String patNo,
- @Param("times") int times,
- @Param("ledgerSn") int ledgerSn,
- @Param("deposit") String deposit,
- @Param("balance") String balance,
- @Param("restype") String restype,
- @Param("map") Map<String, String> map);
- @Update("update zy_actpatient set balance=#{balance},responce_type=#{restype}, total_charge=#{totalCost}, " +
- "charge1=#{map.001},charge2=#{map.002}, charge3=#{map.003},charge4=#{map.004},charge5=#{map.005}, " +
- "charge6=#{map.006},charge7=#{map.007}, charge8=#{map.008},charge9=#{map.009},charge10=#{map.010}, " +
- "charge11=#{map.011},charge12=#{map.012}, charge13=#{map.013},charge14=#{map.014},charge15=#{map.015}, " +
- "charge16=#{map.016},charge17=#{map.017}, charge18=#{map.018},charge19=#{map.019},charge20=#{map.020}, " +
- "charge21=#{map.021},charge22=#{map.022}, charge23=#{map.023},charge24=#{map.024},charge25=#{map.025}, " +
- "charge26=#{map.026},charge27=#{map.027}, charge28=#{map.028},charge29=0,charge30=0 where inpatient_no=#{patNo} ")
- void updateZyActpatientCharges(@Param("patNo") String patNo,
- @Param("totalCost") String totalCost,
- @Param("balance") String balance,
- @Param("restype") String restype,
- @Param("map") Map<String, String> map);
- @Select("select isnull(sum(charge_fee),0) from zy_detail_charge where inpatient_no=#{patNo} " +
- "and admiss_times=#{times} and ledger_sn>0 and isnull(charge_status,'1')!='1' ")
- String selectTotalCharge(@Param("patNo") String patNo,
- @Param("times") int times);
- @Select("select datediff(day,#{begn},#{end}) ")
- int selectInhospdays(@Param("begn") Date begn, @Param("end") Date end);
- @Select("select b.bill_item_zy as code,sum(a.charge_amount) as name from zy_detail_charge a, zd_charge_item b " +
- "where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and a.charge_status!='1' and b.bill_item_zy " +
- "in ('003') and a.charge_code_mx not in ('017623','011062','010437','010435','011193') " +
- "and a.charge_code=b.code group by b.bill_item_zy")
- List<PureCodeName> selectChargeQuantities(@Param("patNo") String patNo,
- @Param("times") int times);
- }
|