package com.bonus.material.purchase.mapper;

import com.bonus.material.purchase.domain.PurchaseCheckDetails;
import com.bonus.material.purchase.domain.dto.PurchaseDto;
import com.bonus.material.purchase.domain.vo.PurchaseVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author ma_sh
 * @create 2024/10/21 18:43
 */
public interface PurchaseBindMapper {

    /**
     * 查询所有
     * @param dto
     * @return
     */
    List<PurchaseVo> selectAll(PurchaseDto dto);

    /**
     * 查询绑定信息
     * @param dto
     * @return
     */
    List<PurchaseVo> selectPurchaseCheckInfoById(PurchaseDto dto);

    /**
     * 获取绑定信息
     * @param dto
     * @return
     */
    List<PurchaseVo> getDetails(PurchaseDto dto);

    /**
     * 根据编码查询
     * @param purchaseDto
     * @return
     */
    List<PurchaseDto> selectByCode(PurchaseDto purchaseDto);

    /**
     * 新增绑定信息
     * @param purchaseDto
     * @return
     */
    int add(PurchaseDto purchaseDto);

    /**
     * 查询二维码code
     * @param genMonth
     * @return
     */
    List<PurchaseVo> select(String genMonth);

    /**
     * 查询状态
     * @param purchaseDto
     * @return
     */
    Integer selectStatus(PurchaseDto purchaseDto);

    /**
     * 更新状态
     * @param id
     * @param purchaseId
     */
    void updateStatus(@Param("id") String id, @Param("purchaseId") String purchaseId);

    /**
     * 二维码数据保存
     * @param dto
     */
    void insert(PurchaseDto dto);

    /**
     * 更新绑定状态
     * @param updatedStatus
     * @param purchaseId
     */
    int updateStatusById(@Param("updatedStatus") Integer updatedStatus, @Param("id") String purchaseId);

    /**
     * 更新数量
     * @param dto
     * @param num
     * @return
     */
    int updateNum(@Param("dto") PurchaseDto dto, @Param("num") int num);

    /**
     * 根据id查询详情
     * @param purchaseDto
     * @return
     */
    List<PurchaseVo> getDetailById(PurchaseDto purchaseDto);

    List<PurchaseCheckDetails> getMachineById(PurchaseDto dto);
}
