package com.ktg.iscs.mapper;

import com.ktg.common.mapper.BaseMapperX;
import com.ktg.iscs.domain.IsJobTicketPoints;
import com.ktg.iscs.domain.vo.ticketPoints.IsJobTicketPointsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 作业票隔离点Mapper接口
 *
 * @author cgj
 * @date 2024-10-18
 */
@Mapper
public interface IsJobTicketPointsMapper extends BaseMapperX<IsJobTicketPoints>
{
    /**
     * 查询作业票隔离点
     *
     * @param recordId 作业票隔离点主键
     * @return 作业票隔离点
     */
    IsJobTicketPoints selectIsJobTicketPointsByRecordId(Long recordId);

    /**
     * 查询作业票隔离点列表
     *
     * @param isJobTicketPoints 作业票隔离点
     * @return 作业票隔离点集合
     */
    List<IsJobTicketPoints> selectIsJobTicketPointsList(IsJobTicketPoints isJobTicketPoints);

    /**
     * 新增作业票隔离点
     *
     * @param isJobTicketPoints 作业票隔离点
     * @return 结果
     */
    int insertIsJobTicketPoints(IsJobTicketPoints isJobTicketPoints);

    /**
     * 修改作业票隔离点
     *
     * @param isJobTicketPoints 作业票隔离点
     * @return 结果
     */
    int updateIsJobTicketPoints(IsJobTicketPoints isJobTicketPoints);

    /**
     * 删除作业票隔离点
     *
     * @param recordId 作业票隔离点主键
     * @return 结果
     */
    int deleteIsJobTicketPointsByRecordId(Long recordId);

    /**
     * 批量删除作业票隔离点
     *
     * @param recordIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteIsJobTicketPointsByRecordIds(Long[] recordIds);

    List<IsJobTicketPointsVO> getListByTicketId(@Param(value = "ticketId") Long ticketId);

    List<IsJobTicketPoints> getFinishConflictJob(@Param(value = "pointId") Long pointId, @Param(value = "lockId") Long lockId);

    List<IsJobTicketPoints> getNotFinishConflictJob(@Param(value = "pointId") Long pointId, @Param(value = "lockId") Long lockId);

    IsJobTicketPoints getLockingData(@Param(value = "pointId") Long pointId);

    List<IsJobTicketPoints> getVirtualLockConflictPoint(@Param(value = "pointId") Long pointId, @Param(value = "lockId") Long lockId, @Param(value = "ticketId") Long ticketId);
}
