From e8925583e893a0d966024905afe3cddd6bfbe5d1 Mon Sep 17 00:00:00 2001 From: 张晓波 <bingbo1993@126.com> Date: 星期三, 06 十二月 2023 15:58:53 +0800 Subject: [PATCH] 广播 --- hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml | 91 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 90 insertions(+), 1 deletions(-) diff --git a/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml b/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml index f5a063c..4ab0c72 100644 --- a/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml +++ b/hd/pipe/screen/src/main/resources/mapping/BigScreenMapper.xml @@ -208,7 +208,7 @@ </select> <insert id="insertAudioGroup"> - INSERT INTO + INSERT INTO t_audio_group <trim suffix=")" prefix="(" suffixOverrides=","> <if test="id != null and id !=null"> id, @@ -237,5 +237,94 @@ select id,group_id as groupId,group_name as groupName from t_audio_groups </select> + <!--钢筋总消耗,周消耗,月消耗--> + <select id="querySteelMake" resultType="hashmap"> + select steel.steel_id,CONCAT(steel.steel_name,'-',steel_model) as steelName, + case when a.totalStock is NULL then 0 else a.totalStock end as totalStock, + case when b.weekStock is NULL then 0 else b.weekStock end as weekStock, + case when c.monthStock is NULL then 0 else c.monthStock end as monthStock + from sys_steel steel + left join + ( + select ssr.steel_id,sum(ssr.change_stock) as totalStock from sys_steel_record ssr + where ssr.stock_type = 2 + group by ssr.steel_id + ) a on steel.steel_id = a.steel_id + + left join + ( + select ssr.steel_id,sum(ssr.change_stock) as weekStock from sys_steel_record ssr + where ssr.stock_type = 2 and YEAR(SYSDATE()) = YEAR(ssr.create_time) and WEEK(sysdate(),1) = WEEK(ssr.create_time,1) + group by ssr.steel_id + ) b on steel.steel_id = b.steel_id + + left join + ( + select ssr.steel_id,sum(ssr.change_stock) as monthStock from sys_steel_record ssr + where ssr.stock_type = 2 and YEAR(SYSDATE()) = YEAR(ssr.create_time) and MONTH(SYSDATE()) = MONTH(ssr.create_time) + group by ssr.steel_id + ) c on steel.steel_id = c.steel_id + </select> + + <!--获取静养区--> + <select id="queryRestInfo" resultType="hashmap"> + select sd.device_id as deviceId,sd.device_name as deviceName,(select tem from t_rest_data trd where trd.device_id = sd.device_id order by check_time desc limit 1) as tem + from sys_device sd where sd.produce_order = '静养' + </select> + + <insert id="insertAudioFile"> + insert into t_audio_group_file + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id !=null and id !=''"> + id, + </if> + <if test="groupId !=null and groupId !=''"> + group_id, + </if> + <if test="audioFile !=null and audioFile !=''"> + audio_file, + </if> + <if test="defaults !=null"> + `defaults`, + </if> + </trim> + <trim prefix=" values (" suffix=")" suffixOverrides=","> + <if test="id !=null and id !=''"> + #{id}, + </if> + <if test="groupId !=null and groupId !=''"> + #{groupId}, + </if> + <if test="audioFile !=null and audioFile !=''"> + #{audioFile}, + </if> + <if test="defaults !=null"> + #{defaults}, + </if> + </trim> + </insert> + + <update id="updateAudioFile"> + UPDATE t_audio_group_file + <set> + <trim suffixOverrides=","> + <if test="groupId !=null and groupId !=''"> + group_id = #{groupId}, + </if> + <if test="audioFile !=null and audioFile !=''"> + audio_file = #{groupFile}, + </if> + <if test="defaults !=null"> + `defaults` = #{defaults}, + </if> + </trim> + </set> + where id = #{id} + </update> + + <delete id="deleteAudioFile"> + delete from t_audio_group_file where groupId = #{groupId} + </delete> + </mapper> \ No newline at end of file -- Gitblit v1.9.3