Commit e4e6fb28 authored by chenzhao's avatar chenzhao

修改sql问题

parent 06a2b24f
......@@ -253,17 +253,17 @@
from
(
select
rec_date as recdate,
rec_date as recDate,
station as station,
equipment_name as equipmentname,
equipment_name as equipmentName,
content as content,
warning_name as warningname,
disposotion_state as disposotionstate,
warning_name as warningName,
disposotion_state as disposotionState,
arae as arae,
'pv' as stationtype,
'pv' as stationType,
gateway_id,
concat(point_name, '异常') as pointname,
disposotion_date as disposotiondate,
concat(point_name, '异常') as pointName,
disposotion_date as disposotionDate,
(case when warning_name = '注意' then 1
when warning_name = '警告' then 2
when warning_name = '危险' then 3
......@@ -271,17 +271,17 @@
from
analysis_data.pv_warning_record union all
select
rec_date as recdate,
rec_date as recDate,
station as station,
equipment_name as equipmentname,
equipment_name as equipmentName,
content as content,
warning_name as warningname,
disposotion_state as disposotionstate,
warning_name as warningName,
disposotion_state as disposotionState,
arae as arae,
'fan' as stationtype,
'fan' as stationType,
gateway_id,
concat(point_name, '异常') as pointname,
disposotion_date as disposotiondate,
concat(point_name, '异常') as pointName,
disposotion_date as disposotionDate,
(case when warning_name = '注意' then 1
when warning_name = '警告' then 2
when warning_name = '危险' then 3
......@@ -307,13 +307,13 @@
and a.gateway_id = #{stationId}
</if>
<if test="startDate != '' and startDate != null">
and a.recdate >= concat(#{startDate}, ' 00:00:00')
and a.recDate >= concat(#{startDate}, ' 00:00:00')
</if>
<if test="endDate != '' and endDate != null">
and concat(#{endDate}, ' 23:59:59') >= a.recdate
</if>
</where>
order by sort desc, recdate desc
order by sort desc, recDate desc
limit #{current}, #{size}
</select>
......@@ -325,34 +325,34 @@
from
(
select
rec_date as recdate,
rec_date as recDate,
station as station,
equipment_name as equipmentname,
equipment_name as equipmentName,
content as content,
warning_name as warningname,
disposotion_state as disposotionstate,
warning_name as warningName,
disposotion_state as disposotionState,
arae as arae,
'pv' as stationtype,
'pv' as stationType,
gateway_id,
disposotion_date as disposotiondate
disposotion_date as disposotionDate
from
analysis_data.pv_warning_record union all
select
rec_date as recdate,
rec_date as recFate,
station as station,
equipment_name as equipmentname,
equipment_name as equipmentName,
content as content,
warning_name as warningname,
disposotion_state as disposotionstate,
warning_name as warningName,
disposotion_state as disposotionState,
arae as arae,
'fan' as stationtype,
'fan' as stationType,
gateway_id,
disposotion_date as disposotiondate
disposotion_date as disposotionDate
from
analysis_data.fan_warning_record
) a
<where>
a.disposotionstate = '未处置' or (a.disposotionstate = '已处置' and a.ts > ( now() - 3D - 8h ))
a.disposotionState = '未处置' or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h ))
<if test="arae != '' and arae != null">
and a.arae = concat(#{area}, '区域')
</if>
......@@ -360,7 +360,7 @@
and a.station = #{station}
</if>
<if test="stationType != '' and stationType != null">
and a.stationtype = #{stationType}
and a.stationType = #{stationType}
</if>
<if test="warningName != '' and warningName != null">
and a.warning_name = #{warningName}
......@@ -369,7 +369,7 @@
and a.gateway_id = #{stationId}
</if>
<if test="startDate != '' and startDate != null">
and a.recdate >= concat(#{startDate}, ' 00:00:00')
and a.recDate >= concat(#{startDate}, ' 00:00:00')
</if>
<if test="endDate != '' and endDate != null">
and concat(#{endDate}, ' 23:59:59') >= a.recdate
......@@ -482,7 +482,7 @@
)) b
<where>
<if test="stationType != '' and stationType != null">
and b.stationtype = #{stationType}
and b.stationType = #{stationType}
</if>
<if test="araeCode != '' and araeCode != null">
and b.arae = #{araeCode}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment