package com.ktg.iscs.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ktg.iscs.domain.IsJobTicketLock;
import com.ktg.iscs.domain.vo.hardwareApi.JobTicketLockVO;

import java.util.List;

/**
 * 作业票关联锁Service接口
 *
 * @author cgj
 * @date 2024-11-18
 */
public interface IIsJobTicketLockService extends IService<IsJobTicketLock>
{
    /**
     * 查询作业票关联锁
     *
     * @param recordId 作业票关联锁主键
     * @return 作业票关联锁
     */
    IsJobTicketLock selectIsJobTicketLockByRecordId(Long recordId);

    /**
     * 查询作业票关联锁列表
     *
     * @param isJobTicketLock 作业票关联锁
     * @return 作业票关联锁集合
     */
    List<IsJobTicketLock> selectIsJobTicketLockList(IsJobTicketLock isJobTicketLock);

    /**
     * 新增作业票关联锁
     *
     * @param isJobTicketLock 作业票关联锁
     * @return 结果
     */
    int insertIsJobTicketLock(IsJobTicketLock isJobTicketLock);

    /**
     * 修改作业票关联锁
     *
     * @param isJobTicketLock 作业票关联锁
     * @return 结果
     */
    int updateIsJobTicketLock(IsJobTicketLock isJobTicketLock);

    /**
     * 批量删除作业票关联锁
     *
     * @param recordIds 需要删除的作业票关联锁主键集合
     * @return 结果
     */
    int deleteIsJobTicketLockByRecordIds(String recordIds);

    /**
     * 删除作业票关联锁信息
     *
     * @param recordId 作业票关联锁主键
     * @return 结果
     */
    int deleteIsJobTicketLockByRecordId(Long recordId);

    List<IsJobTicketLock> selectByTicketId(Long ticketId);

    List<JobTicketLockVO> getTicketLockByTicketId(Long ticketId);

    /**
     * 通过锁的nfc查询当前关联的未完成的作业
     * @param nfc
     * @return
     */
    IsJobTicketLock getLockJobByBfc(String nfc, Long ticketId);

    /**
     * 查一下哪个作业票用了这个挂锁，而且还没有完成
     * @param lockId
     * @return
     */
    List<IsJobTicketLock> getLockJob(Long lockId);
}
