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

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

import java.util.List;


/**
 * @author nianchang
 * @ClassName OrderCommentDetailsDao
 * @date 2021/03/30 5:45 下午
 */
@Repository
public interface OrderCommentDetailsDao {

    /**
     * 新增一条记录
     * @param record
     * @return
     * Date: 2021/3/30 5:36 下午
     */
    int insert(OrderCommentDetails record);

    /**
     * 修改
     * @param record
     * @return
     * Date: 2021/3/30 5:36 下午
     */
    int update(OrderCommentDetails record);

    /**
     * 查询列表
     * @param orderNo
     * @param sellerId
     * @return
     * Date: 2021/4/21 4:19 下午
     */
    List<OrderCommentDetails> selectByOrderNo(@Param("orderNo") String orderNo,
                                              @Param("sellerId") Long sellerId);

    /**
     * 查询列表
     * @param orderNoList
     * @param sellerIdList
     * @return
     * Date: 2021/4/21 4:19 下午
     */
    List<OrderCommentDetails> selectByOrderNoList(@Param("orderNoList") List<String> orderNoList,
                                              @Param("sellerIdList") List<Long> sellerIdList);

    /**
     * 批量新增
     * @param list
     * Date: 2021/5/7 6:32 下午
     */
    void insertList(List<OrderCommentDetails> list);

    List<OrderCommentDetails> selectIdList(OrderCommentQuery query);

    int delete(@Param("list") List<Long> list, @Param("sellerId") Long sellerId);

    int updateSellerUser(
            @Param("sellerId") Long sellerId,
            @Param("storeId") Long storeId,
            @Param("oldUserId") Long oldUserId,
            @Param("newUserId") Long newUserId,
            @Param("orderNo") String orderNo);

    int deleteByOrderNo(@Param("orderNo") String orderNo, @Param("sellerId") Long sellerId);

}
