package com.ruoyi.inventory.mapper;

import java.util.Date;
import java.util.List;
import com.ruoyi.inventory.domain.HealthcareDrugFiling;
import com.ruoyi.inventory.domain.HealthcareInventoryDrugentry;
import com.ruoyi.inventory.domain.HealthcareInventoryDrugentryDetails;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.security.core.parameters.P;

/**
 * 药品库存Mapper接口
 *
<<<<<<< HEAD
 * @author 蒋松霖
=======
 * @author ruoyi
>>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb
 * @date 2024-09-24
 */
public interface HealthcareDrugFilingMapper
{
    /**
     * 查询药品库存
     *
     * @param id 药品库存主键
     * @return 药品库存
     */
    public HealthcareDrugFiling selectHealthcareDrugFilingById(Long id);

    /**
     * 查询药品库存
     *
     * @param archiveId 药品档案主键
     * @return 药品库存
     */
    List<HealthcareDrugFiling> selectHealthcareDrugFilingByArchiveId(@Param("archiveId") Long archiveId);


    /**
     * 根据药品档案条码和批次号码查询库存记录

     * @param batch 批次号码
     * @return 库存记录列表
     */
    List<HealthcareDrugFiling> selectHealthcareDrugFilingByArchiveBatch(@Param("batch") String batch);

    /**
     * 查询药品库存列表
     *
     * @param healthcareDrugFiling 药品库存
     * @return 药品库存集合
     */
    public List<HealthcareDrugFiling> selectHealthcareDrugFilingList(HealthcareDrugFiling healthcareDrugFiling);

    /**
     * 新增药品库存
     *
     * @param healthcareDrugFiling 药品库存
     * @return 结果
     */
    public int insertHealthcareDrugFiling(HealthcareDrugFiling healthcareDrugFiling);

    /**
     * 修改药品库存
     *
     * @param healthcareDrugFiling 药品库存
     * @return 结果
     */
    public int updateHealthcareDrugFiling(HealthcareDrugFiling healthcareDrugFiling);

    /**
     * 删除药品库存
     *
     * @param id 药品库存主键
     * @return 结果
     */
    public int deleteHealthcareDrugFilingById(Long id);

    /**
     * 批量删除药品库存
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteHealthcareDrugFilingByIds(Long[] ids);


    int insertHealthcareDrugFilings(List<HealthcareDrugFiling> list);

    void deleteHealthcareDrugArchiveByIds(Long[] ids);

    HealthcareDrugFiling findByBatchAndStoreroomId(HealthcareDrugFiling healthcareDrugFiling);

    HealthcareDrugFiling selectHealthcareDrugFilingByIdAndStoreroom(HealthcareDrugFiling filing);

    List<HealthcareDrugFiling> selectHealthcareDrugFilingByBarcodeAndBatch(HealthcareDrugFiling filing);

    Integer selectcountAmount(@org.apache.ibatis.annotations.Param("startDate") Date startDate, @org.apache.ibatis.annotations.Param("endDate") Date endDate);

    Integer selectcountAdvent(@org.apache.ibatis.annotations.Param("startDate") Date startDate,
                              @org.apache.ibatis.annotations.Param("endDate") Date endDate);

    Integer selectcountAlerts(@org.apache.ibatis.annotations.Param("startDate") Date startDate, @org.apache.ibatis.annotations.Param("endDate") Date endDate);
}
