package com.shinsoft.sto.mapper.main;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shinsoft.sto.model.main.Cargo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface CargoMapper extends BaseMapper<Cargo> {

    /**
     * 分页查询货权信息
     */
    Page<Cargo> selectCargoPage(Page<Cargo> page, @Param("params") Map<String, Object> params);

    /**
     * 根据上游客户ID和客户ID查询货权信息
     */
    @Select("SELECT * FROM T_MAIN_CARGO WHERE cancel_flag = '0' AND uper_customer_id = #{uperCustomerId} AND customer_id = #{customerId}")
    List<Cargo> selectByCustomerIds(@Param("uperCustomerId") String uperCustomerId, @Param("customerId") String customerId);
}