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


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

import java.util.List;

/**
 * @Author Gwl·Q
 * @ClassName OrderPayDetailsDao
 * @Date 2020/12/1 11:36 AM
 */
@Repository
public interface NewDataSourceOrderPayDetailsDao {

    /**
     * 删除
     * @param id
     * @param userId
     * @return:
     * @Date: 2020/12/1 11:49 AM
     */
    int delete(@Param("id") Long id, @Param("userId") Long userId);

    /**
     * 删除
     * @param orderNo
     * @param userId
     * @return:
     * @Date: 2020/12/1 11:49 AM
     */
    int deleteByOrderNo(@Param("orderNo") String orderNo, @Param("userId") Long userId);
    int deleteByOrderNos(@Param("orderNoList") List<String> orderNoList, @Param("userIdList") List<Long> userIdList);


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

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

    /**
     * 新增
     * @param record
     * @return:
     * @Date: 2020/12/1 11:49 AM
     */
    int insert(OrderPayDetails record);
    void replace(OrderPayDetails record);

    /**
     * 批量新增
     * @param list
     * @return:
     * @Date: 2020/12/1 11:49 AM
     */
    void insertList(List<OrderPayDetails> list);

    /**
     * 批量新增
     * @param list
     * @return:
     * @Date: 2020/12/1 11:49 AM
     */
    void replaceList(List<OrderPayDetails> list);

    void inserts(List<OrderPayDetails> list);

    /**
     * 查询
     * @param orderNo
     * @param userId
     * @return:
     * @Date: 2020/12/1 11:49 AM
     */
    List<OrderPayDetails> selectByOrderNo(@Param("orderNo") String orderNo,
                                          @Param("userId") Long userId);

    OrderPayDetails selectById(@Param("userId") Long userId,
                               @Param("id") Long id);

    OrderPayDetails selectOne(@Param("id") Long id, @Param("userId") Long userId);

    /**
     * 查询列表
     * @param query
     * @return:
     * @Date: 2020/12/1 11:51 AM
     */
    List<OrderPayDetails> selectList(OrderPayDetailsQuery query);

    /**
     * 修改
     * @param record
     * @return:
     * @Date: 2020/12/1 11:49 AM
     */
    int update(OrderPayDetails record);
    int updateExtra(OrderPayDetails record);
    int updateAmount(OrderPayDetails record);

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

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