alsmanager_lib 3.0.99 → 3.0.100

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.
Files changed (2) hide show
  1. package/lib/modules.js +57 -0
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -11102,6 +11102,58 @@ function querySites(db_used, place, piano, funzione, date_ref) {
11102
11102
 
11103
11103
  }
11104
11104
 
11105
+ function writeSite(id_place, mark, floor, size) {
11106
+ var query = "insert into sites (id_place, mark, flooor, size) values ";
11107
+ query += "('" + id_place + "', ";
11108
+ query += "'" + mark + "', ";
11109
+ query += floor + ", ";
11110
+ query += size + ") ";
11111
+ return query;
11112
+ }
11113
+
11114
+ function updateSite(id_site, id_place, mark, floor, size) {
11115
+ var query = "update sites set ";
11116
+ query += "id_place = '" + id_place + "', ";
11117
+ query += "mark = '" + mark + "', ";
11118
+ query += "floor = " + floor + ", ";
11119
+ query += "size = " + size + " ";
11120
+ query += "where id = " + id_site;
11121
+ return query;
11122
+ }
11123
+
11124
+ function writeSiteDestination(id_site, id_place, date_start, date_end, name, funzione) {
11125
+ var query = "insert into site_destinations (id_site, id_place, date_start, date_end, name, type) values ";
11126
+ query += "(" + id_site + ", ";
11127
+ query += "'" + id_place + "', ";
11128
+ query += "'" + date_start + "', ";
11129
+ query += "'" + date_end + "', ";
11130
+ query += "'" + name + "', ";
11131
+ query += "'" + funzione + "' ";
11132
+ return query;
11133
+ }
11134
+
11135
+ function updateSiteDestination(id_site, id_place, date_start, date_end, name, funzione) {
11136
+ var query = "update site_destinations set ";
11137
+ query += "'" + date_start + "', ";
11138
+ query += "'" + date_end + "', ";
11139
+ if (name) {
11140
+ query += "name = '" + name + "', ";
11141
+ }
11142
+ if (funzione) {
11143
+ query += "type = '" + funzione + "' ";
11144
+ }
11145
+ query += "where id_site = " + id_site + " and id_place = '" + id_place + "'";
11146
+ return query;
11147
+ }
11148
+
11149
+ function getSiteDestinationsByIdSite(id_site, id_place) {
11150
+ var query = "select date_start, date_end, name, type from site_destinations ";
11151
+ query += "where id_site = " + id_site + " and id_place = '" + id_place + "' ";
11152
+ query += "order by date_start desc ";
11153
+ return query;
11154
+ }
11155
+
11156
+
11105
11157
  //Sites by devices
11106
11158
  function getSitesFromDeviceSQLite(id_device, prec_pos) {
11107
11159
  var query = "SELECT DISTINCT p.mark as Sigla, p.name as Plesso, sd.name as Aula, sd.type as Funzione, s.floor as Piano from device_site ds ";
@@ -14910,6 +14962,11 @@ module.exports = {
14910
14962
  queryFloorsByPlace,
14911
14963
  queryFunzioneByPlaceAndFloor,
14912
14964
  querySites,
14965
+ writeSite,
14966
+ updateSite,
14967
+ writeSiteDestination,
14968
+ updateSiteDestination,
14969
+ getSiteDestinationsByIdSite,
14913
14970
  getSitesFromDevice,
14914
14971
  getSitesWithDatesFromDevice,
14915
14972
  querySitesWithDefaults,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  ".": "./lib/modules.js",
5
5
  "./dbconn": "./lib/dbconn.js"
6
6
  },
7
- "version": "3.0.99",
7
+ "version": "3.0.100",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",