alsmanager_lib 3.0.180 → 3.0.181

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 +64 -0
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -8325,6 +8325,68 @@ function removeIntervento(db_used,id_intervento) {
8325
8325
 
8326
8326
 
8327
8327
  // Device intervento
8328
+ function selectDevicesInterventoByIdInterventoSQLite(id_intervento) {
8329
+ var query = "select id, id_device, id_intervento, date_start, date_end, note_intervento, tempo_stimato_min, tempo_effettivo_min from device_interventi ";
8330
+ query += "where id_intervento = " + id_intervento;
8331
+ return query;
8332
+ }
8333
+
8334
+ function selectDevicesInterventoByIdInterventoMySQL(id_intervento) {
8335
+ var query = "select id, id_device, id_intervento, date_start, date_end, note_intervento, tempo_stimato_min, tempo_effettivo_min from device_interventi ";
8336
+ query += "where id_intervento = :id_intervento";
8337
+ return query;
8338
+ }
8339
+
8340
+ function selectDevicesInterventoByIdIntervento(db_used, id_intervento) {
8341
+ var query = "";
8342
+ if (db_used) {
8343
+ switch (db_used) {
8344
+ case 'SQLITE':
8345
+ query = selectDevicesInterventoByIdInterventoSQLite(id_intervento);
8346
+ break;
8347
+ case 'MYSQL':
8348
+ query = selectDevicesInterventoByIdInterventoMySQL();
8349
+ break;
8350
+ case 'MYSQL2':
8351
+ query = selectDevicesInterventoByIdInterventoSQLite(id_intervento);
8352
+ break;
8353
+ }
8354
+ }
8355
+ return query;
8356
+ }
8357
+
8358
+
8359
+
8360
+ function selectDevicesInterventoByIdSQLite(id_dev_intervento) {
8361
+ var query = "select id, id_device, id_intervento, date_start, date_end, note_intervento, tempo_stimato_min, tempo_effettivo_min from device_interventi ";
8362
+ query += "where id = " + id_dev_intervento;
8363
+ return query;
8364
+ }
8365
+
8366
+ function selectDevicesInterventoByIdMySQL(id_dev_intervento) {
8367
+ var query = "select id, id_device, id_intervento, date_start, date_end, note_intervento, tempo_stimato_min, tempo_effettivo_min from device_interventi ";
8368
+ query += "where id = :id_dev_intervento";
8369
+ return query;
8370
+ }
8371
+
8372
+ function selectDevicesInterventoById(db_used, id_dev_intervento) {
8373
+ var query = "";
8374
+ if (db_used) {
8375
+ switch (db_used) {
8376
+ case 'SQLITE':
8377
+ query = selectDevicesInterventoByIdSQLite(id_dev_intervento);
8378
+ break;
8379
+ case 'MYSQL':
8380
+ query = selectDevicesInterventoByIdMySQL();
8381
+ break;
8382
+ case 'MYSQL2':
8383
+ query = selectDevicesInterventoByIdSQLite(id_dev_intervento);
8384
+ break;
8385
+ }
8386
+ }
8387
+ return query;
8388
+ }
8389
+
8328
8390
  function insertDeviceInterventoSQLite(id_intervento, id_device, dt_inizio, dt_fine, note, t_stima_min, t_effettivo_min) {
8329
8391
  /*CREATE TABLE "device_interventi" (
8330
8392
  "id" INTEGER,
@@ -16352,6 +16414,8 @@ module.exports = {
16352
16414
  insertDeviceIntervento,
16353
16415
  updateDeviceIntervento,
16354
16416
  removeDeviceIntervento,
16417
+ selectDevicesInterventoByIdIntervento,
16418
+ selectDevicesInterventoById,
16355
16419
  //
16356
16420
  getConnectionTypes,
16357
16421
  getConnectionProtocols,
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.180",
7
+ "version": "3.0.181",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",