| | |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.qianwen.mdc.collect.dto.StateAggregateTimeDTO; |
| | | import com.qianwen.mdc.collect.entity.iotdb.DeviceState; |
| | | |
| | | import java.util.List; |
| | |
| | | @DS("iotdb") |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | public interface DeviceStateMapper extends BaseMapper<DeviceState> { |
| | | void createSuperTable(); |
| | | //void createSuperTable(); |
| | | |
| | | //void createTable(Long workstationId); |
| | | |
| | |
| | | |
| | | DeviceState getLastIsSyncNoFixPointState(@Param("workstationId") Long workstationId); |
| | | |
| | | DeviceState getLastWorkstationState(@Param("ew") Wrapper query); |
| | | //DeviceState getLastWorkstationState(@Param("ew") Wrapper query); |
| | | /** |
| | | * 获取最新的已同步的非反馈点状态 |
| | | * @param workstationId |
| | | * @return |
| | | */ |
| | | DeviceState lastSyncedNoFeedbackPointState(Long workstationId); |
| | | |
| | | //DeviceState getFirstWorkstationState(@Param("ew") Wrapper query); |
| | | /** |
| | | * 获取第一个的未同步的非反馈点状态 |
| | | * @param workstationId |
| | | * @return |
| | | */ |
| | | DeviceState firstNotSyncedNofeedbackPointState(Long workstationId); |
| | | |
| | | DeviceState getFirstWorkstationState(@Param("ew") Wrapper query); |
| | | /** |
| | | * 获取时间区间内的状态数据 |
| | | * @param workstationId |
| | | * @param timeRange |
| | | * @return |
| | | */ |
| | | List<DeviceState> statesInTimeRange(@Param("workstationId")Long workstationId,@Param("timeRange") StateAggregateTimeDTO timeRange); |
| | | |
| | | /** |
| | | * 查询某天固定点数量 |
| | | * @param factoryDate |
| | | * @return |
| | | */ |
| | | Long fixPointCountByDate(int factoryDate); |
| | | |
| | | /** |
| | | * 根据工位id,获取 小于时间戳 的非反馈点数据 |
| | | * @param workstationId 工位id |
| | | * @param time 时间戳 |
| | | * @return |
| | | */ |
| | | DeviceState lastNoFeedbackStateLessThanTime(@Param("workstationId")Long workstationId, @Param("time")Long time); |
| | | |
| | | /** |
| | | * 根据工位id,获取 小于等于时间戳 的非反馈点数据 |
| | | * @param workstationId |
| | | * @param time |
| | | * @return |
| | | */ |
| | | DeviceState lastNoFeedbackStateLeTime(@Param("workstationId")Long workstationId, @Param("time")Long time); |
| | | /** |
| | | * 根据工位id和时间戳精确获取一条状态数据 |
| | | * @param workstationId |
| | | * @param time |
| | | * @return |
| | | */ |
| | | DeviceState getByWorkstationIdAndTime(@Param("workstationId")Long workstationId, @Param("time")Long time); |
| | | |
| | | /** |
| | | * 根据工位id和时间戳精确获取一条状态数据 |
| | | * @param workstationId |
| | | * @param time |
| | | * @return |
| | | */ |
| | | DeviceState getLastByWorkstationIdAndLeTimeAndShiftIndexNotNull(@Param("workstationId")Long workstationId, @Param("time")Long time); |
| | | |
| | | /** |
| | | * 根据时间和工位id,获取一个固定点 |
| | | * @param workstationId |
| | | * @param time |
| | | * @return |
| | | */ |
| | | DeviceState getFixPointByWorkstationIdAndTime(@Param("workstationId")Long workstationId, @Param("time")Long time); |
| | | |
| | | /** |
| | | * 获取指定工位时间区间内的非反馈点状态数据列表 |
| | | * @param workstationId |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<DeviceState> workstationNoFeedbackPointStatesInTimeRange(@Param("workstationId")Long workstationId, @Param("startTime")Long startTime, @Param("endTime")Long endTime); |
| | | |
| | | /** |
| | | * 获取指定工位时间区间内的 固定点 状态数据列表 |
| | | * @param workstationId |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<DeviceState> workstationFixPointStatesInTimeRange(@Param("workstationId")Long workstationId, @Param("startTime")Long startTime, @Param("endTime")Long endTime); |
| | | |
| | | DeviceState lastNoFixedState(@Param("workstationId")long workstationId); |
| | | } |