alsmanager_lib 1.0.92 → 1.0.93
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 +36 -0
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -1323,6 +1323,41 @@ function getLastPartInserted(db_used, id_device, id_conf, part_type) {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
return query;
|
|
1325
1325
|
}
|
|
1326
|
+
|
|
1327
|
+
function existPartInConfigSQLite(id_device, id_conf, id_part, part_type) {
|
|
1328
|
+
var query = "select count(*) as num from change_config ";
|
|
1329
|
+
query += "where id_device = " + id_device + " ";
|
|
1330
|
+
query += "and part_type = '" + part_type + "' ";
|
|
1331
|
+
query += "and id_conf = " + id_conf + " ";
|
|
1332
|
+
query += "and id_part = " + id_part;
|
|
1333
|
+
return query;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
function existPartInConfigMySQL(id_device, id_conf, id_part, part_type) {
|
|
1337
|
+
var query = "select count(*) as num from change_config ";
|
|
1338
|
+
query += "where id_device = :id_device ";
|
|
1339
|
+
query += "and part_type = :part_type ";
|
|
1340
|
+
query += "and id_conf = :id_conf ";
|
|
1341
|
+
query += "and id_part = :id_part";
|
|
1342
|
+
return query;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
function existPartInConfig(db_used, id_device, id_conf, id_part, part_type) {
|
|
1346
|
+
var query = "";
|
|
1347
|
+
if (db_used) {
|
|
1348
|
+
switch (db_used) {
|
|
1349
|
+
case 'SQLITE':
|
|
1350
|
+
query = existPartInConfigSQLite(id_device, id_conf, id_part, part_type);
|
|
1351
|
+
break;
|
|
1352
|
+
case 'MYSQL':
|
|
1353
|
+
query = existPartInConfigMySQL(id_device, id_conf, id_part, part_type);
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
return query;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
|
|
1326
1361
|
//End Device configurations
|
|
1327
1362
|
// Disk usage
|
|
1328
1363
|
function getDiskUsagesByIdStorageSQLite(id_storage) {
|
|
@@ -8970,6 +9005,7 @@ module.exports = {
|
|
|
8970
9005
|
updatePartChanged,
|
|
8971
9006
|
removePartChanged,
|
|
8972
9007
|
getLastPartInserted,
|
|
9008
|
+
existPartInConfig,
|
|
8973
9009
|
//
|
|
8974
9010
|
selectBeneDaInventario,
|
|
8975
9011
|
getDevicesSelectForInventarioRaw,
|