1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
package com.qianwen.smartman.modules.mdc.mapper;
 
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 
 
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.qianwen.smartman.common.constant.FmsConstant;
import com.qianwen.smartman.modules.mdc.dto.IntervalDateDto;
import com.qianwen.smartman.modules.mdc.entity.SuperAggregateState;
import com.qianwen.smartman.modules.mdc.vo.DeviceStatusStatisticsVO;
import com.qianwen.smartman.modules.mdc.vo.StatusAnalysisWorkstationVO;
 
//@DS("tdengine")
@DS("iotdb")
@InterceptorIgnore(tenantLine = FmsConstant.AUTOMATIC)
public interface SuperAggregateStateMapper {
    //void createTable(@Param("workstationId") Long workstationId);
 
    void insertData(@Param("workstationId") Long workstationId, @Param("sql") String sql);
 
    List<SuperAggregateState> countStatsShift(@Param("workstationId") String workstationId, @Param("factoryDate") String factoryDate, @Param("shiftIndex") Integer shiftIndex, @Param("calendarCode") String calendarCode);
 
    List<StatusAnalysisWorkstationVO> statusByWorkstation(@Param("workstationId") String workstationId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
    List<StatusAnalysisWorkstationVO> statusByWorkstationByNull(@Param("workstationId") String workstationId, @Param("startTime") String startTime);
 
    /**
     * 查询指定工位符合factoryDate的数据 用时分析
     * @param factoryDate
     * @param ids
     * @return
     */
    List<SuperAggregateState> dateState(@Param("factoryDate") int factoryDate, @Param("ids") List<Long> ids);
 
    /**
     * 查询指定工位符合星期的数据 用时分析
     * @param ids
     * @param year
     * @param week
     * @return
     */
    List<SuperAggregateState> weekState(@Param("ids") List<Long> ids, @Param("year") Integer year, @Param("week") Integer week);
 
    /**
     * 查询指定工位符合年份和月份的数据 用时分析
     * @param ids
     * @param year
     * @param month
     * @return
     */
    List<SuperAggregateState> yearState(@Param("ids") List<Long> ids, @Param("year") Integer year, @Param("month") Integer month);
    /**
     * 查询指定工位符合班次和factoryDate的数据,用时分析中使用
     * @param workStationIds
     * @param factoryDate
     * @param shiftIndex
     * @param calendarCode
     * @return
     */
    List<SuperAggregateState> shiftState(@Param("ids") List<Long> workStationIds, @Param("factoryDate") Integer factoryDate, @Param("shiftIndex") Integer shiftIndex, @Param("calendarCode") String calendarCode);
 
    List<StatusAnalysisWorkstationVO> statusByWorkstationList(@Param("workstationIdList") List<Long> workstationIdList, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
    List<StatusAnalysisWorkstationVO> statusByWorkstationListByNull(@Param("workstationIdList") List<Long> workstationIdList, @Param("startTime") String startTime);
 
    List<DeviceStatusStatisticsVO> deviceStatusStatisticsList(@Param("startTime") String startTime);
 
    List<SuperAggregateState> getStatusDataMonth(@Param("intervalDateDtoList") List<IntervalDateDto> intervalDateDtoList, @Param("workstationIds") List<Long> workstationIds);
 
    List<SuperAggregateState> getStatusDataWeek(@Param("intervalDateDtoList") List<IntervalDateDto> intervalDateDtoList, @Param("workstationIds") List<Long> workstationIds);
 
    List<SuperAggregateState> getStatusDataDay(@Param("dayList") List<String> dayList, @Param("workstationIds") List<Long> workstationIds);
 
    List<SuperAggregateState> getStatusDataShift(@Param("factoryDate") Integer factoryDate, @Param("shiftIndex") Integer shiftIndex, @Param("workstationIds") List<Long> workstationIds);
 
    List<SuperAggregateState> getStatusByFactory(@Param("factoryDate") Integer factoryDate, @Param("shiftIndex") Integer shiftIndex, @Param("workstationIds") List<Long> workstationIds);
 
    /**
     * 查询状态数据
     * @param workstationIds 指定的工位id集合
     * @param startDate 开始时间
     * @param endDate 截至时间
     * @return 数据列表
     */
    List<SuperAggregateState> getStatusData(@Param("workstationIds") List<Long> workstationIds, @Param("startDate") java.util.Date startDate, @Param("endDate") java.util.Date endDate);
 
    /**
     * 根据工位id列表和时间节点获取状态数据yys,首页稼动率时使用的
     * @param workstationIds
     * @param startDate
     * @param endDate
     * @return
     */
    List<SuperAggregateState> getStatusDataByTimeSection(@Param("workstationIds") List<Long> workstationIds, @Param("startDate") java.util.Date startDate, @Param("endDate") java.util.Date endDate);
 
    /**
     * 根据工厂日期获取聚合状态数据
     * @param workstationIds
     * @param startDate
     * @param endDate
     * @return
     */
    List<SuperAggregateState> getStatusDataByFactoryDate(@Param("workstationIds") List<Long> workstationIds, @Param("startFactoryDate") int startFactoryDate, @Param("endFactoryDate") int endFactoryDate);
 
    List<SuperAggregateState> getStatusDataByFactoryDateAndWorkstationId(@Param("workstationId") Long workstationId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
    /**
     * 获取设备运行时长所需全部状态数据,欢迎页面小部件调用.yys ,日期参数由string改为localdatetime
     * @param workstationIds
     * @param startDate 开始时间
     * @param endDate 截至时间
     * @param status 指定的状态
     * @return
     */
    //List<SuperAggregateState> getEquipmentStatusDuration(@Param("workstationIds") List<Long> workstationIds, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("status") Integer status);
    List<SuperAggregateState> getEquipmentStatusDuration(@Param("workstationIds") List<Long> workstationIds, @Param("startDate") java.util.Date startDate, @Param("endDate") java.util.Date endDate, @Param("status") Integer status);
 
    List<SuperAggregateState> getEquipmentStatusRecord(@Param("workstationIds") List<Long> workstationIds, @Param("shiftIndex") Integer shiftIndex, @Param("factoryDate") Integer factoryDate);
 
    List<SuperAggregateState> listsState(@Param("factoryDate") Integer factoryDate, @Param("workstationIds") List<Long> workstationIds, @Param("shiftIndex") List<Integer> shiftIndex);
 
    List<SuperAggregateState> getDataByWeek(@Param("workstationIds") List<Long> workstationIds, @Param("year") Integer year, @Param("weekList") List<Integer> weekList);
 
    List<SuperAggregateState> getDataByMonth(@Param("workstationIds") List<Long> workstationIds, @Param("year") Integer year, @Param("monthList") List<Integer> monthList);
 
    List<SuperAggregateState> listCrossDay(@Param("startTime") String startTime, @Param("endTime") String endTime);
 
    //void saveState(@Param("workstationId") Long workstationId, @Param("list") List<SuperAggregateState> list);
 
    List<SuperAggregateState> listInTime(@Param("workstationIds") List<Long> workstationIdList, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
    List<SuperAggregateState> listTsInTime(@Param("workstationIds") List<Long> workstationIdList, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
    List<SuperAggregateState> listEndTimeInTime(@Param("workstationIds") List<Long> workstationIdList, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
    List<SuperAggregateState> listOutTime(@Param("workstationIds") List<Long> workstationIdList, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
    List<SuperAggregateState> queryPerfByDay(@Param("workstationId") Long workstationId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("employeeId") Long employeeId);
 
    List<SuperAggregateState> queryPerfByWeek(@Param("workstationId") Long workstationId, @Param("weeks") List<Integer> weeks, @Param("employeeId") Long employeeId);
 
    List<SuperAggregateState> queryPerfByMonth(@Param("workstationId") Long workstationId, @Param("months") List<Integer> months, @Param("employeeId") Long employeeId);
 
    List<SuperAggregateState> queryPerfByEtDay(@Param("employeeId") Long employeeId, @Param("queryTime") String queryTime);
 
    List<SuperAggregateState> queryPerfByEtWeek(@Param("employeeId") Long employeeId, @Param("week") Integer week);
 
    List<SuperAggregateState> queryPerfByEtMonth(@Param("employeeId") Long employeeId, @Param("month") Integer month);
 
    List<SuperAggregateState> queryPerfByWtDay(@Param("workstationId") Long workstationId, @Param("time") String time);
 
    List<SuperAggregateState> queryPerfByWtWeek(@Param("workstationId") Long workstationId, @Param("week") Integer week);
 
    List<SuperAggregateState> queryPerfByWtMonth(@Param("workstationId") Long workstationId, @Param("month") Integer month);
 
    List<SuperAggregateState> getCurrMonthState(@Param("ids") List<Long> ids, @Param("month") Integer month);
 
    List<SuperAggregateState> getCurrMonthAlarmState(@Param("workIds") List<Long> workIds, @Param("month") Integer month, @Param("code") Integer code);
 
    List<SuperAggregateState> getCurrWeekAlarmState(@Param("workIds") List<Long> workIds, @Param("week") Integer week, @Param("code") Integer code);
}