package com.gameplatform.server.mapper.history;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gameplatform.server.model.entity.history.DeviceStatusTransition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DeviceStatusTransitionMapper extends BaseMapper<DeviceStatusTransition> {
    
    /**
     * 查询指定设备的最近状态变更记录
     */
    List<DeviceStatusTransition> findRecentByDeviceId(@Param("deviceId") String deviceId, @Param("size") int size);
    
    /**
     * 删除24小时前的历史记录
     * @return 删除的记录数
     */
    int deleteOldRecords();
}


