123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- package thyyxxk.simzfeeoprnsystm.dao;
- import thyyxxk.simzfeeoprnsystm.pojo.*;
- import org.apache.ibatis.annotations.*;
- import thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload.EcTokenDiseinfo;
- import thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload.EcTokenUpldDetl;
- import java.util.Date;
- import java.util.List;
- @Mapper
- public interface SiMzDao {
- @Select("select count(1) from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
- int selectExistCount(@Param("patNo") String patNo,
- @Param("times") int times);
- @Update("update t_si_pat_info set times=#{times} where pat_no=#{patNo} and times=-1")
- void updateMzTimes(@Param("patNo") String patNo,
- @Param("times") int times);
- @Delete("delete from t_si_pat_info where pat_no=#{patNo} and times=-1")
- void deleteTempPatinfo(@Param("patNo") String patNo,
- @Param("times") int times);
- @Select("select * from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
- SiPatInfo selectSiPatInfoForMz(@Param("patNo") String patNo,
- @Param("times") int times);
- @Update("update t_si_pat_info set mdtrt_id=#{nullCtnt}, setl_id=#{nullCtnt} where pat_no=#{patientId} and times=#{times} ")
- void clearMdtrtIdForMz(@Param("patientId") String patientId,
- @Param("times") int times,
- @Param("nullCtnt") String nullCtnt);
- @Select("select a.psn_no, mdtrtCertType='02', " +
- "b.visit_date as begntime, " +
- "a.certno as mdtrtCertNo, " +
- "a.psn_cert_type, " +
- "a.certno, " +
- "a.psn_name, " +
- "atddrNo=(select rtrim(yb_code) from a_employee_mi where code=b.doctor_code), " +
- "drName=(select rtrim(name) from a_employee_mi where code=b.doctor_code), " +
- "rtrim(b.visit_dept_code) as deptCode, " +
- "caty=(select si_caty from zd_unit_code where code=b.visit_dept_code), " +
- "deptName=(select z.name from t_yb_dept z where z.code=" +
- "(select t.si_caty from zd_unit_code t where t.code=b.visit_dept_code)) " +
- "from t_si_pat_info a, mz_visit_table b where a.pat_no=#{patNo} and a.times=#{times} " +
- "and a.pat_no=b.patient_id and a.times=b.times")
- Regstrtn selectRegstrtn(@Param("patNo") String patNo, @Param("times") int times);
- @Select("select times from mz_patient_mi where patient_id=#{patientId} ")
- Integer selectMaxTimes(@Param("patientId") String patientId);
- @Select("select insuplc_admdvs from t_si_pat_info where " +
- "pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
- String selectAdmdvs(@Param("patNo") String patNo,
- @Param("times") int times,
- @Param("ledgerSn") int ledgerSn);
- @Update("update t_si_pat_info set insuplc_admdvs=#{insuplcAdmdvs},psn_type=#{psnType},emp_name=#{empName}," +
- "mdtrt_id=#{mdtrtId},insutype=#{insutype},visit_datetime=#{visitDate},balc=#{balc} " +
- "where pat_no=#{patNo} and times=#{times} ")
- void afterRegistrtn(MzPatientInfo p);
- @Update("update t_si_pat_info set med_type=#{medtype} where pat_no=#{patNo} and times=#{times}")
- void updateMedtype(@Param("medtype") String medtype, @Param("patNo") String patNo, @Param("times") int times);
- @Select("select feedetlSn=(patient_id + '_' + cast(times as varchar) + '_' + cast(receipt_no as varchar) + '_' + " +
- "cast(order_no as varchar) + '_' + cast(item_no as varchar)), " +
- "receipt_no as rxno, input_date as feeOcurTime, " +
- "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=his_item_code), " +
- "(select max(national_code) from zd_charge_item where code=his_item_code)), " +
- "his_item_code as medinsListCodg, " +
- "charge_fee as detItemFeeSumamt, " +
- "quantity as cnt, price as pric, " +
- "bilgDrCodg=(select rtrim(yb_code) from a_employee_mi where code=input_staff), " +
- "ordersDrCode=(select rtrim(yb_code) from a_employee_mi where code=input_staff), " +
- "input_man as bilgDrName,input_man as ordersDrName " +
- "from t_mt_receipt where patient_id=#{patNo} and times=#{times} and yb_trans_flag=0 ")
- List<FeeDetail> selectOutpatientFees(@Param("patNo") String patNo, @Param("times") int times);
- @Update("update t_mt_receipt set yb_trans_flag=1,chrgitm_lv=#{chrgLv},med_chrgitm_type=#{chrgType} where " +
- "patient_id=#{patNo} and times=#{times} and receipt_no=#{recNo} and order_no=#{odrNo} and item_no=#{itmNo}")
- void afterUploadFees(@Param("patNo") String patNo,
- @Param("times") int times,
- @Param("recNo") int recNo,
- @Param("odrNo") int odrNo,
- @Param("itmNo") int itmNo,
- @Param("chrgLv") String chrgLv,
- @Param("chrgType") String chrgType);
- @Update("update t_mt_receipt set yb_trans_flag=0 where patient_id=#{patNo} and times=#{times}")
- void afterRevokeFees(@Param("patNo") String patNo, @Param("times") int times);
- @Select("select psn_no,insuplc_admdvs,mdtrtCertType='02',certno as mdtrtCertNo,certno, " +
- "psn_cert_type,psn_type,psn_name,med_type,mdtrt_id,insutype, " +
- "medfeeSumamt=(select sum(t.charge_fee) from t_mt_receipt t where " +
- "t.patient_id=#{patNo} and t.times=#{times}) " +
- "from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
- MzPreSetlmt selectPreSetlmt(@Param("patNo") String patNo, @Param("times") int times);
- @Select("select diagType='1', " +
- "diagSrtNo=1, " +
- "rtrim(icd_code) as diagCode, " +
- "rtrim(icd_text) as diagName, " +
- "rtrim(visit_dept_code) as diagDept, " +
- "diseDorNo=(select rtrim(yb_code) from a_employee_mi where code=doctor_code), " +
- "diseDorName=(select rtrim(name) from a_employee_mi where code=doctor_code), " +
- "visit_date as diagTime, " +
- "valiFlag='1' " +
- "from mz_visit_table where patient_id=#{patNo} and times=#{times}")
- Diagnoses selectDiseinfo(@Param("patNo") String patNo, @Param("times") int times);
- @Update("update t_si_pat_info set dise_code=#{code},dise_name=#{name} where pat_no=#{patNo} and times=#{times}")
- void updatePatDiseinfo(@Param("patNo") String patNo, @Param("times") int times,
- @Param("code") String code, @Param("name") String name);
- @Update("update t_si_pat_info set fulamt_ownpay_amt=#{fulamtOwnpayAmt}, overlmt_amt=#{overlmtAmt}, " +
- "preselfpay_amt=#{preselfpayAmt}, inscp_scp_amt=#{inscpScpAmt} where pat_no=#{patNo} and times=#{times}")
- void updateSortOfAmt(SiPatInfo patInfo);
- @Select("select top 1 * from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and revoked=#{revoked} order by setl_time desc")
- SiSetlinfo selectSettledInfo(@Param("patNo") String patNo, @Param("times") int times, @Param("revoked") int revoked);
- @Select("select psn_no,certno as mdtrtCertNo,mdtrtCertType='02', " +
- "psn_cert_type,certno,med_type,insuplc_admdvs, " +
- "medfeeSumamt=(select sum(charge_fee) from t_mt_receipt where patient_id=#{patNo} and t_mt_receipt.times=#{times}), " +
- "mdtrt_id,insutype,fulamt_ownpay_amt,overlmt_amt as overlmtSelfpay, " +
- "preselfpay_amt,inscp_scp_amt " +
- "from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
- Setlmt selectSetlmt(@Param("patNo") String patNo, @Param("times") int times);
- @Update("update t_si_setlinfo set revoked=1,mz_saved=0 where pat_no=#{patNo} and times=#{times}")
- void deleteSetlInfo(@Param("patNo") String patNo, @Param("times") int times);
- @Update("delete from t_si_setldetail where pat_no=#{patNo} and times=#{times}")
- void deleteSetlDetail(@Param("patNo") String patNo, @Param("times") int times);
- @Update("update t_si_pat_info set rvk_setl_msgid=#{rvkSetlMsgid} where pat_no=#{patNo} and times=#{times}")
- void updateRvkSetlMsgid(@Param("patNo") String patNo, @Param("times") int times, @Param("rvkSetlMsgid") String rvkSetlMsgid);
- @Select("select a.diag_srt_no,a.diag_type,a.diag_code,a.diag_name,a.diag_dept, " +
- "a.dise_dor_name,a.diag_time,a.vali_flag,dise_dor_no=rtrim(b.yb_code) " +
- "from t_si_mz_diag a, a_employee_mi b where pat_no=#{patNo} and times=#{times} and a.dise_dor_no=b.code")
- List<Diagnoses> selectMzDiags(@Param("patNo") String patNo, @Param("times") int times);
- @Select("select icd_code_new from mz_visit_table where patient_id=#{patNo} and times=#{times}")
- String selectIcdCodeNew(@Param("patNo") String patNo, @Param("times") int times);
- @Select("select top 1 rtrim(yb_name) from zd_icd_code_new where yb_code=#{code}")
- String selectIcdTextNew(@Param("code") String code);
- @Select("select visit_date from mz_visit_table with(nolock) where patient_id=#{patNo} and times=#{times} ")
- Date selectBegntime(@Param("patNo") String patNo, @Param("times") int times);
- @Delete("delete from t_mt_receipt where patient_id=#{patNo} and times=#{times}")
- void deleteAllReceipts(@Param("patNo") String patNo,
- @Param("times") Integer times);
- @Select("select b.si_caty as visitDeptCode,rtrim(c.name) as visitDeptName " +
- "from mz_visit_table a, zd_unit_code b, t_yb_dept c where " +
- "a.patient_id=#{patNo} and a.times=#{times} and a.visit_dept_code=b.code " +
- "and b.si_caty=c.code")
- MzVisit selectMzVisitInfo(@Param("patNo") String patNo,
- @Param("times") Integer times);
- @Select("select a.psn_no,a.insutype,chrgBchno=a.pat_no+'_'+cast(a.times as varchar)+'_1', " +
- "medOrgOrd=a.pat_no+'_'+cast(a.times as varchar)+'_'+a.mdtrt_id, " +
- "b.visit_date as begntime,a.mdtrt_id,a.med_type,acctUsedFlag='0', " +
- "caty=(select t.si_caty from zd_unit_code t where t.code=b.visit_dept_code), " +
- "deptName=(select rtrim(t.name) from zd_unit_code t where t.code=b.visit_dept_code), " +
- "medfeeSumamt=(select sum(t.charge_fee) from t_mt_receipt t where t.patient_id=a.pat_no and t.times=a.times), " +
- "a.dise_code as diseCodg,a.dise_name,psnSetlway='01' " +
- "from t_si_pat_info a,mz_visit_table b where a.pat_no=#{patNo} and a.times=#{times} " +
- "and a.pat_no=b.patient_id and a.times=b.times")
- EcTokenUpldDetl selectEcTokenUpldDetl(@Param("patNo") String patNo, @Param("times") int times);
- @Select("select diag_type,diag_srt_no,diag_code,diag_name,diag_dept,dise_dor_no,dise_dor_name," +
- "diag_time,vali_flag from t_si_mz_diag where pat_no=#{patNo} and times=#{times}")
- List<EcTokenDiseinfo> selectEcTokenDiseinfos(@Param("patNo") String patNo, @Param("times") int times);
- }
|