package com.ruoyi.logistics.mapper;

import java.math.BigDecimal;
import java.util.List;

import com.ruoyi.common.datascope.annotation.DataScope;
import com.ruoyi.logistics.domain.BizWaybillCostDetails;

/**
 * 运单明细Mapper接口
 * 
 * @author RuiJing
 * @date 2026-01-29
 */
public interface BizWaybillCostDetailsMapper 
{
    /**
     * 查询运单明细
     * 
     * @param waybillDetailId 运单明细主键
     * @return 运单明细
     */
    public BizWaybillCostDetails selectBizWaybillCostDetailsByWaybillDetailId(Long waybillDetailId);

    /**
     * 查询运单明细列表
     * 
     * @param bizWaybillCostDetails 运单明细
     * @return 运单明细集合
     */
    public List<BizWaybillCostDetails> selectBizWaybillCostDetailsList(BizWaybillCostDetails bizWaybillCostDetails);

    /**
     * 新增运单明细
     * 
     * @param bizWaybillCostDetails 运单明细
     * @return 结果
     */
    public int insertBizWaybillCostDetails(BizWaybillCostDetails bizWaybillCostDetails);

    /**
     * 修改运单明细
     * 
     * @param bizWaybillCostDetails 运单明细
     * @return 结果
     */
    public int updateBizWaybillCostDetails(BizWaybillCostDetails bizWaybillCostDetails);

    /**
     * 删除运单明细
     * 
     * @param waybillDetailId 运单明细主键
     * @return 结果
     */
    public int deleteBizWaybillCostDetailsByWaybillDetailId(Long waybillDetailId);

    /**
     * 批量删除运单明细
     * 
     * @param waybillDetailIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBizWaybillCostDetailsByWaybillDetailIds(Long[] waybillDetailIds);

    List<BizWaybillCostDetails> selectBizWaybillCostDetailsListByWx(BizWaybillCostDetails bizWaybillCostDetails);

    BizWaybillCostDetails getAccountAdjustmentById(BizWaybillCostDetails bizWaybillCostDetails);

    List<BizWaybillCostDetails> detaillist(BizWaybillCostDetails bizWaybillCostDetails);

    @DataScope(deptAlias = "d", userAlias = "u")
    BigDecimal selectBizWaybillCostDetailsSum(BizWaybillCostDetails bizWaybillCostDetails);

    /**
     * 插入或更新费用明细（使用ON DUPLICATE KEY UPDATE）
     * @param bizWaybillCostDetails 费用明细信息
     * @return 结果
     */
    int upsertBizWaybillCostDetails(BizWaybillCostDetails bizWaybillCostDetails);
}
