package com.ktg.iscs.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktg.common.mapper.BaseMapperX;
import com.ktg.iscs.domain.IsMaterials;
import com.ktg.iscs.domain.dto.materials.MaterialsPageDTO;
import com.ktg.iscs.domain.vo.hardwareMaterialApi.CheckMaterialsDateVO;
import com.ktg.iscs.domain.vo.materials.MaterialsPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 物资Mapper接口
 *
 * @author cgj
 * @date 2024-11-08
 */
@Mapper
public interface IsMaterialsMapper extends BaseMapperX<IsMaterials>
{
    /**
     * 查询物资
     *
     * @param materialsId 物资主键
     * @return 物资
     */
    IsMaterials selectIsMaterialsByMaterialsId(Long materialsId);

    /**
     * 查询物资列表
     *
     * @param isMaterials 物资
     * @return 物资集合
     */
    List<IsMaterials> selectIsMaterialsList(IsMaterials isMaterials);

    /**
     * 新增物资
     *
     * @param isMaterials 物资
     * @return 结果
     */
    int insertIsMaterials(IsMaterials isMaterials);

    /**
     * 修改物资
     *
     * @param isMaterials 物资
     * @return 结果
     */
    int updateIsMaterials(IsMaterials isMaterials);

    /**
     * 删除物资
     *
     * @param materialsId 物资主键
     * @return 结果
     */
    int deleteIsMaterialsByMaterialsId(Long materialsId);

    /**
     * 批量删除物资
     *
     * @param materialsIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteIsMaterialsByMaterialsIds(Long[] materialsIds);

    Page<MaterialsPageVO> getIsMaterialsPage(Page<IsMaterials> page, @Param(value = "dto") MaterialsPageDTO dto);

    List<MaterialsPageVO> getExMaterials(@Param(value = "materialsIds") List<Long> materialsIds);

    List<CheckMaterialsDateVO> getCheckMaterialsByCabinetId(@Param(value = "cabinetId") Long cabinetId);

    List<IsMaterials> getMaterialListByRfid(@Param(value = "rfidList") List<String> rfidList);

}
