package com.zt.plat.module.base.dal.mysql.masterdata;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.zt.plat.module.base.dal.dataobject.masterdata.MdmMaterialViewDO;
import com.zt.plat.module.base.framework.sync.constant.MasterDataSyncConstants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;

/**
 * Mapper that exposes read-only access to the external MDM material view.
 */
@Mapper
@DS(MasterDataSyncConstants.DEFAULT_SOURCE_DATASOURCE)
public interface MdmMaterialViewMapper {

    List<MdmMaterialViewDO> selectSlice(@Param("offset") long offset,
                                        @Param("limit") int limit,
                                        @Param("since") LocalDateTime since,
                                        @Param("codes") Collection<String> codes);

    Long countEligible(@Param("since") LocalDateTime since,
                       @Param("codes") Collection<String> codes);
}
