c++电费管理系统_能耗管理系统

园区能源管理系统是专注于园区能耗在线监测以及能耗评估的综合能源管理系统。

一、应用背景

存在问题:

  1. 园区建筑功能构成较为复杂,用能设备多,耗能量大,监管难度高。
  2. 安全、舒适是首要考虑因素,维持这一效果需要消耗更多的能源。
  3. 商业盈利性一定程度影响管理方和消费者缺乏主动节能动力和行为节能意识。

痛点需求:

  1. 能耗浪费现象严重,存在不用白不用的观念;空调温度偏低,电梯空载运行等。
  2. 用能监管较为粗放,用能管理模式单一,难以及时发现运行中不合理用能。
  3. 缺少对重要耗能设备(如:暖通空调)运行模式与用能效率的监管和优化,能源利用效率偏低

二、解决思路

  1. 建立实时、在线的园区能耗计量监测
  2. 提供能耗统计分析和日常运行监控功能应用
  3. 建立园区能耗综合分析体系,实施科学量化管理

三、功能应用

f838c7ffd61fc00b6cdc3daf8df0ad6c.png

四、系统展示

1.能耗监测

23e612e15c04baafd96fb46e686a6b20.png

4214adb46587cb8afdbb1c4139abcf38.png

f58eba6b3019d49f4ac25509782f0aa0.png

05e6a9021a637d83cbaf69f3951bbf87.png

2.统计报表

ef1139068652e107571ebf50a09458ee.png

57e764c40ba35509e770e7a3d8dfbf34.png

2a72390fd2c305a51c242437114d257e.png

6ca69f073921aab23f920fba0e0f0436.png

4c3fc33e3771a882c87220192dc20704.png

3.费用管理

ddbf4f3fec29a4709ffce4252d838ed5.png

e44662c9b218e6009432f5d5bdb8da79.png

cb3dd7dcc3843fb107674d84e0b320ef.png

bb776d39a9e7730965906e3310dc0179.png

48fcae6b5b378747fc01daf99a32d6f9.png

4.能耗分析

db0b203697ab2b39a16e4452a48fd1d2.png

10e89dc018dfaab68cf057e1eded5e46.png

3771a394e391e0fcd5be0055c36e1943.png

5.用户管理

8df4717560fe7ac16d91d62af48b35d1.png

6.系统管理

42947f5e9073a974daa7778e768f8525.png

6f5428bed2d6e4e6d2f910a2cfa59580.png

ed59b0f2c89cb85508e674a2973ea5a9.png

67847233a57cec946be4b705c8e55bdc.png

#长乐云计算项目

1.能耗分析

#能耗统计

2b84f366f454f059d3b7fb10c6c93a3a.png

2.能耗同环比

e48406e1b9ef42d1fa7cc492e90176e9.png

3.电度查询

25f76b6a56c97307d88599b34d3edde8.png

#经营管理

1.客户电费查询

e9094db883362482449737d97cef00d1.png

2.账单设置

6a86792c954f18eb2c26a331a80ad4a1.png

3.

84740305276c116dfffaf04d879bc819.png

五、部分SQL代码

#部门能耗统计报表

按部门查看

#按部门查看
SELECT	* FROM(
SELECT
CASEFNO WHEN '008' THEN '-1' ELSE FPID END AS FPID,FGUID AS FID,FNAME AS FNAME,FNO AS FI1,FNO AS FVALUE,'FNO' AS Field,
CASEWHEN FNO LIKE '008______' THEN 0 ELSE 1 END AS FSHOW,'eq' AS FOPTYPE 
FROMb_dcm_bbjcswh 
WHEREFNO LIKE '008%' AND FNAME NOT LIKE 'UPS%' ) A 
ORDER BY
FI1

部门能耗统计报表(H)

SELECT*
FROM(SELECTb.FEID,c.FNO,c.FENAME,b.fd3,d.FC3,SUM(b.FM1) + SUM(b.FM2) + SUM(b.FM3) + SUM(b.FM4) + SUM(b.FM5) +SUM(b.FM6) + SUM(b.FM7) + SUM(b.FM8) + SUM(b.FM9) + SUM(b.FM10) + SUM(b.FM11) + SUM(b.FM12) + SUM(b.FM13) + SUM(b.FM14) + SUM(b.FM15) + SUM(b.FM16) + SUM(b.FM17) + SUM(b.FM18) + SUM(b.FM19) + SUM(b.FM20) + SUM(b.FM21) + SUM(b.FM22) + SUM(b.FM23) + SUM(b.FM24) AS FZJ,'0' AS FDELETED,SUM(b.FM1) AS fm1,SUM(b.FM2) AS fm2,SUM(b.FM3) AS fm3,SUM(b.FM4) AS fm4,SUM(b.FM5) AS fm5,SUM(b.FM6) AS fm6,SUM(b.FM7) AS fm7,SUM(b.FM8) AS fm8,SUM(b.FM9) AS fm9,SUM(b.FM10) AS fm10,SUM(b.FM11) AS fm11,SUM(b.FM12) AS fm12,SUM(b.FM13) AS fm13,SUM(b.FM14) AS fm14,SUM(b.FM15) AS fm15,SUM(b.FM16) AS fm16,SUM(b.FM17) AS fm17,SUM(b.FM18) AS fm18,SUM(b.FM19) AS fm19,SUM(b.FM20) AS fm20,SUM(b.FM21) AS fm21,SUM(b.FM22) AS fm22,SUM(b.FM23) AS fm23,SUM(b.FM24) AS fm24FROM(SELECTfguid,a.FEID,a.time,fwritetime,a.fd3,(CASE a.time WHEN '00' THEN FM1 ELSE 0END) FM1,(CASE a.time WHEN '01' THEN FM1 ELSE 0END
) FM2,
(CASE a.time WHEN '02' THEN FM1 ELSE 0
END
) FM3,
(CASE a.time WHEN '03' THEN FM1 ELSE 0
END
) FM4,
(CASE a.time WHEN '04' THEN FM1 ELSE 0
END
) FM5,
(CASE a.time WHEN '05' THEN FM1 ELSE 0
END
) FM6,
(CASE a.time WHEN '06' THEN FM1 ELSE 0
END
) FM7,
(CASE a.time WHEN '07' THEN FM1 ELSE 0
END
) FM8,
(CASE a.time WHEN '08' THEN FM1 ELSE 0
END
) FM9,
(CASE a.time WHEN '09' THEN FM1 ELSE 0
END
) FM10,
(CASE a.time WHEN '10' THEN FM1 ELSE 0
END
) FM11,
(CASE a.time WHEN '11' THEN FM1 ELSE 0
END
) FM12,
(CASE a.time WHEN '12' THEN FM1 ELSE 0
END
) FM13,
(CASE a.time WHEN '13' THEN FM1 ELSE 0
END
) FM14,
(CASE a.time WHEN '14' THEN FM1 ELSE 0
END
) FM15,
(CASE a.time WHEN '15' THEN FM1 ELSE 0
END
) FM16,
(CASE a.time WHEN '16' THEN FM1 ELSE 0
END
) FM17,
(CASE a.time WHEN '17' THEN FM1 ELSE 0
END
) FM18,
(CASE a.time WHEN '18' THEN FM1 ELSE 0
END
) FM19,
(CASE a.time WHEN '19' THEN FM1 ELSE 0
END
) FM20,
(CASE a.time WHEN '20' THEN FM1 ELSE 0
END
) FM21,
(CASE a.time WHEN '21' THEN FM1 ELSE 0
END
) FM22,
(CASE a.time WHEN '22' THEN FM1 ELSE 0
END
) FM23,
(CASE a.time WHEN '23' THEN FM1 ELSE 0
END
) FM24
FROM(SELECTfguid,FEID,FM1,DATE_FORMAT(FWRITETIME, '%Y-%m-%d') AS fd3,DATE_FORMAT(FWRITETIME, '%H') AS TIME,fwritetimeFROM(SELECT CASE WHENFEID = 01280001 THEN '1240099'END AS FEID,FWRITETIME,FM1 * 0.4 AS FM1,FGUID
FROMd_nhgl_runloghour
WHEREFEID = 01280001
UNION ALL
SELECT CASE WHENFEID = 01280001 THEN '1240098'
END AS FEID,
FWRITETIME,
FM1 * 0.5 AS FM1,
FGUID
FROMd_nhgl_runloghour
WHEREFEID = 01280001
UNION ALL
SELECT CASE WHENFEID = 01280001 THEN '1240097'
END AS FEID,
FWRITETIME,
FM1 * 0.6 AS FM1,
FGUID
FROMd_nhgl_runloghour
WHEREFEID = 01280001
) f
) a
) b,
b_dcm_bbjcswhc c
JOIN b_dcm_bbjcswh d ONc.FC11 = d.FGUID
WHEREc.FEID = b.FEID AND c.FNO LIKE '008%'
GROUP BYb.FEID,b.fd3
) e
ORDER BYe.fd3
DESC,e.feid

部门能耗统计报表(D)

SELECT*
FROM(SELECTb.FEID,c.FNO,c.fc3,c.FENAME,c.FLX,b.fd3,SUM(b.FM1) + SUM(b.FM2) + SUM(b.FM3) + SUM(b.FM4) + SUM(b.FM5) + SUM(b.FM6) + SUM(b.FM7) + SUM(b.FM8) + SUM(b.FM9) + SUM(b.FM10) + SUM(b.FM11) + SUM(b.FM12) +SUM(b.FM13) + SUM(b.FM14) + SUM(b.FM15) + SUM(b.FM16) + SUM(b.FM17) + SUM(b.FM18) +SUM(b.FM19) + SUM(b.FM20) + SUM(b.FM21) + SUM(b.FM22) + SUM(b.FM23) + SUM(b.FM24) + SUM(b.FM25) + SUM(b.FM26) + SUM(b.FM27) + SUM(b.FM28) + SUM(b.FM29) + SUM(b.FM30) + SUM(b.FM31) AS FZJ,'0' AS FDELETED,SUM(b.FM1) AS fm1,SUM(b.FM2) AS fm2,SUM(b.FM3) AS fm3,SUM(b.FM4) AS fm4,SUM(b.FM5) AS fm5,SUM(b.FM6) AS fm6,SUM(b.FM7) AS fm7,SUM(b.FM8) AS fm8,SUM(b.FM9) AS fm9,SUM(b.FM10) AS fm10,SUM(b.FM11) AS fm11,SUM(b.FM12) AS fm12,SUM(b.FM13) AS fm13,SUM(b.FM14) AS fm14,SUM(b.FM15) AS fm15,SUM(b.FM16) AS fm16,SUM(b.FM17) AS fm17,SUM(b.FM18) AS fm18,SUM(b.FM19) AS fm19,SUM(b.FM20) AS fm20,SUM(b.FM21) AS fm21,SUM(b.FM22) AS fm22,SUM(b.FM23) AS fm23,SUM(b.FM24) AS fm24,SUM(b.FM25) AS fm25,SUM(b.FM26) AS fm26,SUM(b.FM27) AS fm27,SUM(b.FM28) AS fm28,SUM(b.FM29) AS fm29,SUM(b.FM30) AS fm30,SUM(b.FM31) AS fm31FROM(SELECTfguid,a.FEID,a.time,fwritetime,a.fd3,(CASE a.time WHEN '31' THEN FM1 ELSE 0END) FM31,(CASE a.time WHEN '1' THEN FM1 ELSE 0END
) FM1,
(CASE a.time WHEN '2' THEN FM1 ELSE 0
END
) FM2,
(CASE a.time WHEN '3' THEN FM1 ELSE 0
END
) FM3,
(CASE a.time WHEN '4' THEN FM1 ELSE 0
END
) FM4,
(CASE a.time WHEN '5' THEN FM1 ELSE 0
END
) FM5,
(CASE a.time WHEN '6' THEN FM1 ELSE 0
END
) FM6,
(CASE a.time WHEN '7' THEN FM1 ELSE 0
END
) FM7,
(CASE a.time WHEN '8' THEN FM1 ELSE 0
END
) FM8,
(CASE a.time WHEN '9' THEN FM1 ELSE 0
END
) FM9,
(CASE a.time WHEN '10' THEN FM1 ELSE 0
END
) FM10,
(CASE a.time WHEN '11' THEN FM1 ELSE 0
END
) FM11,
(CASE a.time WHEN '12' THEN FM1 ELSE 0
END
) FM12,
(CASE a.time WHEN '13' THEN FM1 ELSE 0
END
) FM13,
(CASE a.time WHEN '14' THEN FM1 ELSE 0
END
) FM14,
(CASE a.time WHEN '15' THEN FM1 ELSE 0
END
) FM15,
(CASE a.time WHEN '16' THEN FM1 ELSE 0
END
) FM16,
(CASE a.time WHEN '17' THEN FM1 ELSE 0
END
) FM17,
(CASE a.time WHEN '18' THEN FM1 ELSE 0
END
) FM18,
(CASE a.time WHEN '19' THEN FM1 ELSE 0
END
) FM19,
(CASE a.time WHEN '20' THEN FM1 ELSE 0
END
) FM20,
(CASE a.time WHEN '21' THEN FM1 ELSE 0
END
) FM21,
(CASE a.time WHEN '22' THEN FM1 ELSE 0
END
) FM22,
(CASE a.time WHEN '23' THEN FM1 ELSE 0
END
) FM23,
(CASE a.time WHEN '24' THEN FM1 ELSE 0
END
) FM24,
(CASE a.time WHEN '25' THEN FM1 ELSE 0
END
) FM25,
(CASE a.time WHEN '26' THEN FM1 ELSE 0
END
) FM26,
(CASE a.time WHEN '27' THEN FM1 ELSE 0
END
) FM27,
(CASE a.time WHEN '28' THEN FM1 ELSE 0
END
) FM28,
(CASE a.time WHEN '29' THEN FM1 ELSE 0
END
) FM29,
(CASE a.time WHEN '30' THEN FM1 ELSE 0
END
) FM30
FROM(SELECTFGUID,FEID,FM1,DATE_FORMAT(FWRITETIME, '%Y-%m') AS fd3,DATE_FORMAT(FWRITETIME, '%d') AS TIME,FWRITETIMEFROM(SELECT CASE WHENFEID = 01280001 THEN '1240099'END AS FEID,FWRITETIME,FM1 * 0.4 AS FM1,FGUID
FROMd_nhgl_runloghour
WHEREFEID = 01280001
UNION ALL
SELECT CASE WHENFEID = 01280001 THEN '1240098'
END AS FEID,
FWRITETIME,
FM1 * 0.5 AS FM1,
FGUID
FROMd_nhgl_runloghour
WHEREFEID = 01280001
UNION ALL
SELECT CASE WHENFEID = 01280001 THEN '1240097'
END AS FEID,
FWRITETIME,
FM1 * 0.6 AS FM1,
FGUID
FROMd_nhgl_runloghour
WHEREFEID = 01280001
) f
) a
) b,
b_dcm_bbjcswhc c
JOIN b_dcm_bbjcswh d ONc.FC11 = d.FGUID
WHEREc.FEID = b.FEID AND c.FNO LIKE '008%'
GROUP BYb.FEID,b.fd3
) e
ORDER BYe.fd3
DESC

#能耗同环比

SELECTFEID,FENAME,FNO, FD1, FD3,FD2, FM1,FORMAT(0.7979 * FM1, 2) AS Zhtpf,FORMAT(0.1229 * FM1, 2) AS Zhbzm,FM2, FD4,FM2 - FM1 AS Hbzzl,FORMAT((FM1 - FM2) / FM1,2) AS FM4,FM3, FD5,FM3 - FM1 AS Tbzzl,FORMAT((FM3 - FM1) / FM3,2) AS FM5
FROM(SELECTa.FEID,a.FENAME,a.FNO,DATE_FORMAT(a.FWRITETIME, '%Y-%m') AS FD3,DATE_FORMAT(a.FWRITETIME, '%m') AS FD1,DATE_FORMAT(a.FWRITETIME, '%Y') AS FD2,DATE_FORMAT(c.FWRITETIME, '%Y-%m') AS FD4,DATE_FORMAT(d.FWRITETIME, '%Y-%m') AS FD5,(b.FM1 - a.FM1) AS FM1,(a.FM1 - c.FM1) AS FM2,(e.FM1 - d.FM1) AS FM3FROM(SELECTa.feid,g.FENAME,g.FNO,a.fwritetime,a.fm1,a.fguidFROM`d_nhgl_test` a,b_dcm_bbjcswhc gJOIN b_dcm_bbjcswh f ONg.FC11 = f.FGUIDWHEREa.feid = g.feid) a
JOIN d_nhgl_test b ONa.feid = b.feid AND a.FWRITETIME = DATE_SUB(b.FWRITETIME,INTERVAL 1 MONTH)
JOIN d_nhgl_test c ONa.feid = c.feid AND a.FWRITETIME = DATE_ADD(c.FWRITETIME,INTERVAL 1 MONTH)
JOIN d_nhgl_test d ONa.feid = d.feid AND a.FWRITETIME = DATE_ADD(d.FWRITETIME,INTERVAL 12 MONTH)
JOIN d_nhgl_test e ONa.feid = e.feid AND a.FWRITETIME = DATE_ADD(e.FWRITETIME,INTERVAL 11 MONTH)
) F

#部门费用统计

按部门查看

SELECT*
FROM(SELECTCASE FNO WHEN '008' THEN '-1'ELSE FPID END AS FPID,FGUID AS FID,FNAME AS FNAME,FNO AS FI1,FNO AS FVALUE,'FNO' AS Field,CASE WHEN  FNO LIKE '008______' THEN 0 ELSE 1 END  AS FSHOW,'eq' AS FOPTYPEFROMb_dcm_bbjcswhWHEREFNO LIKE '008%' ) A ORDER BY FI1

部门费用统计报表

SELECT FEID,FNO,FENAME,FD3,FC3,0.9*FZJ AS FYY,FDELETED FROM (SELECTb.FEID,c.FNO,c.FENAME,b.fd3,d.FC3,SUM(b.FM1) + SUM(b.FM2) + SUM(b.FM3) + SUM(b.FM4) + SUM(b.FM5) + SUM(b.FM6) + SUM(b.FM7) + SUM(b.FM8) + SUM(b.FM9) + SUM(b.FM10) + SUM(b.FM11) + SUM(b.FM12) + SUM(b.FM13) + SUM(b.FM14) + SUM(b.FM15) + SUM(b.FM16) + SUM(b.FM17) + SUM(b.FM18) + SUM(b.FM19) + SUM(b.FM20) + SUM(b.FM21) + SUM(b.FM22) + SUM(b.FM23) + SUM(b.FM24) AS FZJ,'0' AS FDELETED,SUM(b.FM1) AS fm1,SUM(b.FM2) AS fm2,SUM(b.FM3) AS fm3,SUM(b.FM4) AS fm4,SUM(b.FM5) AS fm5,SUM(b.FM6) AS fm6,SUM(b.FM7) AS fm7,SUM(b.FM8) AS fm8,SUM(b.FM9) AS fm9,SUM(b.FM10) AS fm10,SUM(b.FM11) AS fm11,SUM(b.FM12) AS fm12,SUM(b.FM13) AS fm13,SUM(b.FM14) AS fm14,SUM(b.FM15) AS fm15,SUM(b.FM16) AS fm16,SUM(b.FM17) AS fm17,SUM(b.FM18) AS fm18,SUM(b.FM19) AS fm19,SUM(b.FM20) AS fm20,SUM(b.FM21) AS fm21,SUM(b.FM22) AS fm22,SUM(b.FM23) AS fm23,SUM(b.FM24) AS fm24
FROM(SELECTfguid,a.FEID,a.time,fwritetime,a.fd3,(CASE a.time WHEN '00' THEN FM1 ELSE 0END
) FM1,
(CASE a.time WHEN '01' THEN FM1 ELSE 0
END
) FM2,
(CASE a.time WHEN '02' THEN FM1 ELSE 0
END
) FM3,
(CASE a.time WHEN '03' THEN FM1 ELSE 0
END
) FM4,
(CASE a.time WHEN '04' THEN FM1 ELSE 0
END
) FM5,
(CASE a.time WHEN '05' THEN FM1 ELSE 0
END
) FM6,
(CASE a.time WHEN '06' THEN FM1 ELSE 0
END
) FM7,
(CASE a.time WHEN '07' THEN FM1 ELSE 0
END
) FM8,
(CASE a.time WHEN '08' THEN FM1 ELSE 0
END
) FM9,
(CASE a.time WHEN '09' THEN FM1 ELSE 0
END
) FM10,
(CASE a.time WHEN '10' THEN FM1 ELSE 0
END
) FM11,
(CASE a.time WHEN '11' THEN FM1 ELSE 0
END
) FM12,
(CASE a.time WHEN '12' THEN FM1 ELSE 0
END
) FM13,
(CASE a.time WHEN '13' THEN FM1 ELSE 0
END
) FM14,
(CASE a.time WHEN '14' THEN FM1 ELSE 0
END
) FM15,
(CASE a.time WHEN '15' THEN FM1 ELSE 0
END
) FM16,
(CASE a.time WHEN '16' THEN FM1 ELSE 0
END
) FM17,
(CASE a.time WHEN '17' THEN FM1 ELSE 0
END
) FM18,
(CASE a.time WHEN '18' THEN FM1 ELSE 0
END
) FM19,
(CASE a.time WHEN '19' THEN FM1 ELSE 0
END
) FM20,
(CASE a.time WHEN '20' THEN FM1 ELSE 0
END
) FM21,
(CASE a.time WHEN '21' THEN FM1 ELSE 0
END
) FM22,
(CASE a.time WHEN '22' THEN FM1 ELSE 0
END
) FM23,
(CASE a.time WHEN '23' THEN FM1 ELSE 0
END
) FM24
FROM(SELECTfguid,FEID,FM1,DATE_FORMAT(FWRITETIME, '%Y-%m-%d') AS fd3,DATE_FORMAT(FWRITETIME, '%H') AS TIME,fwritetimeFROM(SELECT CASE WHEN FEID = 01280001 THEN '1240099' END AS FEID,FWRITETIME, FM1*0.4 AS FM1,FGUID FROM d_nhgl_runloghour WHERE FEID=01280001
UNION ALL
SELECT CASE WHEN FEID =01280001 THEN '1240098' END AS FEID,FWRITETIME, FM1*0.5 AS FM1,FGUID FROM d_nhgl_runloghour WHERE FEID=01280001
UNION ALL
SELECT CASE WHEN FEID =01280001 THEN '1240097' END AS FEID,FWRITETIME, FM1*0.6 AS FM1,FGUID FROM d_nhgl_runloghour WHERE FEID=01280001)f) a
) b
,b_dcm_bbjcswhc c JOIN b_dcm_bbjcswh d ON c.FC11=d.FGUID
WHEREc.FEID = b.FEID   AND c.FNO LIKE '008%' 
GROUP BYb.FEID,b.fd3)e ORDER BY e.fd3 desc ,e.feid

账单查询

SELECTa.FEID,a.FENAME,FKH,FKNAME,CONCAT(a.fwritetime, '~', b.FWRITETIME) AS FDATE,ROUND(a.fm1 + 0.3 * b.FM1) AS FZFY,ROUND(a.fm1) AS FM1,ROUND(a.fm1) AS FDF,ROUND(0.6 * a.fm1) AS FM2,ROUND(0.3 * a.FM1) AS FSF,ROUND(a.fm1) AS FGTM1,ROUND(a.fm1) AS FGTDF,ROUND(0.6 * a.fm1) AS FGTM2,ROUND(0.3 * a.FM1) AS FGTSF,2 * ROUND(a.fm1) AS FHHM1,2 * ROUND(a.fm1) AS FHJDF,2 * ROUND(0.6 * a.fm1) AS FHJM2,2 * ROUND(0.3 * a.FM1) AS FHJSF,DATE_ADD(a.FWRITETIME,INTERVAL(d.FC6 - d.FC4) DAY) AS FZHJN,DATE_ADD(b.FWRITETIME, INTERVAL 1 DAY) AS FZD
FROM(SELECTa.feid,g.FENAME,g.FNO,g.FKNAME,g.FKH,DATE_FORMAT(a.FWRITETIME, '%Y-%m-%d') AS fwritetime,a.fm1,a.fguidFROM`d_nhgl_runlogday` a,b_dcm_bbjcswhc gJOIN b_dcm_bbjcswh f ONg.FC11 = f.FGUID AND g.FNO LIKE '004%'WHEREa.feid = g.feid
) a
JOIN(SELECTfeid,FM1,DATE_FORMAT(FWRITETIME, '%Y-%m-%d') AS FWRITETIMEFROMd_nhgl_runlogday
) b
ONa.feid = b.feid AND a.FWRITETIME = DATE_ADD((DATE_SUB(b.FWRITETIME,INTERVAL 1 MONTH)),INTERVAL 1 DAY)
JOIN(
SELECT*
FROMd_nhgl_zdsz
) d
ONDATE_FORMAT(a.FWRITETIME, '%d') = FC1

账单存储过程

CREATE PROCEDURE billsave()
BEGININSERT INTO f_nhgl_zdcc
SELECTa.FEID, a.FENAME, FKH, FKNAME, CONCAT(a.fwritetime, '~', b.FWRITETIME) AS FDATE,ROUND(a.fm1 + 0.3 * b.FM1) AS FZFY,ROUND(a.fm1) AS FM1,ROUND(a.fm1) AS FDF,ROUND(0.6 * a.fm1) AS FM2,ROUND(0.3 * a.FM1) AS FSF,ROUND(a.fm1) AS FGTM1,ROUND(a.fm1) AS FGTDF,ROUND(0.6 * a.fm1) AS FGTM2,ROUND(0.3 * a.FM1) AS FGTSF,2 * ROUND(a.fm1) AS FHHM1,2 * ROUND(a.fm1) AS FHJDF,2 * ROUND(0.6 * a.fm1) AS FHJM2,2 * ROUND(0.3 * a.FM1) AS FHJSF,DATE_ADD(a.FWRITETIME,INTERVAL(d.FC6 - d.FC4) DAY) AS FZHJN,DATE_ADD(b.FWRITETIME, INTERVAL 1 DAY) AS FZD
FROM(SELECTa.feid,g.FENAME,g.FNO,g.FKNAME,g.FKH,DATE_FORMAT(a.FWRITETIME, '%Y-%m-%d') AS fwritetime,a.fm1,a.fguidFROM`d_nhgl_runlogday` a,b_dcm_bbjcswhc gJOIN b_dcm_bbjcswh f ONg.FC11 = f.FGUID AND g.FNO LIKE '004%'WHEREa.feid = g.feid
) a
JOIN(SELECTfeid,FM1,DATE_FORMAT(FWRITETIME, '%Y-%m-%d') AS FWRITETIMEFROMd_nhgl_runlogday
) b
ONa.feid = b.feid AND a.FWRITETIME = DATE_ADD((DATE_SUB(b.FWRITETIME,INTERVAL 1 MONTH)),INTERVAL 1 DAY)
JOIN(
SELECT*
FROMd_nhgl_zdsz
) d
ONDATE_FORMAT(a.FWRITETIME, '%d') = FC1;
END

账单存储过程触发器

*/创建mysql的定时器event:*/
create event if not exists eventJob 
on schedule every 1 second 
on completion PRESERVE
do call billsave2;

账单存储过程定时器

至此所有的准备工作已经写完了,做完这些,mysql要想利用定时器必须的做准备工作,就是把mysql的定时器给开启了:
SET GLOBAL event_scheduler = 1;  -- 启动定时器
SET GLOBAL event_scheduler = 0;  -- 停止定时器

账单存储过程事件启动

紧接着还要开启事件:
ALTER EVENT eventJob ON  COMPLETION PRESERVE ENABLE;   -- 开启事件
ALTER EVENT eventJob ON  COMPLETION PRESERVE DISABLE;  -- 关闭事件

每月几号定时启动

CREATE DEFINER = `gzy`@`%` EVENT `delLastMonth` ON SCHEDULE EVERY1 MONTH STARTS '2016-08-01 00:00:05'
ON COMPLETION NOT PRESERVE ENABLE
DO
CALLdelLastMonth

#系统管理

采集设备维护

SELECT'3ec955d5-e9d1-11e8-bd99-005056ba54a4' AS FID,-1 AS FPID,'设备类型' AS FNAME,'设备类型' AS FVLAUE,'FC5' AS FIELD,0 AS MCHOICE
UNION ALL
SELECTUUID() AS FID, '3ec955d5-e9d1-11e8-bd99-005056ba54a4' AS FPID, A.optionValue AS FNAME, A.optionName AS FVLAUE, 'FC5' AS FIELD,1 AS MCHOICE
FROM(SELECToptionName,optionValueFROMsys_enumsWHEREgroupName = '设备类型'
) A
UNION ALL
SELECT'f3e7b5eb-e9d6-11e8-bd99-005056ba54a4' AS FID,-1 AS FPID,'型号规格' AS FNAME,'型号规格' AS FVLAUE,'FXHGG' AS FIELD,0 AS MCHOICE
UNION ALL
SELECTUUID() AS FID, 'f3e7b5eb-e9d6-11e8-bd99-005056ba54a4' AS FPID, B.optionValue AS FNAME, B.optionName AS FVLAUE, 'FXHGG' AS FIELD,0 AS MCHOICE
FROM(SELECToptionName,optionValueFROMsys_enumsWHEREgroupName = '型号规格'
) B
UNION ALL
SELECT'6b8cd459-e9d8-11e8-bd99-005056ba54a4' AS FID,-1 AS FPID,'安装区域' AS FNAME,'安装区域' AS FVLAUE,'FAZQY' AS FIELD,0 AS MCHOICE
UNION ALL
SELECTUUID() AS FID, '6b8cd459-e9d8-11e8-bd99-005056ba54a4' AS FPID, C.optionValue AS FNAME, C.optionName AS FVLAUE, 'FAZQY' AS FIELD,0 AS MCHOICE 
FROM(SELECToptionName,optionValueFROMsys_enums WHEREgroupName = '安装区域' 
) C ORDER BY FVLAUE

六、解决方案PPT

83db9510bc16d91bfc6a81faf2a6f44a.png

12e1e8c93c126b6f6d7f3f221e0a4ed5.png

00736eed6831fd4c6ea78e699b5a9bc3.png

ad92ef98c21dd3ec333e872e455453a4.png

05e9729ba8543ff8ef79863e5eea33b7.png

14aca206244152aa683e83c7130ec792.png

feaed05876a15b3e23639bb03fbb5cec.png

6ed06b1a03f8501dd459620a14af9b18.png

cd5944445ddd04974dc9833c708a0929.png

c1f16965255d143d61cf29900a30fb8a.png

edec17010609a6961e0e098349b97f42.png

e938a01f36bf546d9d5a3c1531d50bfd.png

8d6be6bd7e7cd367acd9039e913789d3.png

750683d37dc36e81e0615a278acc5c0d.png

4fbaf35723661836c506e75146437fe4.png

902d8d252788a37ff5a0a845aace7719.png

1e4ddf0691ff9294461a3dc7e726b45d.png

b2a74e2fe84b72980b48e4e1527ba97a.png

c78d4091ec806afc7809fa13651b2cb6.png

c399e9954da8bcf6d98c91740aed155c.png

342e7192761e59140e6c8d2e14a18d42.png

ce365993519742fee43dc569b60da431.png

b5dc342386ed90f8dfd179489375ca72.png

0da635617bd2f9890a765dd900825435.png

2ea8567314189a5885f8732d96a5dc4e.png

ab8415e0d4150fc12134792c037f7397.png

3d72d7f98de7f0645ee20861a0b0029e.png

6f64626058248c66a2066b0951bdfaf8.png

b30660a6a888aae5c4e7a0bab63f173a.png

197394d6f7e720eb368c21619c838764.png

fa03fb104e2f23e76d0d53c4ff3d2ce6.png

eac292eb2ccaf1cdf9037bfaca713716.png

70d240372edb69b0bf428e8936bebb4b.png

52515504ec8307f16d8d165d7b75acb5.png

8217418e742a343dadf4bc390584ab39.png

fb92ecf81fe173fa457118f7910cbad1.png

7d5b1630b5274c4ed0587b7bd0265b10.png

e9cc2e85d161288c28fb321cfd3b5e27.png

bf64fe8f799ba87cb70ee6962b1bdc91.png

aa4ed2d46f4e1a670fca55ec5fefa38d.png

651d6840616d72ed1a28f17012f69c78.png

3109e3a51b91e74ea42ee99d43abfd18.png

ce53467763d24b8bab799979eac59abb.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/419882.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

泰拉瑞亚服务器怎么让玩家注册,上线10年,《泰拉瑞亚》为何变成了一款交友游戏?...

《泰拉瑞亚》这款游戏,最初于2011年5月16日在PC上发行,之后也陆续登录安卓和苹果手机端,如今已走过了十个年头。也许对于《泰拉瑞亚》部分人并不是很熟悉,但提起《我的世界》,相信大部分游戏爱好者都会有共同话题。而《泰拉瑞亚》就是被玩家戏称为横版的Minecraft,因为游戏给玩…

【链表+启发式合并】Bzoj1483 [HNOI2009] 梦幻布丁

Description N个布丁摆成一行,进行M次操作.每次将某个颜色的布丁全部变成另一种颜色的,然后再询问当前一共有多少段颜色.例如颜色分别为1,2,2,1的四个布丁一共有3段颜色. Input 第一行给出N,M表示布丁的个数和好友的操作次数. 第二行N个数A1,A2...An表示第i个布丁的颜色从第三行…

小程序秒杀活动服务器,微信小程序官方上线张大仙周年活动,人数太多把服务器弄崩溃了...

原标题:微信小程序官方上线张大仙周年活动,人数太多把服务器弄崩溃了说起如今人气最旺的《王者荣耀》主播,莫过于就是靠着一手“素质直播”走遍天下的张大仙了。之前由于一些合同上面的问题,张大仙被迫停播了一段时间,…

curl 怎么在xp下使用_Http Post 快速使用

点击上方蓝字可直接关注!方便下次阅读。如果对你有帮助,麻烦点个在看或点个赞,感谢~一直对http很陌生,这次借助libcurl分享一个快速使用http post的案例。平台:ubuntu16.04一、libcurl的安装1. Git上下载 master最新代…

ajax 高并发请求,理解node.js处理高并发请求原理

很少分享技术文章,写的不好的地方请大家多多指教,本文是自己对于node.js的一些见解,如有纰漏请在评论区交流。高并发策略通常高并发的解决方案就是提供多线程模型,服务器为每个客户端请求分配一个线程,使用同步 I/O&am…

abaqus生成adams柔性体_基于ADAMS 的大型反铲挖泥机加装破碎锤 结构动力学分析

刘 斌 徐沪萍 王 磊武汉理工大学物流工程学院 武汉 430063摘 要:以配备液压破碎锤的反铲挖泥船反铲挖泥机为研究对象,简单介绍加装液压破碎锤方案,然后运用动力学理论和相关的动态仿真软件,通过建立反铲挖泥机的刚柔耦合模型&…

rust加载不进去服务器eac_基于腾讯云的 Rust 和 WebAssembly 函数即服务

腾讯云云函数 (SCF) 已经支持十多种编程语言和运行时框架。腾讯云最近发布的 SCF custom runtime(自定义运行时)更进一步 —— SCF 现在可以支持用任何编程语言编写的函数。本文将介绍如何在云函数 SCF 中运行用 Rust 编写的 WebAssembly 函数。我们先介…

ceb怎么转换成word_PDF怎么转换成Word?分享免费转换技巧!

PDF怎么转换成Word?pdf格式无法编辑众所周知的事,但如果我们需要将其进行编辑使用的话,就需要将pdf格式转换成word格式。可是怎么将pdf转换成word一直是件令人头疼的事!所以今天小编给大家分享几个pdf转word免费转换技巧&#xff…

[FZYZOJ 1038] 隧道

P1038 -- 隧道 时间限制:1000MS 内存限制:65536KB Description 一座小镇正在着手建造自己的地铁线路网。小镇坐落在许多小岛上,小岛之间通过隧道或者桥梁连接。地铁就在这些已有的桥梁和隧道的基础上建成。由于地铁主要是在地下&#xf…

7极限精简版64位_DNF:国服更新64位客户端深度体验,真的有如此丝滑吗?

DNF最新最快资讯,最全最细攻略,尽在骑乌龟的蜗牛12年,地下城的游戏客户端终于获得了升级,从32位更新到了64位,关于更新带来的游戏好处大家应该都在很多地方看过,而国服正式服也终于在8.20版本的更新中将客户…

隐藏a标签seo_让黑帽都惊了,远离百度惩处的seo技术

一、什么是黑帽SEO黑帽SEO,即SEO作弊,是指为了提高网站在搜索引擎中展现机会和排名的目的,欺骗搜索引擎的行为“黑帽”技术与搜索引擎算法相排斥,是搜索引擎不允许的。一旦被发现使用“黑帽”技术,那么网站排名会被降低…

前端学习(1501):一次帮别人解决问题的案例

超开心 只能添加姓名 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>Document</title> </…

mysql 加字段_MySQL8.0大表秒加字段,是真的吗?

前言&#xff1a;很早就听说 MySQL8.0 支持快速加列&#xff0c;可以实现大表秒级加字段。笔者自己本地也有8.0环境&#xff0c;但一直未进行测试。本篇文章我们就一起来看下 MySQL8.0 快速加列到底要如何操作。1.了解背景信息表结构的变更是业务运行过程中比较常见的需求之一&…

SQLServer学习笔记系列4

一.写在前面的话 好多天没有记录sql学习笔记了&#xff0c;要坚持下去&#xff0c;坚信每一点的进步都是为在积蓄力量。今天看到一幅图&#xff0c;特此分享出来。 通过这幅图&#xff0c;我看到的是每人站在自己的角度看问题&#xff0c;感受是不一样的&#xff0c;就如同学习…

随便选一张扑克牌_扑克牌魔术手法教学,简单易学的纸牌魔术,三分钟让你成为大师...

标签&#xff1a; 魔术手法 扑克牌魔术 魔术技巧教学 纸牌魔术揭秘所有的纸牌魔术家都知道怎样假装把一张牌塞进牌堆&#xff0c;然后从顶部翻出来来让观众吃惊。这个技巧用来练习手速、手指灵敏度、适时分散观众注意力和表演艺术绝对是不可或缺。这里就给大家介绍一下吧&#…

Android项目使用Eclipse进行单元测试

Android项目如果每次都整个调试的话&#xff0c;要加载UI&#xff0c;会等很长时间。所以单元测试就显得很方便了。 要进行单元测试&#xff0c;首先得修改下AndroidManifest.xml文件。在Instrument标签里点右侧的Add按钮。然后在弹出的窗口双击 Instrument。然后在右侧就会多出…