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

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

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

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

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


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


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

    /**
     * 修改优惠
     *
     * @param list
     * @return
     */
    int updateBatchBaking(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);

    int batchUpdateDiscountType(List<OrderDiscount> list);

    /**
     * 扫描
     * @param query
     * @return:
     * @Date: 2020/12/21 5:06 PM
     */
    List<Long> scan(OrderDiscountQuery query);

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

    /**
     * 查询列表
     *
     * @param orderDiscountQuery
     * @return
     */
    List<Long> selectIdList(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);

    void batchUpdateDate(List<Long> list);

    /**
     * 查询列表
     *
     * @return
     */
    List<OrderDiscount> checkDiscount();

}
