package com.bonus.sgzb.base.mapper;

import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.api.domain.SltAgreementApply;
import com.bonus.sgzb.base.domain.DataReceiveDetail;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MaMachineMapper {
    public List<MaMachine> getMaMachine(MaMachine maMachine);

    public List<MaMachine> getMaMachineByCode(String maCode);
    public List<MaMachine> getMaMachineByMaIdAndMaCode(MaMachine maMachine);
    public List<MaMachine> getMaMachineByMaTypeAndMaCode(MaMachine maMachine);

    public List<MaMachine> getMaMachineByQrCode(String qrCode);

    public List<MaMachine> getMaMachineList(MaMachine maMachine);

    public int maMachineAdd(MaMachine maMachine);

    public int remove(Long[] maIds);

    public int updateMaMachine(MaMachine maMachine);

    /**
     * 查询机具设备管理ma_machine
     *
     * @param maId 机具设备管理ma_machine主键
     * @return 机具设备管理ma_machine
     */
    public MaMachine selectMaMachineByMaId(Long maId);


    List<MaMachine> getMaMachineByRfidCode(String rfidCode);


    MaMachine getMachineByQrCode(MaMachine maMachine);

    SltAgreementApply getLeaseProject(MaMachine ma);

    SltAgreementApply getBackProject(MaMachine ma);

    /**
     * 根据typeId修改库存
     * @param typeId
     * @return
     */
    int updateNum(long typeId);

    Long selectMaMachineByItemId(Long itemId);

    Integer updateItemStatus(DataReceiveDetail dataReceiveDetail);
}
