mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
feat: enhance PowerClamp service with energy consumption procedures and enums
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { SQL_QUERIES_PATH } from '@app/common/constants/sql-query-path';
|
||||
import { SqlLoaderService } from '@app/common/helper/services/sql-loader.service';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { DataSource } from 'typeorm';
|
||||
@ -13,6 +14,7 @@ export class PowerClampService {
|
||||
const sql = this.sqlLoader.loadQuery(
|
||||
'fact_daily_energy_consumed',
|
||||
'fact_daily_energy_consumed',
|
||||
SQL_QUERIES_PATH,
|
||||
);
|
||||
return this.dataSource.manager.query(sql);
|
||||
}
|
||||
@ -21,6 +23,7 @@ export class PowerClampService {
|
||||
const sql = this.sqlLoader.loadQuery(
|
||||
'energy',
|
||||
'energy_consumed_with_params',
|
||||
SQL_QUERIES_PATH,
|
||||
);
|
||||
return this.dataSource.manager.query(sql, [code]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user