alsmanager_lib 1.0.95 → 1.0.96
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.
- package/lib/modules.js +35 -0
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -1196,6 +1196,40 @@ function removeDeviceConfiguration(db_used, id_conf) {
|
|
|
1196
1196
|
return query;
|
|
1197
1197
|
}
|
|
1198
1198
|
//
|
|
1199
|
+
function getPartChangedSQLite(id_conf, id_device, id_part, part_type) {
|
|
1200
|
+
var query = "select id, id_conf, id_device, part_type, id_part, operation from change_config ";
|
|
1201
|
+
query += "where id_conf = " + id_conf + " ";
|
|
1202
|
+
query += "and id_device = " + id_device + " ";
|
|
1203
|
+
query += "and id_part = " + id_part + " ";
|
|
1204
|
+
query += "and part_type = '" + part_type + "' ";
|
|
1205
|
+
return query;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
function getPartChangedMySQL(id_conf, id_device, id_part, part_type) {
|
|
1209
|
+
var query = "select id, id_conf, id_device, part_type, id_part, operation from change_config ";
|
|
1210
|
+
query += "where id_conf = :id_conf ";
|
|
1211
|
+
query += "and id_device = :id_device ";
|
|
1212
|
+
query += "and id_part = :id_part ";
|
|
1213
|
+
query += "and part_type = :part_type ";
|
|
1214
|
+
return query;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
function getPartChanged(db_used, id_conf, id_device, id_part, part_type) {
|
|
1218
|
+
var query = "";
|
|
1219
|
+
if (db_used) {
|
|
1220
|
+
switch (db_used) {
|
|
1221
|
+
case 'SQLITE':
|
|
1222
|
+
query = getPartChangedSQLite(id_conf, id_device, id_part, part_type);
|
|
1223
|
+
break;
|
|
1224
|
+
case 'MYSQL':
|
|
1225
|
+
query = getPartChangedMySQL(id_conf, id_device, id_part, part_type);
|
|
1226
|
+
break;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
return query;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
|
|
1199
1233
|
function insertPartChangedSQLite(id_conf, id_device, id_part, part_type, operation, id_part_replaced) {
|
|
1200
1234
|
var query = "insert into change_config (id_conf, id_device, part_type, id_part, operation, id_part_replaced) values (";
|
|
1201
1235
|
query += id_conf + ", ";
|
|
@@ -9003,6 +9037,7 @@ module.exports = {
|
|
|
9003
9037
|
insertDeviceConfiguration,
|
|
9004
9038
|
updateDeviceConfiguration,
|
|
9005
9039
|
removeDeviceConfiguration,
|
|
9040
|
+
getPartChanged,
|
|
9006
9041
|
insertPartChanged,
|
|
9007
9042
|
updatePartChanged,
|
|
9008
9043
|
removePartChanged,
|