Merge branch 'master' of https://github.com/shanghohui-Company/SolarPower
This commit is contained in:
commit
48f33067a0
@ -365,13 +365,14 @@ namespace SolarPower.Repository.Implement
|
|||||||
errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate,
|
errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate,
|
||||||
case when c.errMsg_tw is null then d.errMsg_tw else c.errMsg_tw end errMsg
|
case when c.errMsg_tw is null then d.errMsg_tw else c.errMsg_tw end errMsg
|
||||||
from err_main a
|
from err_main a
|
||||||
join alarmorion_orionalarmclass b on a.alarmclass = b.id
|
left join alarmorion_orionalarmclass b on a.alarmclass = b.id
|
||||||
left join ref_err_device c on trim(b.alarmClass) = c.deviceType
|
left join ref_err_device c on trim(b.alarmClass) = c.deviceType
|
||||||
left join ref_err_inv d on lower(b.alarmClass) = d.deviceType
|
left join ref_err_inv d on lower(b.alarmClass) = d.deviceType
|
||||||
and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode
|
# and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode
|
||||||
|
and a.errDeviceBrand = d.brend and a.errDeviceModel = d.model
|
||||||
left join power_station ps on ps.Code = site_id
|
left join power_station ps on ps.Code = site_id
|
||||||
left join operation_record pr on pr.ErrorCode = a.id
|
left join operation_record pr on pr.ErrorCode = a.id
|
||||||
WHERE a.sourceState = @Status AND ps.Id = @PowerStationId";
|
WHERE a.sourceState = @Status AND ps.Id = @PowerStationId ";
|
||||||
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(post.Range))
|
if (!string.IsNullOrEmpty(post.Range))
|
||||||
@ -385,6 +386,9 @@ namespace SolarPower.Repository.Implement
|
|||||||
sql += @$" AND `timestamp` BETWEEN {startime*1000} AND {endtime*1000}";
|
sql += @$" AND `timestamp` BETWEEN {startime*1000} AND {endtime*1000}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sql += "order by errvalue ";
|
||||||
|
|
||||||
result = (await conn.QueryAsync<ExceptionDataTable>(sql,
|
result = (await conn.QueryAsync<ExceptionDataTable>(sql,
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
@ -419,7 +423,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
join alarmorion_orionalarmclass b on a.alarmclass = b.id
|
join alarmorion_orionalarmclass b on a.alarmclass = b.id
|
||||||
left join ref_err_device c on trim(b.alarmClass) = c.deviceType
|
left join ref_err_device c on trim(b.alarmClass) = c.deviceType
|
||||||
left join ref_err_inv d on lower(b.alarmClass) = d.deviceType
|
left join ref_err_inv d on lower(b.alarmClass) = d.deviceType
|
||||||
and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode
|
# and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode
|
||||||
left join power_station ps on ps.Code = site_id
|
left join power_station ps on ps.Code = site_id
|
||||||
left join operation_record pr on pr.ErrorCode = a.id
|
left join operation_record pr on pr.ErrorCode = a.id
|
||||||
WHERE a.sourceState = @Status AND ps.Id IN @PowerStationId";
|
WHERE a.sourceState = @Status AND ps.Id IN @PowerStationId";
|
||||||
@ -436,6 +440,8 @@ namespace SolarPower.Repository.Implement
|
|||||||
sql += @$" AND `timestamp` BETWEEN {startime * 1000} AND {endtime * 1000}";
|
sql += @$" AND `timestamp` BETWEEN {startime * 1000} AND {endtime * 1000}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sql += "order by errvalue ";
|
||||||
|
|
||||||
result = (await conn.QueryAsync<ExceptionDataTable>(sql,
|
result = (await conn.QueryAsync<ExceptionDataTable>(sql,
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user