alsmanager_lib 1.0.55 → 1.0.57

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 +4 -4
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -7128,7 +7128,7 @@ function getBenchmarkById(db_used, id_device) {
7128
7128
  function getBenchmarkPercentageByIdSQLite(id_device) {
7129
7129
  var query = "select id_device, total_ref, evaluation_perfs, ";
7130
7130
  query += "case ";
7131
- query += "when total_ref is not null and total_ref > 0 then (evaluation_perfs/total_ref) * 100 ";
7131
+ query += "when total_ref is not null and total_ref > 0 then ROUND(evaluation_perfs * 100 / total_ref, 0) ";
7132
7132
  query += "else 0 ";
7133
7133
  query += "end as perc_prestazioni from device_bmark ";
7134
7134
  query += "where id_device = " + id_device;
@@ -7138,7 +7138,7 @@ function getBenchmarkPercentageByIdSQLite(id_device) {
7138
7138
  function getBenchmarkPercentageByIdMySQL(id_device) {
7139
7139
  var query = "select id_device, total_ref, evaluation_perfs, ";
7140
7140
  query += "case ";
7141
- query += "when total_ref is not null and total_ref > 0 then (evaluation_perfs/total_ref) * 100 ";
7141
+ query += "when total_ref is not null and total_ref > 0 then ROUND(evaluation_perfs * 100 / total_ref, 0) ";
7142
7142
  query += "else 0 ";
7143
7143
  query += "end as perc_prestazioni from device_bmark ";
7144
7144
  query += "where id_device = :id_device";
@@ -7162,13 +7162,13 @@ function getBenchmarkPercentageById(db_used, id_device) {
7162
7162
 
7163
7163
 
7164
7164
  function insertBenchmarkSQLite(id_device, total_ref, eval_perfs) {
7165
- var query = "insert into device_bmark (id_device, total_ref, evaluation_perfs) value ";
7165
+ var query = "insert into device_bmark (id_device, total_ref, evaluation_perfs) values ";
7166
7166
  query += "(" + id_device + ", " + total_ref + ", " + eval_perfs + ")";
7167
7167
  return query;
7168
7168
  }
7169
7169
 
7170
7170
  function insertBenchmarkMySQL(id_device, total_ref, eval_perfs) {
7171
- var query = "insert into device_bmark (id_device, total_ref, evaluation_perfs) value ";
7171
+ var query = "insert into device_bmark (id_device, total_ref, evaluation_perfs) values ";
7172
7172
  query += "(:id_device, :total_ref, :eval_perfs)";
7173
7173
  return query;
7174
7174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alsmanager_lib",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "description": "Funzioni per ALSManager",
5
5
  "license": "ISC",
6
6
  "author": "Luca Cattani",