package com.bonus.canteen.core.account.mapper;

import com.bonus.canteen.core.account.domain.AccountTrade;
import com.bonus.canteen.core.account.domain.bo.TradeAndWallerInfo;
import com.bonus.canteen.core.account.domain.param.AccConsumeDetailQueryParam;
import com.bonus.canteen.core.account.domain.param.AccWalletOperationQueryParam;
import com.bonus.canteen.core.account.domain.vo.AccConsumeDetailVO;
import com.bonus.canteen.core.account.domain.vo.AccOperationListVO;
import com.bonus.canteen.core.account.domain.vo.AccTradeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 账户交易记录Mapper接口
 * 
 * @author xsheng
 * @date 2025-04-05
 */
public interface AccTradeMapper {
    /**
     * 查询账户交易记录
     * 
     * @param tradeId 账户交易记录主键
     * @return 账户交易记录
     */
    public AccountTrade selectAccTradeByTradeId(Long tradeId);

    public List<AccountTrade> selectAccTradeByOrderNo(Long orderNo);

    /**
     * 查询账户交易记录列表
     * 
     * @param accountTrade 账户交易记录
     * @return 账户交易记录集合
     */
    public List<AccountTrade> selectAccTradeList(AccountTrade accountTrade);

    /**
     * 新增账户交易记录
     * 
     * @param accountTrade 账户交易记录
     * @return 结果
     */
    public int insertAccTrade(AccountTrade accountTrade);

//    public int insertAccTradeVo(AccTradeVo accTrade);

    /**
     * 修改账户交易记录
     * 
     * @param accountTrade 账户交易记录
     * @return 结果
     */
    public int updateAccTrade(AccountTrade accountTrade);

    public int updateAccTradeVoByOrderNo(AccTradeVo accTradeVo);

    /**
     * 删除账户交易记录
     * 
     * @param tradeId 账户交易记录主键
     * @return 结果
     */
    public int deleteAccTradeByTradeId(Long tradeId);

    /**
     * 批量删除账户交易记录
     * 
     * @param tradeIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAccTradeByTradeIds(Long[] tradeIds);

    List<AccOperationListVO> queryAccOperationList(@Param("param") AccWalletOperationQueryParam param,
                                                   @Param("encryptedSearchValue") String encryptedSearchValue);

    List<TradeAndWallerInfo> queryTradeAndWallerInfoByOrderNo(@Param("orderNo") String orderNo,
                                                              @Param("accTradeType") Integer accTradeType);

    List<AccConsumeDetailVO> queryAccConsumeDetail(@Param("param") AccConsumeDetailQueryParam param,
                                                   @Param("encryptedSearchValue") String encryptedSearchValue);
}
