insert into iot_data.alarm_${workstationId}
values ${sql}
create table if not exists iot_data.alarm_${workstationId} using super_alarm tags
(
#{workstationId}
)
select code as alarmCode,
message as alarmMsg,
ts as alarmTime
from iot_data.super_alarm
where workstation_id = #{workstationId}
order by ts desc
limit #{start}, #{end}
select count(*)
from iot_data.super_alarm
where workstation_id = #{workstationId}
select * count(*)
from iot_data.super_alarm
where workstation_id = #{vo.workstationId}
/*按照班次查询*/
and shift_index = #{vo.shiftIndex}
and factory_date = #{queryTime}
/*按照日查询*/
and factory_date = #{queryTime}
/*按照月查询*/
and factory_year = #{vo.year}
and factory_month = #{vo.month}
/*按照周询*/
and factory_year = #{vo.year}
and factory_week = #{vo.week}
select *
from iot_data.super_alarm
where workstation_id = #{vo.workstationId}
/*按照班次查询*/
and shift_index = #{vo.shiftIndex}
and factory_date = #{queryTime}
/*按照日查询*/
and factory_date = #{queryTime}
/*按照月查询*/
and factory_year = #{vo.year}
and factory_month = #{vo.month}
/*按照周询*/
and factory_year = #{vo.year}
and factory_week = #{vo.week}
select *
from iot_data.super_alarm
where workstation_id = #{vo.workstationId}
and shift_index = #{vo.shiftIndex}
and factory_date = #{queryTime}
and factory_date = #{queryTime}
and factory_year = #{vo.year}
and factory_month = #{vo.month}
and factory_year = #{vo.year}
and factory_week = #{vo.week}
order by ts desc
limit ${(query.current - 1) * query.size}, ${query.size}
select *
from iot_data.super_alarm
where workstation_id = #{vo.workstationId}
and factory_date between #{startTime} and #{endTime}
and shift_index != -1
and factory_year = #{year}
and factory_month in
#{month}
and factory_year = #{year}
and factory_week in
#{week}
and factory_date between #{startTime} and #{endTime}
order by ts desc
select *
from iot_data.super_alarm
where workstation_id = #{workstationId}
and factory_date =]]> #{startDate}
and factory_date #{endDate}
select
-- code as alarmCode,
-- ts,
factory_date factoryDate,
-- factory_year factoryYear,
factory_month factoryMonth,
factory_week factoryWeek,
workstation_id workstationId,
shift_index shiftIndex,
shift_time_type shiftTimeType
from iot_data.super_alarm
where shift_index != 0
AND workstation_id IN
#{id}
AND factory_date BETWEEN #{beginTime} AND #{endTime}
order by ts desc
select
shift_index shiftIndex,
ts,
factory_date factoryDate,
workstation_id workstationId
from iot_data.super_alarm
where shift_index != 0
AND workstation_id IN
#{id}
AND factory_date BETWEEN #{beginTime} AND #{endTime}
and shift_time_type != 2
and shift_index > 0
order by ts desc
select code as alarmCode,
ts,
message alarmMsg,
factory_date factoryDate,
workstation_id workstationId
from iot_data.alarm_${workstationId}
where shift_index != 0
AND factory_date BETWEEN #{beginTime} AND #{endTime}
and shift_time_type != 2
and shift_index > 0
order by ts desc
limit ${(pageNo - 1) * pageSize}, ${pageSize}
select code as alarmCode,
ts,
message alarmMsg,
factory_date factoryDate,
workstation_id workstationId,
shift_index shiftIndex
from iot_data.alarm_${workstationId}
where shift_index != 0
AND factory_date BETWEEN #{beginTime} AND #{endTime}
and shift_time_type != 2
and shift_index > 0
order by ts desc
limit ${(pageNo - 1) * pageSize}, ${pageSize}
select count(*)
from iot_data.alarm_${workstationId}
where shift_index != 0
AND factory_date BETWEEN #{beginTime} AND #{endTime}
and shift_time_type != 2
and shift_index > 0
select *
from iot_data.super_alarm
where workstation_id = #{workstationId}
order by ts desc
limit ${(pageNo - 1) * pageSize}, ${pageSize}
select count(ts)
from iot_data.super_alarm
where workstation_id = #{workstationId}