@enervance/insight-cim-model 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,4 +3,5 @@ import { Feeder } from '../../model/core/Feeder.js';
|
|
|
3
3
|
import { InsertStatement } from '../dao-sql-types.js';
|
|
4
4
|
export declare class FeederDao<T extends Feeder> extends EquipmentContainerDao<Feeder> {
|
|
5
5
|
toInsertStatements(): InsertStatement[];
|
|
6
|
+
toAssociationInsertStatements(): InsertStatement[];
|
|
6
7
|
}
|
|
@@ -8,20 +8,35 @@ class FeederDao extends EquipmentContainerDao_1.EquipmentContainerDao {
|
|
|
8
8
|
...super.toInsertStatements(),
|
|
9
9
|
{
|
|
10
10
|
sql: `
|
|
11
|
-
|
|
12
|
-
mrid
|
|
13
|
-
normal_energizing_substation_mrid
|
|
14
|
-
) values (?, ?)
|
|
15
|
-
on conflict (mrid) do update
|
|
16
|
-
set normal_energizing_substation_mrid = excluded.normal_energizing_substation_mrid
|
|
11
|
+
insert into cim.feeder (mrid) values ($1)
|
|
12
|
+
on conflict (mrid) do nothing
|
|
17
13
|
`,
|
|
18
14
|
params: [
|
|
19
|
-
this.cimObject.getUUID()
|
|
20
|
-
this.cimObject.normalEnergizingSubstation?.getUUID() ?? null
|
|
15
|
+
this.cimObject.getUUID()
|
|
21
16
|
]
|
|
22
17
|
}
|
|
23
18
|
];
|
|
24
19
|
}
|
|
20
|
+
toAssociationInsertStatements() {
|
|
21
|
+
return [
|
|
22
|
+
...super.toAssociationInsertStatements(),
|
|
23
|
+
...(this.cimObject.normalEnergizingSubstation
|
|
24
|
+
? [
|
|
25
|
+
{
|
|
26
|
+
sql: `
|
|
27
|
+
update cim.feeder
|
|
28
|
+
set normal_energizing_substation_mrid = $2
|
|
29
|
+
where mrid = $1
|
|
30
|
+
`,
|
|
31
|
+
params: [
|
|
32
|
+
this.cimObject.getUUID(),
|
|
33
|
+
this.cimObject.normalEnergizingSubstation?.getUUID() ?? null
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
: [])
|
|
38
|
+
];
|
|
39
|
+
}
|
|
25
40
|
}
|
|
26
41
|
exports.FeederDao = FeederDao;
|
|
27
42
|
//# sourceMappingURL=FeederDao.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeederDao.js","sourceRoot":"","sources":["../../../src/database/core/FeederDao.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAIhE,MAAa,SAA4B,SAAQ,6CAA6B;IACnE,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B;gBACE,GAAG,EAAE
|
|
1
|
+
{"version":3,"file":"FeederDao.js","sourceRoot":"","sources":["../../../src/database/core/FeederDao.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAIhE,MAAa,SAA4B,SAAQ,6CAA6B;IACnE,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B;gBACE,GAAG,EAAE;;;SAGJ;gBACD,MAAM,EAAE;oBACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;iBACzB;aACF;SACF,CAAC;IACJ,CAAC;IAEQ,6BAA6B;QACpC,OAAO;YACL,GAAG,KAAK,CAAC,6BAA6B,EAAE;YAExC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,0BAA0B;gBAC3C,CAAC,CAAC;oBACA;wBACE,GAAG,EAAE;;;;aAIJ;wBACD,MAAM,EAAE;4BACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;4BACxB,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,OAAO,EAAE,IAAI,IAAI;yBAC7D;qBACF;iBACF;gBACD,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;CACF;AArCD,8BAqCC"}
|