queryStat_parameter = {}; function queryStat_init() { $('#content').html(''); $('#result').html(''); var str = ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += '
list get execute
applicationFlag:
flag:
date
sample
'; str += '{
'; str += '"dateRangeType":"",
'; str += '//year, season, month, week, date, range, none
'; str += '"dateEffectType":"",
'; str += '//start, completed
'; str += '"start":"",
'; str += '"completed":"",
'; str += '"year":"",
'; str += '"month":"",
'; str += '"date":"",
'; str += '"season":0,
'; str += '"week":0,
'; str += '"adjust":0
'; str += '}'; str += '
filter
sample
'; str += '{
'; str += '"path":"",
'; str += '"value":"",
'; str += '"formatType":"",
'; str += '//textValue, numberValue, booleanValue, dateTimeValue
'; str += '"logic":"",
'; str += '//and,or
'; str += '"comparison":"",
'; str += '//equals,notEquals,greaterThan,greaterThanOrEqualTo,lessThan,lessThanOrEqualTo,like,notLike
'; str += '}'; str += '
column
sample
number or string
where application
where process
where company
where department
where person
where identity
'; $('#content').html(str); $('#list').click(function() { queryStat_list($('#applicationFlag').val()); }); $('#get').click(function() { queryStat_get($('#flag').val(), $('#applicationFlag').val()); }); $('#execute').click(function() { queryStat_execute($('#flag').val(), $('#applicationFlag').val()); }); } function queryStat_list(applicationFlag) { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/querystat/list/application/flag/' + applicationFlag, xhrFields : { 'withCredentials' : true }, crossDomain : true }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function queryStat_get(flag, applicationFlag) { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/querystat/flag/' + flag + '/application/flag/' + applicationFlag, xhrFields : { 'withCredentials' : true }, crossDomain : true }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function queryStat_execute(flag, applicationFlag) { $('#result').html(''); var data = {}; if ($('#date').val().length > 0) { data.date = JSON.parse($('#date').val()); } if ($('#filter').val().length > 0) { data.filter = JSON.parse($('#filter').val()); } if ($('#application').val().length > 0) { data.application = JSON.parse($('#application').val()); } if ($('#process').val().length > 0) { data.process = JSON.parse($('#process').val()); } if ($('#company').val().length > 0) { data.company = JSON.parse($('#company').val()); } if ($('#department').val().length > 0) { data.department = JSON.parse($('#department').val()); } if ($('#person').val().length > 0) { data.person = JSON.parse($('#person').val()); } if ($('#identity').val().length > 0) { data.identity = JSON.parse($('#identity').val()); } if ($('#column').val().length > 0) { data.column = JSON.parse($('#column').val()); } $.ajax({ type : 'put', dataType : 'json', url : '../jaxrs/querystat/flag/' + flag + '/application/flag/' + applicationFlag + '/execute', contentType : 'application/json; charset=utf-8', data : JSON.stringify(data), xhrFields : { 'withCredentials' : true }, crossDomain : true }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); }