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

import java.util.List;
import com.bonus.canteen.core.account.domain.AccTrade;
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;

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

    public List<AccTrade> selectAccTradeByOrderNo(Long orderNo);

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

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

//    public int insertAccTradeVo(AccTradeVo accTrade);

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

    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);
}
