alsmanager_lib 3.0.94 → 3.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 +63 -2
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -11706,6 +11706,68 @@ function getSitesSelectComboByPlace(db_used, id_place, floor, date_ref) {
|
|
|
11706
11706
|
return query;
|
|
11707
11707
|
}
|
|
11708
11708
|
|
|
11709
|
+
//End Site in Combo Parziale
|
|
11710
|
+
// Select Site in Combo Parziale
|
|
11711
|
+
function getSitesSelectComboExcludeIdSQLite(id_site, date_ref) {
|
|
11712
|
+
var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
11713
|
+
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
11714
|
+
if (date_ref) {
|
|
11715
|
+
query += "where '" + date_ref + "' >= sd.date_start and '" + date_ref + "' <= sd.date_end ";
|
|
11716
|
+
}
|
|
11717
|
+
else {
|
|
11718
|
+
query += "where date('now') >= sd.date_start and date('now') <= sd.date_end ";
|
|
11719
|
+
}
|
|
11720
|
+
query += "and s.id <> " + id_site + " ";
|
|
11721
|
+
query += "order by sd.name ";
|
|
11722
|
+
return query;
|
|
11723
|
+
}
|
|
11724
|
+
|
|
11725
|
+
function getSitesSelectComboExcludeIdMySQL(id_site, date_ref) {
|
|
11726
|
+
var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
11727
|
+
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
11728
|
+
if (date_ref) {
|
|
11729
|
+
query += "where :date_ref >= sd.date_start and :date_ref <= sd.date_end ";
|
|
11730
|
+
}
|
|
11731
|
+
else {
|
|
11732
|
+
query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
|
|
11733
|
+
}
|
|
11734
|
+
query += "and s.id <> :id_site ";
|
|
11735
|
+
query += "order by sd.name ";
|
|
11736
|
+
return query;
|
|
11737
|
+
}
|
|
11738
|
+
|
|
11739
|
+
function getSitesSelectComboExcludeIdMySQL2(id_site, date_ref) {
|
|
11740
|
+
var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
11741
|
+
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
11742
|
+
if (date_ref) {
|
|
11743
|
+
query += "where '" + date_ref + "' >= sd.date_start and '" + date_ref + "' <= sd.date_end ";
|
|
11744
|
+
}
|
|
11745
|
+
else {
|
|
11746
|
+
query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
|
|
11747
|
+
}
|
|
11748
|
+
query += "and s.id <> " + id_site + " ";
|
|
11749
|
+
query += "order by sd.name ";
|
|
11750
|
+
return query;
|
|
11751
|
+
}
|
|
11752
|
+
|
|
11753
|
+
function getSitesSelectComboExcludeId(db_used, id_site, date_ref) {
|
|
11754
|
+
var query = "";
|
|
11755
|
+
if (db_used) {
|
|
11756
|
+
switch (db_used) {
|
|
11757
|
+
case 'SQLITE':
|
|
11758
|
+
query = getSitesSelectComboExcludeIdSQLite(id_site, date_ref);
|
|
11759
|
+
break;
|
|
11760
|
+
case 'MYSQL':
|
|
11761
|
+
query = getSitesSelectComboExcludeIdMySQL(id_site, date_ref);
|
|
11762
|
+
break;
|
|
11763
|
+
case 'MYSQL2':
|
|
11764
|
+
query = getSitesSelectComboExcludeIdMySQL2(id_site, date_ref);
|
|
11765
|
+
break;
|
|
11766
|
+
}
|
|
11767
|
+
}
|
|
11768
|
+
return query;
|
|
11769
|
+
}
|
|
11770
|
+
|
|
11709
11771
|
//End Site in Combo Parziale
|
|
11710
11772
|
//Get Sites by Id
|
|
11711
11773
|
function getSiteByIdSQLite(id_site) {
|
|
@@ -14486,8 +14548,6 @@ function writeMapPoint(id_place, floor, id_site, x_coor, y_coor, map_scale, rang
|
|
|
14486
14548
|
|
|
14487
14549
|
function updateMapPoint(id_point, id_site, x_coor, y_coor, map_scale, range_x, range_y) {
|
|
14488
14550
|
var query = "update map_points set ";
|
|
14489
|
-
query += "id_place = '" + id_place + "', ";
|
|
14490
|
-
query += "floor = " + floor + ", ";
|
|
14491
14551
|
query += "id_site = " + id_site + ", ";
|
|
14492
14552
|
query += "point_x = " + x_coor + ", ";
|
|
14493
14553
|
query += "point_y = " + y_coor + ", ";
|
|
@@ -14835,6 +14895,7 @@ module.exports = {
|
|
|
14835
14895
|
getSiteById,
|
|
14836
14896
|
getSitesSelectCombo,
|
|
14837
14897
|
getSitesSelectComboByPlace,
|
|
14898
|
+
getSitesSelectComboExcludeId,
|
|
14838
14899
|
verifyPrevDeviceSite,
|
|
14839
14900
|
insertDeviceSite,
|
|
14840
14901
|
updateDeviceSite,
|