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

import com.zm.order.tool.server.dto.QueryPerformanceDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.zm.order.tool.server.model.PerformanceSelfTake;

import java.util.List;

/**
 * @Author chang.n
 * @ClassName PerformanceDao
 * @Date 2020/4/14 4:16 PM
 */
@Repository
public interface PerformanceSelfTakeDao {

    /**
     * 插入自提订单信息
     *
     * @param selfTake
     * @return
     */
    int insert(PerformanceSelfTake selfTake);

    int insertList(List<PerformanceSelfTake> list);

    int realDeleteByOrderNo(@Param("orderNo") String orderNo, @Param("userId") Long userId);

    /**
     * 查询单个履约信息
     * 
     * @param orderNo
     * @param userId
     * @return: com.zm.order.biz.model.PerformanceSelfTake
     * @Date: 2020/5/9 9:53 AM
     */
    PerformanceSelfTake selectOne(@Param("orderNo") String orderNo, @Param("userId") Long userId);

    /**
     * 批量查询
     * @param performanceDTO
     * @return: java.util.List<com.zm.order.biz.model.PerformanceSelfTake>
     * @Date:   2020/6/8 2:32 PM
     */
    List<PerformanceSelfTake> selectList(QueryPerformanceDTO performanceDTO);

    /**
     * 批量查询
     * @param performanceDTO
     * @return: java.util.List<com.zm.order.biz.model.PerformanceSelfTake>
     * @Date:   2020/6/8 2:32 PM
     */
    List<PerformanceSelfTake> selectListByUserIdOrderNo(QueryPerformanceDTO performanceDTO);

    /**
     * 更新自提信息
     * @param selfTake
     * @return: int
     * @Date:   2020/5/18 1:55 PM
     */
    int update(PerformanceSelfTake selfTake);

    /**
     * 更新自提信息
     * @param selfTake
     * @return: int
     * @Date:   2020/5/18 1:55 PM
     */
    int updateByOrderNo(PerformanceSelfTake selfTake);

    /**
     * 批量更新自提信息
     * @param orderSelfTakeList
     * @param baking
     * @param newSellerId
     * @return: int
     * @Date:   2020/5/18 1:55 PM
     */
    int updateBatch(@Param("list")List<PerformanceSelfTake> orderSelfTakeList,
                    @Param("bizType")Integer baking, @Param("sellerId")Long newSellerId);

    int deleteTemp(@Param("orderNo") String orderNo,
                   @Param("userId") Long userId);

    int delete(@Param("id") Long id,
                   @Param("userId") Long userId);

    /**
     * 查询单个履约信息
     * @param selfTake
     * @return: com.zm.order.biz.model.PerformanceSelfTake
     * @Date:   2020/6/8 2:32 PM
     */
    PerformanceSelfTake selectByOne(PerformanceSelfTake selfTake);

    int updateUpdatedAt(@Param("id") Long id, @Param("userId") Long userId);

}
