惠支付服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gratia-pay-parent/service/src/main/java/com/hfkj/dao/OpenApiTradeOrderMapper.java

87 lines
3.5 KiB

package com.hfkj.dao;
import com.hfkj.openapi.v1.model.TradeBillsModel;
import com.hfkj.openapi.v1.model.TradeRefundBillsModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @className: OpenApiTradeOrderMapper
* @author: HuRui
* @date: 2023/5/25
**/
@Repository
public interface OpenApiTradeOrderMapper {
@Select({
"<script>" +
" SELECT " +
" a.pay_time payTime," +
" a.mer_no merchantNo," +
" a.platform_trade_no platformTradeNo," +
" a.acc_trade_no accTradeNo," +
" a.out_trade_no outTradeNo, " +
" a.pay_user_id payUserId, " +
" a.trans_type tradeType," +
" case a.pay_mode" +
" when \"WECHAT\" then '微信'" +
" when \"ALIPAY\" then '支付宝'" +
" when \"UQRCODEPAY\" then '云闪付'" +
" end payMode," +
" \"交易成功\" as tradeStatus," +
" a.trade_amount tradeAmount," +
" a.trade_actual_amount tradeActualAmount," +
" case a.refund_type" +
" when 1 then '全额退款' " +
" when 2 then '部分退款'" +
" end refundType," +
" a.refund_price refundPrice," +
" subject subject," +
" case a.create_type" +
" when 1 then '扫一扫'" +
" when 2 then '被扫'" +
" when 3 then 'API'" +
" end createType" +
" FROM `bs_trade_order` a" +
" where a.mer_no = #{merNo} " +
" <![CDATA[ and pay_time >= #{billDateS} ]]>" +
" <![CDATA[ and pay_time <= #{billDateE} ]]>" +
" and a.`status` in (3,6)" +
" GROUP BY a.id" +
" </script>"
})
List<TradeBillsModel> queryTradeBills(@Param("merNo") String merNo,@Param("billDateS") String billDateS, @Param("billDateE") String billDateE);
@Select({
"<script>" +
" select " +
" a.create_time createTime, " +
" a.refund_no refundNo, " +
" case a.`status` " +
" when 1 then '退款中' " +
" when 2 then '退款成功' " +
" when 3 then '退款失败' " +
" end refundStatus, " +
" a.refund_time refundTime, " +
" a.refund_amount refundAmount, " +
" b.out_trade_no outTradeNo, " +
" b.acc_trade_no accTradeNo, " +
" b.mer_no merNo, " +
" b.acc_settle_amount accSettleAmount, " +
" a.refund_reason refundReason, " +
" a.operator_name operatorName " +
" from bs_trade_order_refund a " +
" LEFT JOIN bs_trade_order b on b.out_trade_no = a.out_trade_no " +
" where <![CDATA[ a.`status` <> 0 ]]> and b.mer_no = #{merNo}" +
" <![CDATA[ and a.create_time >= #{billDateS} ]]>" +
" <![CDATA[ and a.create_time <= #{billDateE} ]]>" +
" ORDER BY a.create_time desc" +
"</script>"
})
List<TradeRefundBillsModel> queryRefundBills(@Param("merNo") String merNo, @Param("billDateS") String billDateS, @Param("billDateE") String billDateE);
}