• 2.4.1.7.24. Statistics(统计计算类型)
    • 2.4.1.7.24.1. 查询Statistics详细列
    • 2.4.1.7.24.2. 查询Statistics指定记录
    • 2.4.1.7.24.3. 添加statistics
    • 2.4.1.7.24.4. 编辑statistics
    • 2.4.1.7.24.5. 删除statistics

    2.4.1.7.24. Statistics(统计计算类型)

    2.4.1.7.24.1. 查询Statistics详细列

    调用接口:

    属性
    url/api/statistics/get_list
    http方法post
    Content-Typeapplication/json或application/x-www-form-urlencoded

    请求参数:

    字段字段名称字段类型说明是否必传
    page_index查询页码Integer大于 0,如果为空,则默认从第一页显示
    page_size每页记录数Integer大于 0,如果为空,则默认为 20
    condition查询条件JsonLIKE模糊搜索条件
    start_time开始时间Datetime按创建时间搜索的开始时间和结束时间
    end_time结束时间Datetime

    condition参数:

    格式

    1. [["${key}", "${operator}", "${value}"]] [["查询值", "运算符", "查询内容"]]

    举例

    1. [["statistics_id", "=", "1001"]]

    返回参数:

    字段字段名称字段类型说明是否必传
    code返回码Integer200:成功 500:失败
    msg提示信息String
    result结果Json

    返回数据举例:

    1. {
    2. "code": 200,
    3. "msg": "查询成功",
    4. "mix_code":130001,
    5. "mix_msg":"",
    6. "mix_ext":"",
    7. "result": {
    8. "page_index": 1,
    9. "page_size": 20,
    10. "total_pages": 1,
    11. "total_records": 1,
    12. "data": [
    13. {
    14. "statistics_id": "FuelConsumption",
    15. "statistics_name": "燃料消耗",
    16. "description": "每两小时燃料消耗的统计",
    17. "scheduled": "1",
    18. "pathfile": "/statistics_services/auto_generator/FuelConsumption.json",
    19. "template": "",
    20. "script": {
    21. "connector": {
    22. "INFLUXDB": {
    23. "host": "rnd.mixiot.top:8086"
    24. },
    25. "MYSQL": {
    26. "host": "rnd.mixiot.top:3306"
    27. }
    28. },
    29. "cycle": "5m",
    30. "description": "每两小时燃料消耗的统计",
    31. "expr": "accumulate(S19)",
    32. "name": "FuelConsumption",
    33. "result": {
    34. "precision": 3
    35. },
    36. "selection": {
    37. "filter_and": {
    38. "mappingID": [
    39. "1002"
    40. ]
    41. }
    42. },
    43. "source": {
    44. "MO": {
    45. "object": [
    46. "S19"
    47. ]
    48. }
    49. },
    50. "statistics_id": "FuelConsumption",
    51. "statos_name": "燃料消耗",
    52. "track": true
    53. },
    54. "reference": "",
    55. "auto_curdwm": null,
    56. "type": "",
    57. "stats": 1,
    58. "auto_dwm": 1,
    59. "created": "2018-09-07 12:02:45",
    60. "is_available": 1,
    61. "boss_sync": 0
    62. }
    63. ]
    64. }
    65. }

    2.4.1.7.24.2. 查询Statistics指定记录

    调用接口:

    属性
    url/api/statistics/get
    http方法post
    Content-Typeapplication/json或application/x-www-form-urlencoded

    请求参数:

    字段字段名称字段类型说明是否必传
    statistics_id统计计算标识String

    返回参数:

    字段字段名称字段类型说明是否必传
    code返回码Integer200:成功 500:失败
    msg提示信息String
    result返回结果Json

    返回示例:

    1. {
    2. "code": 200,
    3. "msg": "查询成功",
    4. "mix_code":130001,
    5. "mix_msg":"",
    6. "mix_ext":"",
    7. "result": {
    8. "page_index": 1,
    9. "page_size": 20,
    10. "total_pages": 1,
    11. "total_records": 1,
    12. "data": [
    13. {
    14. "statistics_id": "FuelConsumption",
    15. "statistics_name": "燃料消耗",
    16. "description": "每两小时燃料消耗的统计",
    17. "scheduled": "1",
    18. "pathfile": "/statistics_services/auto_generator/FuelConsumption.json",
    19. "template": "",
    20. "script": {
    21. "connector": {
    22. "INFLUXDB": {
    23. "host": "rnd.mixiot.top:8086"
    24. },
    25. "MYSQL": {
    26. "host": "rnd.mixiot.top:3306"
    27. }
    28. },
    29. "cycle": "5m",
    30. "description": "每两小时燃料消耗的统计",
    31. "expr": "accumulate(S19)",
    32. "name": "FuelConsumption",
    33. "result": {
    34. "precision": 3
    35. },
    36. "selection": {
    37. "filter_and": {
    38. "mappingID": [
    39. "1002"
    40. ]
    41. }
    42. },
    43. "source": {
    44. "MO": {
    45. "object": [
    46. "S19"
    47. ]
    48. }
    49. },
    50. "statistics_id": "FuelConsumption",
    51. "statos_name": "燃料消耗",
    52. "track": true
    53. },
    54. "reference": "",
    55. "auto_curdwm": null,
    56. "type": "",
    57. "stats": 1,
    58. "auto_dwm": 1,
    59. "created": "2018-09-07 12:02:45",
    60. "is_available": 1,
    61. "boss_sync": 0
    62. }
    63. ]
    64. }
    65. }

    2.4.1.7.24.3. 添加statistics

    调用接口:

    属性
    url/api/statistics/add
    http方法post
    Content-Typeapplication/json或application/x-www-form-urlencoded

    请求参数:

    字段字段名称字段类型说明是否必传
    statistics_id统计映射表标识String
    statistics_name统计映射表名称String
    description描述Text
    scheduled执行时间Datetime
    template模板/样式text
    script脚本text
    reference参考号String

    返回参数:

    字段字段名称字段类型说明是否必传
    code返回码Integer200:成功 500:失败
    msg提示信息String
    result返回结果Json

    返回示例:

    1. {
    2. "code": 200,
    3. "msg": "添加成功",
    4. "mix_code":130001,
    5. "mix_msg":"",
    6. "mix_ext":"",
    7. "result": []
    8. }

    2.4.1.7.24.4. 编辑statistics

    调用接口:

    属性
    url/api/statistics/edit
    http方法post
    Content-Typeapplication/json或application/x-www-form-urlencoded

    请求参数:

    字段字段名称字段类型说明是否必传
    statistics_id统计映射表标识String
    statistics_name统计映射表名称String
    description描述Text
    scheduled执行时间Datetime
    template模板/样式text
    script脚本text
    reference参考号String
    is_available是否有效Boolean1:是,0:否

    返回参数:

    字段字段名称字段类型说明是否必传
    code返回码Integer200:成功 500:失败
    msg提示信息String
    result返回结果Json

    返回示例:

    1. {
    2. "code": 200,
    3. "msg": "添加成功",
    4. "mix_code":130001,
    5. "mix_msg":"",
    6. "mix_ext":"",
    7. "result": []
    8. }

    2.4.1.7.24.5. 删除statistics

    调用接口:

    属性
    url/api/statistics/delete
    http方法post
    Content-Typeapplication/json或application/x-www-form-urlencoded

    请求参数:

    字段字段名称字段类型说明是否必传
    statistics_id统计映射表标识String

    返回参数:

    字段字段名称字段类型说明是否必传
    code返回码Integer200:成功 500:失败
    msg提示信息String
    result返回结果Json

    返回示例:

    1. {
    2. "code": 200,
    3. "msg": "删除成功",
    4. "mix_code":130001,
    5. "mix_msg":"",
    6. "mix_ext":"",
    7. "result": []
    8. }