package com.shinsoft.sto.mapper.main;

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

import java.util.List;

public interface MaterialMapper extends BaseMapper<Material> {

    /**
     * 查询物料下拉框数据
     */
    @Select("SELECT id as value, material_name as label FROM T_MAIN_MATERIAL WHERE nvl(cancel_flag,'0') = '0' and belong_id = #{belongId}")
    List<com.shinsoft.sto.model.common.selectModel> selectMaterialOptions(String belongId);

    /**
     * 分页查询物料列表
     */
    IPage<Material> selectMaterialPage(Page<Material> page, @Param("material") String material, @Param("standard") String standard, @Param("belongId") String belongId);

    /**
     * 根据物料名称查询
     */
    List<Material> selectByMaterialName(@Param("materialName") String materialName, @Param("belongId") String belongId);
}