From 6a9dc2c9553ae13bb3196f325c9905abbd502145 Mon Sep 17 00:00:00 2001 From: 叶松 <2217086471@qq.com> Date: 星期一, 04 十二月 2023 16:46:00 +0800 Subject: [PATCH] Merge branch 'master' of http://111.30.93.211:10101/r/supipe --- hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml b/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml index ea28f6e..a09fa2b 100644 --- a/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml +++ b/hd/pipe/materialsManage/src/main/resources/mapping/WeighMapper.xml @@ -1023,4 +1023,91 @@ <delete id="materialWarehouseRecordDel" parameterType="java.lang.String"> delete from t_su_material_warehouse_record where id=#{id} </delete> + <select id="headThingJsDateValue" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataValue"> + SELECT + DATE_FORMAT( upload_time, "%Y-%m-%d %H:00:00" ) AS uploadTime, + TRUNCATE(SUM(pm10)/count(pm10),0) as pm10, + TRUNCATE(SUM(pm25)/count(pm25),0) as pm25, + TRUNCATE(SUM(tsp)/count(tsp),0) as tsp, + TRUNCATE(SUM(temperature)/count(temperature),1) as temperature, + TRUNCATE(SUM(humidity)/count(humidity),1) as humidity, + TRUNCATE(SUM(wind_speed)/count(wind_speed),1) as windSpeed +FROM + t_data_value +WHERE + year(upload_time)=year(NOW()) AND MONTH(upload_time)=MONTH(NOW()) and DAY(upload_time)=DAY(NOW()) +-- upload_time BETWEEN "2023-11-08 00:00:00" and "2023-11-08 23:59:59" +GROUP BY + DATE_FORMAT( upload_time, "%Y-%m-%d %H:00:00" ); + </select> + <select id="headThingJsDateSmock" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataSmock"> + select + smoke_id as smokeId, + `time` as `time`, + I00 as i00, + I01 as i01, + I02 as i02, + I03 as i03, + I04 as i04, + I05 as i05, + I06 as i06, + I07 as i07, + I10 as i10, + I11 as i11, + Q00 as q00, + Q01 as q01, + Q02 as q02, + Q03 as q03, + Q04 as q04, + Q05 as q05, + VB0 as vb0, + VB10 as vb10, + VB11 as vb11, + VB12 as vb12 + from t_data_smock + order by `time` desc + limit 0,1 + </select> + <select id="headThingJsDateValueByOne" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataValue"> + select + data_id as dataId, + device_id as deviceId, + device_name as deviceName, + account_number as accountNumber, + upload_time as uploadTime, + pm25 as pm25, + pm10 as pm10, + tsp as tsp, + temperature as temperature, + humidity as humidity, + data6 as data6, + wind_speed as windSpeed, + wind_direction as windDirection, + tvoc as tvoc, + no2 as no2, + co as co, + so2 as so2, + o3 as o3, + noise as noise + from t_data_value + order by upload_time desc + limit 0,1 + </select> + <select id="headThingJsDateValueMonth" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataValue"> + SELECT + DATE_FORMAT( upload_time, "%Y-%m-%d" ) AS uploadTime, + TRUNCATE(SUM(pm10)/count(pm10),0) as pm10, + TRUNCATE(SUM(pm25)/count(pm25),0) as pm25, + TRUNCATE(SUM(tsp)/count(tsp),0) as tsp, + TRUNCATE(SUM(temperature)/count(temperature),1) as temperature, + TRUNCATE(SUM(humidity)/count(humidity),1) as humidity, + TRUNCATE(SUM(wind_speed)/count(wind_speed),1) as windSpeed +FROM + t_data_value +WHERE + year(upload_time)=year(NOW()) AND MONTH(upload_time)=MONTH(NOW()) + -- upload_time BETWEEN "2023-11-01 00:00:00" and "2023-11-30 23:59:59" +GROUP BY + DATE_FORMAT( upload_time, "%Y-%m-%d" ); + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3