12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- package thyyxxk.sizyfeeoprnsystm.dao;
- import org.apache.ibatis.annotations.Mapper;
- import org.apache.ibatis.annotations.Param;
- import org.apache.ibatis.annotations.Select;
- import org.apache.ibatis.annotations.Update;
- import thyyxxk.sizyfeeoprnsystm.pojo.FeeCounteract;
- import thyyxxk.sizyfeeoprnsystm.pojo.selfpay.BriefLedgerFile;
- import thyyxxk.sizyfeeoprnsystm.pojo.selfpay.FmiOwnpayPatnDise;
- import thyyxxk.sizyfeeoprnsystm.pojo.selfpay.FmiOwnpayPatnFee;
- import thyyxxk.sizyfeeoprnsystm.pojo.selfpay.FmiOwnpayPatnMdtrt;
- import java.math.BigDecimal;
- import java.util.LinkedList;
- import java.util.List;
- @Mapper
- public interface SelfpayDao {
- @Update("update zy_ledger_file set selfpay_uploaded=0 where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn};" +
- "update zy_detail_charge set trans_flag_yb=0 where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn} " +
- "and trans_flag_yb!=2")
- void resetSelfUploadStatus(BriefLedgerFile ledgerFile);
- @Select("select psnCertType='01',certno=b.social_no,psnName=rtrim(a.name),begntime=a.admiss_date,endtime=a.dis_date, " +
- "medType=isnull(a.med_type,'2101'),iptOpNo=rtrim(b.inpatient_no),inhospStas='0',valiFlag='1' from ${table} a, " +
- "a_patient_mi b where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and a.inpatient_no=b.inpatient_no")
- FmiOwnpayPatnMdtrt selectPatnMdtrt(@Param("table") String table,
- @Param("patNo") String patNo,
- @Param("times") int times);
- @Select("select inoutDiagType='2',diagType='1',maindiagFlag='1',diagSrtNo=1, " +
- "diagCode=rtrim(dis_diag),diagName=rtrim(dis_diag_comment) " +
- "from ba_first_page1 where inpatient_no=#{patNo} and admiss_times=#{times} and dis_diag_no=1")
- FmiOwnpayPatnDise selectPatnDise(@Param("patNo") String patNo,
- @Param("times") int times);
- @Select("select bkkpSn=detail_sn,feeOcurTime=charge_date,valiFlag='1',fixmedinsName='长沙泰和医院', medinsListCodg=rtrim(charge_code_mx)," +
- "cnt=charge_amount,pric=charge_fee/charge_amount,detItemFeeSumamt=charge_fee, fixmedinsCode='H43010500370', " +
- "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=charge_code_mx),(select max(national_code) from zd_charge_item where code=charge_code_mx)), " +
- "medinsListName=isnull((select top 1 name from yp_zd_dict where code=charge_code_mx),(select name from zd_charge_item where code=charge_code_mx)) " +
- "from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)=0")
- LinkedList<FmiOwnpayPatnFee> selectOwnpayFees(BriefLedgerFile ledgerFile);
- @Select("select sum(charge_fee) from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
- BigDecimal selectSumFee(BriefLedgerFile ledgerFile);
- @Select("select social_no from a_patient_mi where inpatient_no=#{patNo}")
- String selectSocialNo(@Param("patNo") String patNo);
- @Update("<script>" +
- "update zy_detail_charge set trans_flag_yb=1 where inpatient_no=#{patNo} and " +
- "admiss_times=#{times} and detail_sn in " +
- "<foreach collection='fees' item='fee' separator=',' open='(' close=')'>" +
- "#{fee.bkkpSn}</foreach>" +
- "</script>")
- void updateTransFlag(@Param("patNo") String patNo,
- @Param("times") int times,
- @Param("fees") List<FmiOwnpayPatnFee> fees);
- @Select("select charge_amount,charge_fee,detail_sn,ori_detail_sn from zy_detail_charge " +
- "where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn} " +
- "and isnull(infant_flag,0)!=1 and isnull(trans_flag_yb,0) not in (1,2) " +
- "and isnull(ori_detail_sn,-1)!=-1")
- List<FeeCounteract> selectNegativeFeesWithOriDetlSn(BriefLedgerFile ledgerFile);
- @Select("<script>" +
- "select charge_amount,charge_fee,detail_sn from zy_detail_charge " +
- "where inpatient_no=#{ledger.patNo} and admiss_times=#{ledger.times} and ledger_sn=#{ledger.ledgerSn} " +
- "and isnull(trans_flag_yb,0) not in (1,2) and detail_sn in " +
- "<foreach collection='list' item='detailSn' open='(' separator=',' close=')'>" +
- "#{detailSn}" +
- "</foreach>" +
- "</script>")
- List<FeeCounteract> selectPositiveFeesByDetlSn(@Param("ledger") BriefLedgerFile ledgerFile,
- @Param("list") List<Integer> list);
- @Update("update zy_detail_charge set trans_flag_yb=2 where inpatient_no=#{patNo} and " +
- "admiss_times=#{times} and detail_sn in (#{sn1}, #{sn2})")
- void updateYbTransFlagInPair(@Param("patNo") String patNo, @Param("times") Integer times,
- @Param("sn1") Integer sn1, @Param("sn2") Integer sn2);
- @Select("select rtrim(inpatient_no) as patNo,admiss_times as times,ledger_sn " +
- "from zy_ledger_file where ledger_sn>0 and account_date is not null and selfpay_uploaded in (0,2) " +
- "and isnull(responce_type,'01')='01' and account_date>='2022-01-01 00:00:00.000'")
- List<BriefLedgerFile> selectBriefLedgerFile();
- @Update("update zy_ledger_file set selfpay_uploaded=#{selfpayUploaded} where inpatient_no=#{patNo} " +
- "and admiss_times=#{times} and ledger_sn=#{ledgerSn}")
- void updateLedgerFileUploaded(BriefLedgerFile ledgerFile);
- }
|