package com.energy.manage.service.mappers.analysispriorityrecords;


import com.energy.manage.common.mapper.MyMapper;
import com.energy.manage.common.po.analysispriorityrecords.AnalysisPriorityRecordsPo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: chy
 * @Date: 2025/2/11 10:02
 */

@Repository
public interface AnalysisPriorityRecordsMapper extends MyMapper<AnalysisPriorityRecordsPo> {

    /**
     * 查询排在第一位的优先级
     * @return
     */
    AnalysisPriorityRecordsPo queryFirstPriority();

    /**
     * 更新执行状态
     * @param taskId
     * @param executeStatus
     * @return
     */
    int updateExecuteStatus(@Param("taskId") String taskId,
                            @Param("executeStatus") Integer executeStatus);

    /**
     * 查询所有的优先级
     * @return
     */
    List<AnalysisPriorityRecordsPo> queryAllPriority();

    /**
     * 更新优先级
     * @param batchCode
     * @param priority
     * @return
     */
    int updatePriotityByBatchCode(@Param("batchCode") String batchCode, @Param("priority") Integer priority);
}
