package com.zm.order.tool.server.tempdb;

import com.zm.order.tool.server.model.OrderDiscount;
import com.zm.order.tool.server.query.OrderDiscountQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author 陈标
 * @Date 2020/3/25 14:57
 */
@Repository
public interface TmpOrderDiscountDao {

    /**
     * 扫描
     *
     * @param orderNoList
     * @return
     */
    List<OrderDiscount> list(@Param("orderNoList") List<String> orderNoList);

    /**
     * 查询列表
     *
     * @param orderDiscountQuery
     * @return
     */
    List<OrderDiscount> selectListByUserIds(OrderDiscountQuery orderDiscountQuery);

    /**
     * 修改优惠
     *
     * @param query
     * @return
     */
    int update(OrderDiscountQuery query);


    /**
     * 修改优惠
     *
     * @param list
     * @return
     */
    int updateBatch(List<OrderDiscount> list);

    /**
     * 更新用户ID
     *
     * @param orderNo
     * @param userId
     * @return
     */
    int updateUserId(@Param("userId") Long userId, @Param("orderNo") String orderNo);


    /**
     * 修改bizType
     *
     * @param orderNoList
     * @param bizType
     * @return
     */
    int updateBizType(@Param("orderNoList") List<String> orderNoList, @Param("bizType") Integer bizType);



    /**
     * 查询列表
     *
     * @param orderDiscountQuery
     * @return
     */
    List<OrderDiscount> selectList(OrderDiscountQuery orderDiscountQuery);

    /**
     * 查询列表
     *
     * @param orderDiscountQuery
     * @return
     */
    List<OrderDiscount> selectListById(OrderDiscountQuery orderDiscountQuery);

    /**
     * 批量删除
     * @param orderNoList
     * @return:
     * @Date: 2020/12/17 2:38 PM
     */
    void physicalDeleted(@Param("orderNoList") List<String> orderNoList);

    /**
     * 更新优惠删除字段
     *
     * @param orderNoList
     * @return
     */
    int updateDeleted(@Param("orderNoList") List<String> orderNoList);

    /**
     * 批量更新优惠表sellerId
     * @param list
     * @return:
     * @Date: 2021/4/8 11:03 上午
     */
    int updateSellerId(List<OrderDiscount> list);
}
