package com.ruoyi.warehouseBusiness.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.finance.excel.FleetExcel;
import com.ruoyi.shipping.domain.TAccount;
import com.ruoyi.warehouseBusiness.domain.TWarehousebillsfees;
import org.apache.ibatis.annotations.Param;

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

/**
 * 仓库费用明细Mapper接口
 *
 * @author ruoyi
 * @date 2020-12-11
 */
public interface TWarehousebillsfeesMapper extends BaseMapper<TWarehousebillsfees> {
    /**
     * 查询仓库费用明细
     *
     * @param fId 仓库费用明细ID
     * @return 仓库费用明细
     */
    public TWarehousebillsfees selectTWarehousebillsfeesById(Long fId);

    /**
     * 查询仓库费用明细列表
     *
     * @param tWarehousebillsfees 仓库费用明细
     * @return 仓库费用明细集合
     */
    public List<TWarehousebillsfees> selectTWarehousebillsfeesList(TWarehousebillsfees tWarehousebillsfees);

    /**
     * 新增仓库费用明细
     *
     * @param tWarehousebillsfees 仓库费用明细
     * @return 结果
     */
    public int insertTWarehousebillsfees(TWarehousebillsfees tWarehousebillsfees);

    /**
     * 修改仓库费用明细
     *
     * @param tWarehousebillsfees 仓库费用明细
     * @return 结果
     */
    public int updateTWarehousebillsfees(TWarehousebillsfees tWarehousebillsfees);

    /**
     * 删除仓库费用明细
     *
     * @param fId 仓库费用明细ID
     * @return 结果
     */
    public int deleteTWarehousebillsfeesById(Long fId);

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

    int deleteByFPid(Long fId);

    /**
     *  根据主表id 更新库存费用表对应状态
     *
     * @param fettle 对应状态
     * @param fPid 主表id
     * @return  结果
     */
    int warehouseFeesFollowUpdate(@Param("fPid") Long fPid, @Param("fettle") Long fettle, @Param("auditItem") Date auditItem);


    public int updateTWarehousebillsfee(@Param("map") Map<String, Object> map);

    /**
     *  根据主表id 查询库存费用表数据
     *
     * @param fPid 主表id
     * @return  结果
     */
    List<TWarehousebillsfees> selectTWarehousebillsfeesByPId(Long fPid);

    List<TWarehousebillsfees> selectWarehousebillsfeesByPId(Long fId);

    public int selectReconciliation(Long fId);

    public int selectCharge(Long fId);

    public int selectPay(Long fId);

    public List<TWarehousebillsfees> selectFeesByPId(@Param("fPid") Long fPid,
                                                     @Param("fDc") String fDc);
    int deleteFessByFPid(@Param("fPid") Long fPid,
                         @Param("fDc") String fDc);

    /**
     *  查询总账统计报表
     * @param tWarehousebillsfees
     * @return
     */
    public List<FleetExcel> selectFleetExcelList(TWarehousebillsfees tWarehousebillsfees);

    /**
     *  查询总账统计报表月份总数
     * @param tWarehousebillsfees
     * @return
     */
    public FleetExcel  selectFleetExcelMonthList(TWarehousebillsfees tWarehousebillsfees);

    /**
     * 网页版对账查询
     * @param tAccount
     * @return
     */
    public List<Map<String,Object>> webVersionReconciliation(TAccount tAccount);
    /**
     * 网页版对账查询明细
     * @param tAccount
     * @return
     */
    public List<Map<String,Object>> webVersionDetail(TAccount tAccount);

    /**
     * 查询来源id
     * @param fId
     * @return
     */
    public List<Long> selectTWarehousebillsfeesSrcId(Long fId);

    /**
     * 首页应收款排名
     * @return
     */
    public List<Map<String,Object>> accountsDue();

}
