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

import com.zm.order.tool.server.model.OrderAddr;
import com.zm.order.tool.server.model.RoutingOrderAddr;
import com.zm.order.tool.server.query.OrderAddressQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author penghui
 */
@Repository
public interface RoutingOrderAddrDao {

    /**
     * 插入
     *
     * @param record
     * @return
     */
    int insert(OrderAddr record);

    /**
     * 根据订单号查询
     *
     * @param orderNo
     * @param userId
     * @return
     */
    OrderAddr selectByOrderNo(@Param("orderNo") String orderNo,
                              @Param("userId") Long userId);


    /**
     * 查询地址列表
     * @param query
     * @return
     * Date: 2021/5/31 5:05 下午
     */
    List<OrderAddr> selectList(OrderAddressQuery query);

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

    List<RoutingOrderAddr> selectByOrderNoList(List<String> list);


}