package com.erp.supplier.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.erp.supplier.entity.SupplierRating;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface SupplierRatingRepository extends BaseMapper<SupplierRating> {

    IPage<SupplierRating> selectRatingPage(Page<SupplierRating> page,
                                          @Param("supplierId") Long supplierId,
                                          @Param("grade") String grade,
                                          @Param("ratingYear") Integer ratingYear,
                                          @Param("ratingPeriod") String ratingPeriod);

    List<SupplierRating> selectBySupplierId(Long supplierId);

    SupplierRating selectLatestBySupplierId(Long supplierId);
}
