package com.ruoyi.warehouseBusiness.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 仓库明细从表Mapper接口
 *
 * @author ruoyi
 * @date 2020-12-11
 */
public interface TWarehousebillsitemsMapper extends BaseMapper<TWarehousebillsitems> {
    /**
     * 查询仓库明细从表
     *
     * @param fId 仓库明细从表ID
     * @return 仓库明细从表
     */
    public TWarehousebillsitems selectTWarehousebillsitemsById(Long fId);

    /**
     * 查询仓库明细从表列表
     *
     * @param tWarehousebillsitems 仓库明细从表
     * @return 仓库明细从表集合
     */
    public List<TWarehousebillsitems> selectTWarehousebillsitemsList(TWarehousebillsitems tWarehousebillsitems);

    /**
     * 新增仓库明细从表
     *
     * @param tWarehousebillsitems 仓库明细从表
     * @return 结果
     */
    public int insertTWarehousebillsitems(TWarehousebillsitems tWarehousebillsitems);

    /**
     * 修改仓库明细从表
     *
     * @param tWarehousebillsitems 仓库明细从表
     * @return 结果
     */
    public int updateTWarehousebillsitems(TWarehousebillsitems tWarehousebillsitems);

    /**
     * 删除仓库明细从表
     *
     * @param fId 仓库明细从表ID
     * @return 结果
     */
    public int deleteTWarehousebillsitemsById(Long fId);

    /**
     * 批量删除仓库明细从表
     *
     * @param fIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteTWarehousebillsitemsByIds(Long[] fIds);

    int deleteByFPid(Long fId);

    List<Map<String, Object>> selectGoodsTransferitemsList(TWarehousebillsitems tWarehousebillsitems);

    /**
     * 新增库存费计算
     * @param tWarehouseBills 查询条件
     * @return  结果
     */
    List<Map<String, Object>> selectStorageFeeItemList(@Param("warehouse") TWarehouseBills tWarehouseBills);

    /**
     *  根据库存主表id更新 库存明细表对应状态
     * @param fettle 状态
     * @param fPid 主表id
     * @return 结果
     */
    int warehouseItemFollowUpdate(@Param("fPid") Long fPid, @Param("fettle") Long fettle);

    int warehousebillsitemsWarehouselocidSize(@Param("fWarehouselocid") Long fPid);

    /**
     *  计算仓储费撤回根据状态判断修改对应字段
     * @param billsItem
     * @return
     */
    int agreementApprovalRejected(TWarehousebillsitems billsItem);
}
