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

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

import java.util.List;

/**
 * @Author Gwl·Q
 * @ClassName OrderUserRelationDao
 * @Date 2020/10/20 9:40 AM
 */
@Repository
public interface OrderUserRelationDao {

    /**
     * 插入
     * @param record
     * @return:
     * @Date: 2020/10/20 9:40 AM
     */
    int insert(OrderUserRelation record);

    /**
     * 删除
     * @param id
     * @return:
     * @Date: 2020/10/20 9:58 AM
     */
    int deleteByKey(Long id);

    /**
     * 单条记录查询
     * @param query
     * @return:
     * @Date: 2020/10/20 9:57 AM
     */
    OrderUserRelation selectOne(OrderUserRelationQuery query);

    /**
     * 单条记录查询
     * @param orderNo
     * @param userId
     * @return:
     * @Date: 2020/10/20 9:57 AM
     */
    OrderUserRelation selectByOrderNo(@Param("orderNo") String orderNo, @Param("userId") Long userId);

    /**
     * 查询主订单信息
     * @param orderNo
     * @return:
     * @Date: 2020/10/20 9:57 AM
     */
    OrderUserRelation selectRoot(@Param("orderNo") String orderNo);

    /**
     * 查询列表
     *
     * @param query 查询条件
     * @return
     */
    List<OrderUserRelation> selectList(OrderUserRelationQuery query);

    /**
     * 查询列表
     *
     * @param orderNo 查询条件
     * @return
     */
    List<OrderUserRelation> selectListByOrderNo(@Param("orderNo") String orderNo);

    /**
     * 插入
     * @param list
     * @return:
     * @Date: 2020/10/20 9:40 AM
     */
    int insertList(List<OrderUserRelation> list);

}
