alsmanager_lib 3.0.95 → 3.0.97
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 +66 -0
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -11706,6 +11706,71 @@ 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_place, 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 += "and s.id_place = '" + id_place +"' ";
|
|
11722
|
+
query += "order by sd.name ";
|
|
11723
|
+
return query;
|
|
11724
|
+
}
|
|
11725
|
+
|
|
11726
|
+
function getSitesSelectComboExcludeIdMySQL(id_place, id_site, date_ref) {
|
|
11727
|
+
var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
11728
|
+
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
11729
|
+
if (date_ref) {
|
|
11730
|
+
query += "where :date_ref >= sd.date_start and :date_ref <= sd.date_end ";
|
|
11731
|
+
}
|
|
11732
|
+
else {
|
|
11733
|
+
query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
|
|
11734
|
+
}
|
|
11735
|
+
query += "and s.id <> :id_site ";
|
|
11736
|
+
query += "and s.id_place = :id_place ";
|
|
11737
|
+
query += "order by sd.name ";
|
|
11738
|
+
return query;
|
|
11739
|
+
}
|
|
11740
|
+
|
|
11741
|
+
function getSitesSelectComboExcludeIdMySQL2(id_place, id_site, date_ref) {
|
|
11742
|
+
var query = "select s.id, concat(sd.name, ' - ', s.mark) as Descrizione from sites s ";
|
|
11743
|
+
query += "join site_destinations sd on sd.id_site = s.id ";
|
|
11744
|
+
if (date_ref) {
|
|
11745
|
+
query += "where '" + date_ref + "' >= sd.date_start and '" + date_ref + "' <= sd.date_end ";
|
|
11746
|
+
}
|
|
11747
|
+
else {
|
|
11748
|
+
query += "where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end ";
|
|
11749
|
+
}
|
|
11750
|
+
query += "and s.id <> " + id_site + " ";
|
|
11751
|
+
query += "and s.id_place = '" + id_place +"' ";
|
|
11752
|
+
query += "order by sd.name ";
|
|
11753
|
+
return query;
|
|
11754
|
+
}
|
|
11755
|
+
|
|
11756
|
+
function getSitesSelectComboExcludeId(db_used, id_place, id_site, date_ref) {
|
|
11757
|
+
var query = "";
|
|
11758
|
+
if (db_used) {
|
|
11759
|
+
switch (db_used) {
|
|
11760
|
+
case 'SQLITE':
|
|
11761
|
+
query = getSitesSelectComboExcludeIdSQLite(id_place, id_site, date_ref);
|
|
11762
|
+
break;
|
|
11763
|
+
case 'MYSQL':
|
|
11764
|
+
query = getSitesSelectComboExcludeIdMySQL(id_place, id_site, date_ref);
|
|
11765
|
+
break;
|
|
11766
|
+
case 'MYSQL2':
|
|
11767
|
+
query = getSitesSelectComboExcludeIdMySQL2(id_place, id_site, date_ref);
|
|
11768
|
+
break;
|
|
11769
|
+
}
|
|
11770
|
+
}
|
|
11771
|
+
return query;
|
|
11772
|
+
}
|
|
11773
|
+
|
|
11709
11774
|
//End Site in Combo Parziale
|
|
11710
11775
|
//Get Sites by Id
|
|
11711
11776
|
function getSiteByIdSQLite(id_site) {
|
|
@@ -14833,6 +14898,7 @@ module.exports = {
|
|
|
14833
14898
|
getSiteById,
|
|
14834
14899
|
getSitesSelectCombo,
|
|
14835
14900
|
getSitesSelectComboByPlace,
|
|
14901
|
+
getSitesSelectComboExcludeId,
|
|
14836
14902
|
verifyPrevDeviceSite,
|
|
14837
14903
|
insertDeviceSite,
|
|
14838
14904
|
updateDeviceSite,
|