SecondFefundDao.java 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package thyyxxk.webserver.dao.his.datamodify;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  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.datamodify.MzChargeDetail;
  8. import java.math.BigDecimal;
  9. /**
  10. * <p>
  11. * 描述: 二次退费
  12. * </p>
  13. *
  14. * @author xc
  15. * @date 2021-05-18 11:22
  16. */
  17. @Mapper
  18. public interface SecondFefundDao {
  19. @Select("select confirm_flag,dec_amount,tc_name = (select distinct name from yp_zd_dict where code = charge_item_code), " +
  20. "rtrim(name)name,rtrim(charge_item_code)charge_item_code,rtrim(patient_id)patient_id,times,receipt_no,item_no" +
  21. "(quantity * drug_win) quantity from mz_charge_detail where " +
  22. "patient_id = #{patientId} and times = #{times} and charge_item_code = #{chargeItemCode}")
  23. MzChargeDetail getOrderInformation(@Param("patientId") String patientId,
  24. @Param("times") Integer times,
  25. @Param("chargeItemCode") String chargeItemCode);
  26. @Select("<script>" +
  27. "select confirm_flag,dec_amount,tc_name = (select distinct name from yp_zd_dict where code = charge_item_code), " +
  28. "rtrim(name)name,rtrim(charge_item_code)charge_item_code,rtrim(patient_id)patient_id,times,receipt_no,item_no," +
  29. "(quantity * drug_win) quantity from mz_charge_detail where " +
  30. "patient_id = #{patientId} and times = #{times} " +
  31. "<if test=\"chargeItemCode != null and chargeItemCode != '' \">" +
  32. "and charge_item_code = #{chargeItemCode}" +
  33. "</if>" +
  34. "and receipt_no not like '-%' " +
  35. "</script>")
  36. Page<MzChargeDetail> getMzTuiFei(Page<MzChargeDetail> page,
  37. @Param("patientId") String patientId,
  38. @Param("times") Integer times,
  39. @Param("chargeItemCode") String chargeItemCode);
  40. @Update("update mz_charge_detail set dec_amount=#{quantity},confirm_flag = 3 " +
  41. "where patient_id = #{patientId} and times = #{times} and charge_item_code = #{chargeItemCode} and item_no = #{itemNo}")
  42. void xiuGaiTuiFei(@Param("patientId") String patientId,
  43. @Param("times") Integer times,
  44. @Param("chargeItemCode") String chargeItemCode,
  45. @Param("quantity") BigDecimal quantity,
  46. @Param("itemNo") Integer itemNo);
  47. }