package com.cmvr.inspection.mapper; import java.util.List; import java.util.Date; import com.cmvr.inspection.domain.InspectionRobot; import com.cmvr.inspection.domain.vo.InspectionRobotVo; import com.github.yulichang.base.MPJBaseMapper; import org.apache.ibatis.annotations.Param; /** * 巡检机器人Mapper接口 * * @author cmvr-iot * @since 2026-05-29 */ public interface InspectionRobotMapper extends MPJBaseMapper { /** * 查询巡检机器人 * * @param id 巡检机器人主键 * @return 巡检机器人 */ InspectionRobot selectInspectionRobotById(String id); List selectByRobotId(String robotId); int updateQuicRuntimeState(InspectionRobot robot); /** * Update the AGV runtime snapshot without changing business audit fields. */ int updateRuntimeStatus(InspectionRobot robot); /** * Select connected robots that currently report one online AGV device. */ List selectRuntimeSyncCandidates(@Param("heartbeatCutoff") Date heartbeatCutoff, @Param("excludedRobotIds") List excludedRobotIds); List selectStaleConnectedRobots(@Param("heartbeatCutoff") Date heartbeatCutoff, @Param("excludedRobotIds") List excludedRobotIds); int markHeartbeatExpiredOffline(@Param("id") String id, @Param("heartbeatCutoff") Date heartbeatCutoff, @Param("offlineTime") Date offlineTime); int archiveInspectionRobotByIds(@Param("ids") String[] ids, @Param("updateBy") String updateBy); /** * 新增巡检机器人 * * @param inspectionRobot 巡检机器人 * @return 结果 */ int insertInspectionRobot(InspectionRobot inspectionRobot); /** * 修改巡检机器人 * * @param inspectionRobot 巡检机器人 * @return 结果 */ int updateInspectionRobot(InspectionRobot inspectionRobot); /** * 批量删除巡检机器人 * * @param ids 需要删除的数据主键集合 * @return 结果 */ int deleteInspectionRobotByIds(String[] ids); /** * 查询巡检机器人视图列表(包含关联信息) * * @param inspectionRobot 巡检机器人 * @return 巡检机器人视图集合 */ List selectInspectionRobotVoList(InspectionRobot inspectionRobot); }