|
|
|
@ -592,16 +592,16 @@ class Xsql {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getChartQueryAndParamsFromStepArray(tableName, columnName, stepArray) { |
|
|
|
|
getChartQueryAndParamsFromStepArray(tableName, columnName, stepArray, isRange = false) { |
|
|
|
|
|
|
|
|
|
let obj = {} |
|
|
|
|
|
|
|
|
|
obj.query = '' |
|
|
|
|
obj.params = [] |
|
|
|
|
|
|
|
|
|
if (stepArray.length && stepArray.length >= 2) { |
|
|
|
|
//console.log('getChartQueryAndParamsFromStepArray',isRange);
|
|
|
|
|
|
|
|
|
|
let params = [tableName, columnName, stepArray[0], stepArray[1]] |
|
|
|
|
if (stepArray.length && stepArray.length >= 2) { |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < stepArray.length - 1; i = i + 1) { |
|
|
|
|
|
|
|
|
@ -610,16 +610,27 @@ class Xsql {
|
|
|
|
|
obj.query = obj.query + ' union ' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (i) { |
|
|
|
|
if (i && isRange === false) { |
|
|
|
|
stepArray[i] = stepArray[i] + 1 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isRange === false) { |
|
|
|
|
obj.params.push((stepArray[i]) + ' to ' + stepArray[i + 1]) |
|
|
|
|
} else { |
|
|
|
|
obj.params.push((stepArray[0]) + ' to ' + stepArray[i + 1]) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
obj.params.push(columnName) |
|
|
|
|
obj.params.push(tableName) |
|
|
|
|
obj.params.push(columnName) |
|
|
|
|
|
|
|
|
|
if (isRange === false) { |
|
|
|
|
obj.params.push(stepArray[i]) |
|
|
|
|
obj.params.push(stepArray[i + 1]) |
|
|
|
|
} else { |
|
|
|
|
obj.params.push(stepArray[0]) |
|
|
|
|
obj.params.push(stepArray[i + 1]) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -632,13 +643,13 @@ class Xsql {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getChartQueryAndParamsFromMinMaxStddev(tableName, columnName, min, max, stddev) { |
|
|
|
|
getChartQueryAndParamsFromMinMaxStddev(tableName, columnName, min, max, stddev, isRange = false) { |
|
|
|
|
|
|
|
|
|
let stepArray = dataHelp.getRange(min, max, stddev) |
|
|
|
|
let stepArray = dataHelp.getStepArray(min, max, stddev) |
|
|
|
|
|
|
|
|
|
//console.log('steparray', stepArray);
|
|
|
|
|
|
|
|
|
|
let obj = this.getChartQueryAndParamsFromStepArray(tableName, columnName, stepArray) |
|
|
|
|
let obj = this.getChartQueryAndParamsFromStepArray(tableName, columnName, stepArray, isRange) |
|
|
|
|
|
|
|
|
|
//console.log('steparray', obj);
|
|
|
|
|
|
|
|
|
@ -646,13 +657,13 @@ class Xsql {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getChartQueryAndParamsFromMinMaxStep(tableName, columnName, min, max, step) { |
|
|
|
|
getChartQueryAndParamsFromMinMaxStep(tableName, columnName, min, max, step, isRange = false) { |
|
|
|
|
|
|
|
|
|
let stepArray = dataHelp.getRangeSimple(min, max, step) |
|
|
|
|
let stepArray = dataHelp.getStepArraySimple(min, max, step) |
|
|
|
|
|
|
|
|
|
//console.log('steparray', stepArray);
|
|
|
|
|
|
|
|
|
|
let obj = this.getChartQueryAndParamsFromStepArray(tableName, columnName, stepArray) |
|
|
|
|
let obj = this.getChartQueryAndParamsFromStepArray(tableName, columnName, stepArray, isRange) |
|
|
|
|
|
|
|
|
|
//console.log('steparray', obj);
|
|
|
|
|
|
|
|
|
|