alsmanager_lib 1.0.25 → 1.0.27
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 +54 -6
- package/package.json +2 -2
- package/lib/doubledb.js +0 -25
package/lib/modules.js
CHANGED
|
@@ -3485,6 +3485,21 @@ function queryFloorsByPlaceMySQL(id_place) {
|
|
|
3485
3485
|
return query;
|
|
3486
3486
|
}
|
|
3487
3487
|
|
|
3488
|
+
function queryFloorsByPlace(db_used, id_place) {
|
|
3489
|
+
var query = "";
|
|
3490
|
+
if (db_used) {
|
|
3491
|
+
switch (db_used) {
|
|
3492
|
+
case 'SQLITE':
|
|
3493
|
+
query = queryFloorsByPlaceSQLite(id_place);
|
|
3494
|
+
break;
|
|
3495
|
+
case 'MYSQL':
|
|
3496
|
+
query = queryFloorsByPlaceMySQL(id_place);
|
|
3497
|
+
break;
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
return query;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3488
3503
|
function queryFunzioneByPlaceAndFloorSQLite(id_place, piano) {
|
|
3489
3504
|
var query = "";
|
|
3490
3505
|
query = "SELECT DISTINCT sd.type as funzione from site_destinations sd";
|
|
@@ -3517,6 +3532,22 @@ function queryFunzioneByPlaceAndFloorMySQL(id_place, piano) {
|
|
|
3517
3532
|
|
|
3518
3533
|
}
|
|
3519
3534
|
|
|
3535
|
+
function queryFunzioneByPlaceAndFloor(db_used, id_place, piano) {
|
|
3536
|
+
var query = "";
|
|
3537
|
+
if (db_used) {
|
|
3538
|
+
switch (db_used) {
|
|
3539
|
+
case 'SQLITE':
|
|
3540
|
+
query = queryFunzioneByPlaceAndFloorSQLite(id_place, piano);
|
|
3541
|
+
break;
|
|
3542
|
+
case 'MYSQL':
|
|
3543
|
+
query = queryFunzioneByPlaceAndFloorMySQL(id_place, piano);
|
|
3544
|
+
break;
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
return query;
|
|
3548
|
+
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3520
3551
|
|
|
3521
3552
|
function querySitesSQLite(place, piano, funzione) {
|
|
3522
3553
|
var query = "SELECT site_destinations.id_site as id, sites.id_place as Plesso, site_destinations.name as Nome, sites.mark as Codice, sites.floor as Piano, site_destinations.type as Funzione from site_destinations";
|
|
@@ -3556,6 +3587,24 @@ function querySitesMySQL(place, piano, funzione) {
|
|
|
3556
3587
|
return query;
|
|
3557
3588
|
}
|
|
3558
3589
|
|
|
3590
|
+
function querySites(db_used, place, piano, funzione) {
|
|
3591
|
+
var query = "";
|
|
3592
|
+
if (db_used) {
|
|
3593
|
+
switch (db_used) {
|
|
3594
|
+
case 'SQLITE':
|
|
3595
|
+
query = alsmgr.querySitesSQLite(place, piano, funzione);
|
|
3596
|
+
break;
|
|
3597
|
+
case 'MYSQL':
|
|
3598
|
+
query = alsmgr.querySitesMySQL(place, piano, funzione);
|
|
3599
|
+
break;
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
else {
|
|
3603
|
+
query = alsmgr.querySitesSQLite(place, piano, funzione);
|
|
3604
|
+
}
|
|
3605
|
+
return query;
|
|
3606
|
+
|
|
3607
|
+
}
|
|
3559
3608
|
|
|
3560
3609
|
//Sites by devices
|
|
3561
3610
|
function getSitesFromDeviceSQLite(id_device, prec_pos) {
|
|
@@ -4489,6 +4538,7 @@ module.exports = {
|
|
|
4489
4538
|
removeConsegnaMySQL,
|
|
4490
4539
|
queryLastConsegnaIdSQLite,
|
|
4491
4540
|
queryLastConsegnaIdMySQL,
|
|
4541
|
+
//
|
|
4492
4542
|
removeSiteBySetSQLite,
|
|
4493
4543
|
removeSiteBySetMySQL,
|
|
4494
4544
|
updateSiteBySetSQLite,
|
|
@@ -4516,12 +4566,9 @@ module.exports = {
|
|
|
4516
4566
|
removeDeviceSiteSQLite,
|
|
4517
4567
|
removeDeviceSiteMySQL,
|
|
4518
4568
|
queryPlaces,
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
queryFunzioneByPlaceAndFloorMySQL,
|
|
4523
|
-
querySitesSQLite,
|
|
4524
|
-
querySitesMySQL,
|
|
4569
|
+
queryFloorsByPlace,
|
|
4570
|
+
queryFunzioneByPlaceAndFloor,
|
|
4571
|
+
querySites,
|
|
4525
4572
|
getSitesFromDeviceSQLite,
|
|
4526
4573
|
getSitesFromDeviceMySQL,
|
|
4527
4574
|
getSitesWithDatesFromDeviceSQLite,
|
|
@@ -4530,6 +4577,7 @@ module.exports = {
|
|
|
4530
4577
|
querySitesWithDefaultsMySQL,
|
|
4531
4578
|
getPorteByIdSiteSQLite,
|
|
4532
4579
|
getPorteByIdSiteMySQL,
|
|
4580
|
+
//
|
|
4533
4581
|
queryStatisticSQLite,
|
|
4534
4582
|
queryStatisticMySQL,
|
|
4535
4583
|
queryStatisticInventarySQLite,
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alsmanager_lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Funzioni per ALSManager",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Luca Cattani",
|
|
7
7
|
"type": "commonjs",
|
|
8
|
-
"main": "./lib
|
|
8
|
+
"main": "./lib/modules.js",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
11
|
}
|
package/lib/doubledb.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Metodi di gestione doppio motore DB
|
|
2
|
-
import { queryFloorsByPlaceSQLite, queryFloorsByPlaceMySQL } from './modules';
|
|
3
|
-
|
|
4
|
-
function queryFloorsByPlace(db_used, id_place) {
|
|
5
|
-
var query = "";
|
|
6
|
-
if (db_used) {
|
|
7
|
-
switch (db_used) {
|
|
8
|
-
case 'SQLITE':
|
|
9
|
-
query = alsmgr.queryFloorsByPlaceSQLite(id_place);
|
|
10
|
-
break;
|
|
11
|
-
case 'MYSQL':
|
|
12
|
-
query = alsmgr.queryFloorsByPlaceMySQL(id_place);
|
|
13
|
-
break;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return query;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// Exports
|
|
22
|
-
module.exports =
|
|
23
|
-
{
|
|
24
|
-
queryFloorsByPlace
|
|
25
|
-
}
|