package com.heyu.api.data.dao.vv;
/**
 * <p>
 * 购物车 服务类
 * </p>
 *
 * @author quyixiao
 * @since 2025-08-23
 */

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.data.entity.vv.VvTradeOrderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.mybatis.plugin.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface VvTradeOrderDao extends BaseMapper<VvTradeOrderEntity> {


    VvTradeOrderEntity selectVvTradeOrderById(@Param("id") Long id);


    Long insertVvTradeOrder(VvTradeOrderEntity vvTradeOrder);


    Long insertOrUpdateVvTradeOrder(VvTradeOrderEntity vvTradeOrder);


    int updateVvTradeOrderById(VvTradeOrderEntity vvTradeOrder);


    int updateCoverVvTradeOrderById(VvTradeOrderEntity vvTradeOrder);


    int deleteVvTradeOrderById(@Param("id") Long id);


    @OrderBy(VvTradeOrderEntity.id_)
    List<VvTradeOrderEntity> selectByCondition(IPage page,
                                               @IF @IN List<Long> id,
                                               @IF @LIKE String buyerPhone,
                                               @IF @LIKE String buyerWeixin,
                                               @IF @LIKE String buyerName,
                                               @IF @GE BigDecimal minAllPrice,
                                               @IF @LE BigDecimal maxAllPrice,
                                               @IF String status,
                                               @IF @GE Long minCreateTimestamp,
                                               @IF @LE Long maxCreateTimestamp,
                                               @OrderBy(VvTradeOrderEntity.create_timestamp) String createTimestampSort);


    @OrderBy(VvTradeOrderEntity.id_)
    List<VvTradeOrderEntity> selectAppByCondition(IPage page,
                                                  @IF@IN List<Long> orderIds,
                                                  @IF Long buyerId,
                                                  @IF @GE Long minCreateTimestamp,
                                                  @IF@LE Long maxCreateTimestamp,
                                                  @IF String createTimestampSort);

    List<VvTradeOrderEntity> selectVvTradeOrderByTradeOrderIds(@IFNullReturnEmpty @IN List<Long> id);


    List<VvTradeOrderEntity> selectAppTradeOrderByTradeOrderIds(@IFNullReturnEmpty @IN List<Long> id);



    @LIMIT
    VvTradeOrderEntity selectVvTradeOrderByOutTradeNo(String outTradeNo);

}