package com.mzl.flower.mapper.wallet;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.dto.request.wallet.QueryWalletBillDTO;
import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO;
import com.mzl.flower.dto.response.wallet.WalletBillRecordVO;
import com.mzl.flower.entity.wallet.WalletBillRecordDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.List;
/**
*
* Mapper 接口
*
*
* @author @TaoJie
* @since 2024-10-22
*/
@Repository
public interface WalletBillRecordMapper extends BaseMapper {
List queryPage(@Param("dto") QueryWalletBillRecordDTO queryWalletBillRecordDTO, Page page);
List queryWalletBillRecordList(@Param("dto") QueryWalletBillRecordDTO queryWalletBillRecordDTO);
List getPage(Page page, @Param("dto") QueryWalletBillDTO dto);
List getPageByDesc(Page page, @Param("dto") QueryWalletBillDTO dto);
@Select("select * from t_wallet_bill_record where withdraw_record_id = #{withdrawRecordId}")
WalletBillRecordDO getBillRecordByWithdrawRecordId(Long withdrawRecordId);
@Select("SELECT COALESCE(SUM(change_amount), 0) AS change_amount FROM t_wallet_bill_record WHERE supplier_id = #{supplierId} and wallet_id = #{walletId} AND remark = '历史订单统一提现'")
BigDecimal getHistoryAmount(Long walletId, Long supplierId);
}