SiManageDao.java 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package thyyxxk.webserver.dao.his.medicalinsurance;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.apache.ibatis.annotations.Select;
  5. import org.apache.ibatis.annotations.Update;
  6. import thyyxxk.webserver.entity.medicalinsurance.manage.InstSetlLdgChkBrf;
  7. import java.math.BigDecimal;
  8. import java.util.List;
  9. /**
  10. * @author: DingJie
  11. * @create: 2021/8/99:45
  12. */
  13. @Mapper
  14. public interface SiManageDao {
  15. @Update("<script>" +
  16. "update ${table} set uploaded_flag=#{flag} where code in " +
  17. "<foreach collection='codes' item='code' separator=',' open='(' close=')'>" +
  18. "#{code}</foreach>" +
  19. "</script>")
  20. void updateUploadedFlag(@Param("table") String table,
  21. @Param("flag") int flag,
  22. @Param("codes") List<String> codes);
  23. @Update("update ${table} set uploaded_flag=0 where code=#{code}")
  24. void updateUploadedFlag2(@Param("table") String table,
  25. @Param("code") String codes);
  26. @Select("select name from t_region where code=#{code}")
  27. String selectRegion(@Param("code") String code);
  28. @Select("select pat_no,times,ledger_sn,medfee_sumamt,acct_pay,fund_pay_sumamt, " +
  29. "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
  30. "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996'))" +
  31. "from t_si_setlinfo a where insutype=#{insutype} and setl_type=#{setlType} and revoked=0 " +
  32. "and clr_optins=#{clrOptins} and setl_time>=#{start} and setl_time<=#{end} and fund_pay_sumamt!=0 " +
  33. "and (insuplc_admdvs='439900' or insuplc_admdvs like '4301%')")
  34. List<InstSetlLdgChkBrf> selectSetlChkBrfsWithInsutype(@Param("setlType") String setlType,
  35. @Param("insutype") String insutype,
  36. @Param("clrOptins") String clrOptins,
  37. @Param("start") String start,
  38. @Param("end") String end);
  39. @Select("select pat_no,times,ledger_sn,setl_id,mdtrt_id,psn_no,medfee_sumamt,acct_pay,fund_pay_sumamt,psn_cash_pay, " +
  40. "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no and b.times=a.times " +
  41. "and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996'))" +
  42. "from t_si_setlinfo a where setl_type=#{setlType} and revoked=0 and clr_optins=#{clrOptins} and fund_pay_sumamt!=0 " +
  43. "and setl_time>=#{start} and setl_time<=#{end} and (insuplc_admdvs='439900' or insuplc_admdvs like '4301%')")
  44. List<InstSetlLdgChkBrf> selectSetlChkBrfs(@Param("setlType") String setlType,
  45. @Param("clrOptins") String clrOptins,
  46. @Param("start") String start,
  47. @Param("end") String end);
  48. @Select("select count(1) from dj_user_role where user_code=#{code} and role_id=41")
  49. Integer recoveryTradePermission(@Param("code") String code);
  50. }