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

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 NewHintOrderDiscountDao {

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

    int replaceList(@Param("discountList") List<OrderDiscount> discountList);

    int count();

    /**
     * 修改优惠
     *
     * @param discount
     * @return
     */
    int update(OrderDiscount discount);

    /**
     * 更新用户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);

    int batchUpdateDiscountType(List<OrderDiscount> list);



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

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

    /**
     * 批量删除
     * @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);
}
