insert into iot_data.aggregate_state_${workstationId}
values ${sql}
select sum(duration_collect) as nums, value_collect status
from iot_data.super_aggregate_state
where workstation_id = #{workstationId}
and wcs > 0
and factory_date = #{factoryDate}
and shift_index = #{shiftIndex}
and calendar_code = #{calendarCode}
and is_deleted = 0
and end_time is not null
group by value_collect;
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.super_aggregate_state
where workstation_id = #{workstationId}
and wcs > 0
and factory_date = #{factoryDate}
and shift_index = #{shiftIndex}
and calendar_code = #{calendarCode}
and is_deleted = 0
select ts as startDate, end_time as endDate, value_collect as status
from iot_data.super_aggregate_state
where workstation_id = #{workstationId}
and is_deleted = 0
and wcs > 0
and ts >= #{startTime}
and end_time <= #{endTime};
select ts as startDate, end_time as endDate, value_collect as status
from iot_data.super_aggregate_state
where workstation_id = #{workstationId}
and is_deleted = 0
and wcs > 0
and ts >= #{startTime}
and end_time is null;
select ts as startDate, end_time as endDate, value_collect as status
from iot_data.super_aggregate_state
where workstation_id IN
#{ids}
and is_deleted = 0
and wcs > 0
and ts >= #{startTime}
and end_time <= #{endTime};
select ts as startDate, end_time as endDate, value_collect as status
from iot_data.super_aggregate_state
where workstation_id IN
#{ids}
and is_deleted = 0
and wcs > 0
and ts >= #{startTime}
and end_time is null;
select count(*) as deviceNum, value_collect as status
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
and ts >= #{startTime}
and end_time is null
group by value_collect;
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
AND
(factory_year = #{intervalDateDto.year}
AND factory_month IN
#{month}
)
AND workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
AND
(factory_year = #{intervalDateDto.year}
AND factory_week IN
#{week}
)
AND workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
AND factory_date IN
#{day}
AND workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
and factory_date = #{factoryDate}
and shift_index = #{shiftIndex}
and rps > 0
AND workstation_id IN
#{id}
ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
and factory_date = #{factoryDate}
and shift_index = #{shiftIndex}
AND workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
and factory_date = #{factoryDate}
and shift_index = #{shiftIndex}
AND workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
and factory_date = #{factoryDate}
and shift_index IN
#{shift}
AND workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from iot_data.super_aggregate_state
where is_deleted = 0
and wcs > 0
and factory_year = #{year}
and workstation_id IN
#{id}
and factory_week IN
#{week}
select
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from root.f2.aggregate_state_*
where is_deleted=false
and wcs > 0
and factory_year = #{year}
and workstation_id IN
#{id}
and factory_month IN
#{month}
align by device
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from iot_data.super_aggregate_state
where (ts between #{startTime} and #{endTime})
and (end_time < #{startTime} or end_time > #{endTime})
select ts as startTime,
end_time as endTime,
duration_collect,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
workstation_id as workstationId,
is_plan as isPlan
from iot_data.aggregate_state_${workstationId}
where factory_date between #{startDate} and #{endDate}
and rps > 0
and wcs > 0
and is_deleted = false
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from iot_data.super_aggregate_state
where ts >= #{startTime} and end_time <= #{endTime}
and workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from iot_data.super_aggregate_state
where (ts between #{startTime} and #{endTime})
and (end_time >= #{endTime} or end_time is null)
and workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from iot_data.super_aggregate_state
where (end_time between #{startTime} and #{endTime})
and ts < #{startTime}
and workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId
from iot_data.super_aggregate_state
where ts < #{startTime}
and (end_time > #{endTime} or end_time is null)
and workstation_id IN
#{id}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where factory_date >= #{startTime}
and factory_date <= #{endTime}
and workstation_id = #{workstationId}
and employee_id = #{employeeId}
and wcs is not null
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where factory_week in
#{week}
and workstation_id = #{workstationId}
and employee_id = #{employeeId}
and wcs is not null
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where factory_month in
#{month}
and workstation_id = #{workstationId}
and employee_id = #{employeeId}
and wcs is not null
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where employee_id = #{employeeId}
and workstation_id is not null
and wcs is not null
and factory_date = #{queryTime}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where employee_id = #{employeeId}
and workstation_id is not null
and wcs is not null
and factory_week = #{week}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where employee_id = #{employeeId}
and workstation_id is not null
and wcs is not null
and factory_month = #{month}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where workstation_id = #{workstationId}
and employee_id is not null
and wcs is not null
and factory_date = #{time}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where workstation_id = #{workstationId}
and employee_id is not null
and wcs is not null
and factory_week = #{week}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
employee_id as employeeId
from iot_data.super_aggregate_state
where workstation_id = #{workstationId}
and employee_id is not null
and wcs is not null
and factory_month = #{month}
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan,
employee_id as employeeId
from iot_data.super_aggregate_state
where workstation_id in
#{id}
and factory_month = #{month}
and wcs > 0
and rps > 0
and is_deleted = 0
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan,
employee_id as employeeId
from iot_data.super_aggregate_state
where workstation_id in
#{id}
and factory_month = #{month}
and wcs = #{code}
and rps > 0
and is_deleted = 0
select ts as startTime,
end_time as endTime,
duration_collect,
value_collect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan,
employee_id as employeeId
from iot_data.super_aggregate_state
where workstation_id in
#{id}
and factory_week = #{week}
and wcs = #{code}
and rps > 0
and is_deleted = 0
end_time as endTime,
duration_collect as durationCollect,
value_collect as valueCollect,
calendar_code as calendarCode,
factory_year as factoryYear,
factory_month as factoryMonth,
factory_week as factoryWeek,
factory_date as factoryDate,
shift_index as shiftIndex,
shift_time_type as shiftTimeType,
wcs,
rps,
is_deleted as isDeleted,
workstation_id as workstationId,
is_plan as isPlan
select
from root.f2.aggregate_state_*
where ((time #{startDate} and end_time =]]> #{startDate}) or (time =]]> #{startDate} and time #{endDate}))
and is_deleted=false
and rps > 0
and wcs > 0
AND workstation_id IN
#{id}
and wcs =#{status}
align by device
select
from root.f2.aggregate_state_*
where is_deleted = false
and wcs > 0
and ((time #{startDate} and end_time =]]> #{startDate}) or (time =]]> #{startDate} and time #{endDate}))
AND workstation_id IN
#{id}
align by device
select
from root.f2.aggregate_state_*
where is_deleted = false
and wcs > 0
and time =]]> #{startDate} and time #{endDate}
AND workstation_id IN
#{id}
align by device
select
from root.f2.aggregate_state_*
where factory_date =]]> #{startFactoryDate} and factory_date #{endFactoryDate}
and rps > 0
and wcs > 0
and is_deleted = false
AND workstation_id IN
#{id}
align by device
select
from root.f2.aggregate_state_*
where factory_date = #{factoryDate}
and wcs > 0
and shift_index = #{shiftIndex}
and calendar_code = "#{calendarCode}"
and is_deleted = false
AND workstation_id IN
#{id}
align by device
select
from root.f2.aggregate_state_*
where factory_year = #{year}
and factory_week = #{week}
and is_deleted = false
and wcs > 0
AND workstation_id IN
#{id}
align by device
select
from root.f2.aggregate_state_*
where factory_year = #{year}
and factory_month = #{month}
and is_deleted = false
and wcs > 0
AND workstation_id IN
#{id}
align by device
select
from root.f2.aggregate_state_*
where is_deleted = false
and wcs > 0
and factory_date = #{factoryDate}
AND workstation_id IN
#{id}
align by device