zhujie
2025-04-18 19428a49b4c07b14097615d48a7a72dbf941c4e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.mzl.flower.mapper.wallet;
 
import com.mzl.flower.dto.request.wallet.QueryWalletAmountDTO;
import com.mzl.flower.dto.response.wallet.WalletWithdrawVO;
import com.mzl.flower.entity.wallet.WalletDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
 
import java.math.BigDecimal;
 
/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author @TaoJie
 * @since 2024-10-22
 */
@Repository
public interface WalletMapper extends BaseMapper<WalletDO> {
 
 
    @Select("select * from t_wallet where supplier_id =#{supplierId}")
    public WalletDO getTotalAmount(String supplierId);
 
    BigDecimal getWaittingSettlementAmount(@Param("dto") WalletDO walletDO);
 
    @Select("select label from t_code_value where type_code='WALLET_ONLINE_TIME' and value='online'")
    String selectWalletOnlineTime();
 
    BigDecimal getSupplierTotalTransactionAmount(@Param("dto") QueryWalletAmountDTO queryWalletAmountDTO);
 
 
    @Select("select sum(t.withdrawable_amount) + sum(t.withdrawing_amount) as  supplierPendingAmount, sum(t.withdrawn_amount) as supplierCompleteAmount from t_wallet  t")
    WalletWithdrawVO getSumWithdrawTotal();
 
    //历史变动总金额 通过备注
    @Select("select sum(t.change_amount) from t_wallet_bill_record  t where t.remark  = '历史订单统一提现' and type = 'withdraw' ")
    BigDecimal getSumHistoryWithdrawTotal();
}