Routines.java 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package thyyxxk.webserver.dao.his.yibao;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import org.apache.ibatis.annotations.Mapper;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.apache.ibatis.annotations.Select;
  6. import org.apache.ibatis.annotations.Update;
  7. import thyyxxk.webserver.entity.yibao.patient.FeeCounteract;
  8. import thyyxxk.webserver.entity.yibao.patient.NotUploadedFee;
  9. import java.util.List;
  10. /**
  11. * @author dj
  12. */
  13. @Mapper
  14. public interface Routines {
  15. /**
  16. * 获取当前患者最大账页号
  17. *
  18. * @param inpatientNo 住院号
  19. * @param admissTimes 住院次数
  20. * @return 账页号
  21. */
  22. @Select("select max(ledger_sn) from zy_ledger_file where " +
  23. "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes}")
  24. Integer selectMaxLedgerSn(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
  25. @Select("select detail_sn,charge_code_mx,charge_amount,charge_fee,charge_date,yb_self_flag, " +
  26. "yb_code=(select max(national_code) from ${zdTable} where code=charge_code_mx), " +
  27. "charge_name=(select top 1 rtrim(name) from ${zdTable} where code=charge_code_mx) " +
  28. "from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} and " +
  29. "ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)=0 and isnull(infant_flag,0)=0 " +
  30. "and charge_date<=#{today} and isnull(serial,'') in (#{serial1},#{serial2})")
  31. IPage<NotUploadedFee> selectNotUploadedFees(IPage<NotUploadedFee> iPage,
  32. @Param("zdTable") String zdTable,
  33. @Param("patNo") String patNo,
  34. @Param("times") int times,
  35. @Param("ledgerSn") int ledgerSn,
  36. @Param("today") String today,
  37. @Param("serial1") String serial1,
  38. @Param("serial2") String serial2);
  39. @Select("select detail_sn,charge_code_mx,charge_amount,charge_fee,charge_date,yb_self_flag, " +
  40. "yb_code=(select max(hnsyb_item_code) from zd_charge_item_hnsgs where hosp_code=charge_code_mx), " +
  41. "charge_name=(select top 1 rtrim(name) from ${zdTable} where code=charge_code_mx) " +
  42. "from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} and " +
  43. "ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)=0 and isnull(infant_flag,0)=0 " +
  44. "and charge_date<=#{today} and isnull(serial,'') in (#{serial1},#{serial2})")
  45. IPage<NotUploadedFee> selectInjuryNotUploadedFees(IPage<NotUploadedFee> iPage,
  46. @Param("zdTable") String zdTable,
  47. @Param("patNo") String patNo,
  48. @Param("times") int times,
  49. @Param("ledgerSn") int ledgerSn,
  50. @Param("today") String today,
  51. @Param("serial1") String serial1,
  52. @Param("serial2") String serial2);
  53. @Select("select sum(charge_fee) from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} and " +
  54. "ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)=0 and charge_date<=#{today} and isnull(serial,'') in (#{serial1},#{serial2})")
  55. String selectSumChargeFee(@Param("patNo") String patNo,
  56. @Param("times") int times,
  57. @Param("ledgerSn") int ledgerSn,
  58. @Param("today") String today,
  59. @Param("serial1") String serial1,
  60. @Param("serial2") String serial2);
  61. }