package com.dk.mdm.mapper.ivt;

import com.dk.mdm.model.pojo.ivt.InventoryBatch;
import com.dk.common.mapper.BaseMapper;
import com.dk.mdm.model.query.ivt.InOutRecordQuery;
import com.dk.mdm.model.query.ivt.InventoryBatchQuery;
import com.dk.mdm.model.response.ivt.InOutRecordResponse;
import com.dk.mdm.model.response.ivt.InventoryBatchResponse;
import com.dk.mdm.model.vo.ivt.InventoryBatchVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
*  存货批次明细 Mapper
*/
@Repository
public interface InventoryBatchMapper extends BaseMapper<InventoryBatch>{

    /**
     * @desc   : 根据id查询
     * @date   : 2024/3/9 9:14
     * @author : 寇珊珊
     */
    InventoryBatchResponse selectById(@Param("id") String id);

    /**
     * @desc   : 条件查询
     * @date   : 2024/3/20 9:39
     * @author : 寇珊珊
     */
    List<InventoryBatchResponse> selectByCond(InventoryBatchQuery inventoryBatchQuery);

    /**
     * @desc   : 条件查询个数
     * @date   : 2024/3/20 9:39
     * @author : 寇珊珊
     */
    Long countByCond(InventoryBatchQuery inventoryBatchQuery);



    /**
     * @desc   : 查询库存批次明细 时间正序 目前用于出库减库存
     * @date   : 2024/3/20 9:39
     * @author : 寇珊珊
     */
    List<InventoryBatchResponse> selectAmountAndQuantity(InventoryBatchQuery inventoryBatchQuery);

    /**
     * @desc   : 修改数量金额
     * @date   : 2024/3/22 14:23
     * @author : 寇珊珊
     */
    int updateAmountAndQuantity(InventoryBatchVO inventoryBatchVO);

    /**
     * @desc   : 修改数量金额--直接赋值
     * @date   : 2024/3/22 14:23
     * @author : 寇珊珊
     */
    int updateAmtAndQty(InventoryBatch inventoryBatch);

    /**
     * @desc   : 删除数据
     * @date   : 2024/4/10 13:46
     * @author : 寇珊珊
     */
    int deleteData(InventoryBatch inventoryBatch);


    /**
     * @desc   : 根据来源信息查询
     * @date   : 2024/4/11 10:44
     * @author : 寇珊珊
     */
    InventoryBatchResponse  selectByFromCondition(InventoryBatchQuery inventoryBatchQuery);

    /**
     * @desc   : 入库成本核对查询存货批次明细
     * @author : 常皓宁
     * @date   : 2024/4/18 9:42
     */
    InventoryBatchResponse  selectCostCondition(InventoryBatchQuery inventoryBatchQuery);

    /**
     * @desc   : 修改存货批次明细(入库成本核对)
     * @author : 常皓宁
     * @date   : 2024/4/18 10:29
     */
    int updateInventoryBatchCost(InventoryBatchQuery inventoryBatchQuery);



}

