異常類別中文:alarmClass_zh 欄位增加

This commit is contained in:
cesar liu 2022-08-22 10:56:29 +08:00
parent 8db4bcec53
commit 3e9130bbf4
2 changed files with 4 additions and 4 deletions

View File

@ -375,7 +375,7 @@ namespace SolarPower.Repository.Implement
// WHERE a.sourceState = @Status AND ps.Id = @PowerStationId "; // WHERE a.sourceState = @Status AND ps.Id = @PowerStationId ";
var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time ,
a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime,
a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw, a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw,
case when c.errMsg_tw is null then case when c.errMsg_tw is null then
case when err_valueKind = 'b' then d.errMsg_tw case when err_valueKind = 'b' then d.errMsg_tw
when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2)) when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2))
@ -441,7 +441,7 @@ namespace SolarPower.Repository.Implement
DateTime end; DateTime end;
var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, ps.Id PowerStationId, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, ps.Id PowerStationId, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time ,
a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime,
a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw, a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw,
case when c.errMsg_tw is null then case when c.errMsg_tw is null then
case when err_valueKind = 'b' then d.errMsg_tw case when err_valueKind = 'b' then d.errMsg_tw
when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2)) when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2))
@ -837,7 +837,7 @@ namespace SolarPower.Repository.Implement
select pr.FormId as FormId, pr.Id as ErrorID, priority, a.id, site_id, `timestamp`, a.sourceState, select pr.FormId as FormId, pr.Id as ErrorID, priority, a.id, site_id, `timestamp`, a.sourceState,
FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time ,
a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime,
a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName, ps.Id as PowerStationId,errDevice, err_valueKind, errValue, a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, ps.Id as PowerStationId,errDevice, err_valueKind, errValue,
FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw,
case when c.errMsg_tw is null then case when c.errMsg_tw is null then
case when err_valueKind = 'b' then d.errMsg_tw case when err_valueKind = 'b' then d.errMsg_tw

View File

@ -211,7 +211,7 @@ namespace solarApp.Service
select pr.FormId as FormId, pr.Id as ErrorID, priority, a.id, site_id, `timestamp`, a.sourceState, select pr.FormId as FormId, pr.Id as ErrorID, priority, a.id, site_id, `timestamp`, a.sourceState,
FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time ,
a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime,
a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName, ps.Id as PowerStationId,errDevice, err_valueKind, errValue, a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, ps.Id as PowerStationId,errDevice, err_valueKind, errValue,
FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw,
case when c.errMsg_tw is null then case when c.errMsg_tw is null then
case when err_valueKind = 'b' then d.errMsg_tw case when err_valueKind = 'b' then d.errMsg_tw