package com.ktg.iscs.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktg.common.mapper.BaseMapperX;
import com.ktg.iscs.domain.IsMaterialsLoan;
import com.ktg.iscs.domain.dto.materialsLoan.MaterialsLoanPageDTO;
import com.ktg.iscs.domain.dto.materialsLoan.ReminderPageDTO;
import com.ktg.iscs.domain.vo.materialsLoan.MaterialsLoanPageVO;
import com.ktg.iscs.domain.vo.materialsLoan.ReminderPageVO;
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 IsMaterialsLoanMapper extends BaseMapperX<IsMaterialsLoan>
{
    /**
     * 查询物资借出
     *
     * @param materialsLoanId 物资借出主键
     * @return 物资借出
     */
    IsMaterialsLoan selectIsMaterialsLoanByMaterialsLoanId(Long materialsLoanId);

    /**
     * 查询物资借出列表
     *
     * @param isMaterialsLoan 物资借出
     * @return 物资借出集合
     */
    List<IsMaterialsLoan> selectIsMaterialsLoanList(IsMaterialsLoan isMaterialsLoan);

    /**
     * 新增物资借出
     *
     * @param isMaterialsLoan 物资借出
     * @return 结果
     */
    int insertIsMaterialsLoan(IsMaterialsLoan isMaterialsLoan);

    /**
     * 修改物资借出
     *
     * @param isMaterialsLoan 物资借出
     * @return 结果
     */
    int updateIsMaterialsLoan(IsMaterialsLoan isMaterialsLoan);

    /**
     * 删除物资借出
     *
     * @param materialsLoanId 物资借出主键
     * @return 结果
     */
    int deleteIsMaterialsLoanByMaterialsLoanId(Long materialsLoanId);

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

    Page<MaterialsLoanPageVO> getIsMaterialsLoanPage(Page<IsMaterialsLoan> page, @Param(value = "dto") MaterialsLoanPageDTO dto);

    Page<ReminderPageVO> getReturnReminderPage(Page<IsMaterialsLoan> page, @Param(value = "dto") ReminderPageDTO dto);

    Page<ReminderPageVO> getExpiredReminderPage(Page<IsMaterialsLoan> page, @Param(value = "dto") ReminderPageDTO dto);

    List<Long> getLastLoanRecord(@Param(value = "ids") List<Long> ids);

}
