|
@@ -61,14 +61,7 @@
|
|
a ORDER BY a.item_name,a.create_time
|
|
a ORDER BY a.item_name,a.create_time
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getTableDataEavg" resultType="java.util.Map">
|
|
|
|
- SELECT data_value
|
|
|
|
- FROM t_raw_data${remainder}
|
|
|
|
- WHERE item_group_id = #{itemGroupId}
|
|
|
|
- AND item_name = #{itemName}
|
|
|
|
- AND data_source_id = #{dataSourceId}
|
|
|
|
- order by create_time
|
|
|
|
- LIMIT 10;
|
|
|
|
|
|
+ <select id="getTableDataEvery" resultType="java.util.Map">
|
|
SELECT
|
|
SELECT
|
|
IF
|
|
IF
|
|
(
|
|
(
|
|
@@ -135,13 +128,13 @@
|
|
LEFT JOIN ((
|
|
LEFT JOIN ((
|
|
SELECT HOUR
|
|
SELECT HOUR
|
|
( create_time ) AS data_hour,
|
|
( create_time ) AS data_hour,
|
|
- avg( data_value ) AS data_val
|
|
|
|
|
|
+ ${sqlParameter}( data_value ) AS data_val
|
|
FROM
|
|
FROM
|
|
t_raw_data${remainder}
|
|
t_raw_data${remainder}
|
|
WHERE
|
|
WHERE
|
|
item_group_id = #{itemGroupId}
|
|
item_group_id = #{itemGroupId}
|
|
- AND item_name = #{itemName}
|
|
|
|
AND data_source_id = #{dataSourceId}
|
|
AND data_source_id = #{dataSourceId}
|
|
|
|
+ AND item_name = #{itemName}
|
|
AND date_format( create_time, '%Y-%m-%d' )= date_format( now(), '%Y-%m-%d' )
|
|
AND date_format( create_time, '%Y-%m-%d' )= date_format( now(), '%Y-%m-%d' )
|
|
AND date_format( create_time, '%Y-%m-%d %H' ) <= concat( date_format( now(), '%Y-%m-%d ' ), '07' )
|
|
AND date_format( create_time, '%Y-%m-%d %H' ) <= concat( date_format( now(), '%Y-%m-%d ' ), '07' )
|
|
GROUP BY
|
|
GROUP BY
|
|
@@ -150,13 +143,13 @@
|
|
(
|
|
(
|
|
SELECT HOUR
|
|
SELECT HOUR
|
|
( create_time ),
|
|
( create_time ),
|
|
- avg( data_value )
|
|
|
|
|
|
+ ${sqlParameter}( data_value )
|
|
FROM
|
|
FROM
|
|
t_raw_data${remainder}
|
|
t_raw_data${remainder}
|
|
WHERE
|
|
WHERE
|
|
item_group_id = #{itemGroupId}
|
|
item_group_id = #{itemGroupId}
|
|
- AND item_name = #{itemName}
|
|
|
|
AND data_source_id = #{dataSourceId}
|
|
AND data_source_id = #{dataSourceId}
|
|
|
|
+ AND item_name = #{itemName}
|
|
AND date_format( create_time, '%Y-%m-%d' )= date_format( CURRENT_DATE ()- 1, '%Y-%m-%d' )
|
|
AND date_format( create_time, '%Y-%m-%d' )= date_format( CURRENT_DATE ()- 1, '%Y-%m-%d' )
|
|
AND date_format( create_time, '%Y-%m-%d %H' ) >= concat( date_format( CURRENT_DATE ()- 1, '%Y-%m-%d ' ), '08' )
|
|
AND date_format( create_time, '%Y-%m-%d %H' ) >= concat( date_format( CURRENT_DATE ()- 1, '%Y-%m-%d ' ), '08' )
|
|
GROUP BY
|
|
GROUP BY
|