- 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-Type | application/json或application/x-www-form-urlencoded |
请求参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| page_index | 查询页码 | Integer | 大于 0,如果为空,则默认从第一页显示 | 否 |
| page_size | 每页记录数 | Integer | 大于 0,如果为空,则默认为 20 | 否 |
| condition | 查询条件 | Json | LIKE模糊搜索条件 | 否 |
| start_time | 开始时间 | Datetime | 按创建时间搜索的开始时间和结束时间 | 否 |
| end_time | 结束时间 | Datetime | 否 |
condition参数:
格式
[["${key}", "${operator}", "${value}"]] 即 [["查询值", "运算符", "查询内容"]]
举例
[["statistics_id", "=", "1001"]]
返回参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| code | 返回码 | Integer | 200:成功 500:失败 | 是 |
| msg | 提示信息 | String | 是 | |
| result | 结果 | Json | 是 |
返回数据举例:
{"code": 200,"msg": "查询成功","mix_code":130001,"mix_msg":"","mix_ext":"","result": {"page_index": 1,"page_size": 20,"total_pages": 1,"total_records": 1,"data": [{"statistics_id": "FuelConsumption","statistics_name": "燃料消耗","description": "每两小时燃料消耗的统计","scheduled": "1","pathfile": "/statistics_services/auto_generator/FuelConsumption.json","template": "","script": {"connector": {"INFLUXDB": {"host": "rnd.mixiot.top:8086"},"MYSQL": {"host": "rnd.mixiot.top:3306"}},"cycle": "5m","description": "每两小时燃料消耗的统计","expr": "accumulate(S19)","name": "FuelConsumption","result": {"precision": 3},"selection": {"filter_and": {"mappingID": ["1002"]}},"source": {"MO": {"object": ["S19"]}},"statistics_id": "FuelConsumption","statos_name": "燃料消耗","track": true},"reference": "","auto_curdwm": null,"type": "","stats": 1,"auto_dwm": 1,"created": "2018-09-07 12:02:45","is_available": 1,"boss_sync": 0}]}}
2.4.1.7.24.2. 查询Statistics指定记录
调用接口:
| 属性 | 值 |
|---|---|
| url | /api/statistics/get |
| http方法 | post |
| Content-Type | application/json或application/x-www-form-urlencoded |
请求参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| statistics_id | 统计计算标识 | String | 是 |
返回参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| code | 返回码 | Integer | 200:成功 500:失败 | 是 |
| msg | 提示信息 | String | 是 | |
| result | 返回结果 | Json | 是 |
返回示例:
{"code": 200,"msg": "查询成功","mix_code":130001,"mix_msg":"","mix_ext":"","result": {"page_index": 1,"page_size": 20,"total_pages": 1,"total_records": 1,"data": [{"statistics_id": "FuelConsumption","statistics_name": "燃料消耗","description": "每两小时燃料消耗的统计","scheduled": "1","pathfile": "/statistics_services/auto_generator/FuelConsumption.json","template": "","script": {"connector": {"INFLUXDB": {"host": "rnd.mixiot.top:8086"},"MYSQL": {"host": "rnd.mixiot.top:3306"}},"cycle": "5m","description": "每两小时燃料消耗的统计","expr": "accumulate(S19)","name": "FuelConsumption","result": {"precision": 3},"selection": {"filter_and": {"mappingID": ["1002"]}},"source": {"MO": {"object": ["S19"]}},"statistics_id": "FuelConsumption","statos_name": "燃料消耗","track": true},"reference": "","auto_curdwm": null,"type": "","stats": 1,"auto_dwm": 1,"created": "2018-09-07 12:02:45","is_available": 1,"boss_sync": 0}]}}
2.4.1.7.24.3. 添加statistics
调用接口:
| 属性 | 值 |
|---|---|
| url | /api/statistics/add |
| http方法 | post |
| Content-Type | application/json或application/x-www-form-urlencoded |
请求参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| statistics_id | 统计映射表标识 | String | 是 | |
| statistics_name | 统计映射表名称 | String | 是 | |
| description | 描述 | Text | 否 | |
| scheduled | 执行时间 | Datetime | 否 | |
| template | 模板/样式 | text | 否 | |
| script | 脚本 | text | 否 | |
| reference | 参考号 | String | 否 |
返回参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| code | 返回码 | Integer | 200:成功 500:失败 | 是 |
| msg | 提示信息 | String | 是 | |
| result | 返回结果 | Json | 是 |
返回示例:
{"code": 200,"msg": "添加成功","mix_code":130001,"mix_msg":"","mix_ext":"","result": []}
2.4.1.7.24.4. 编辑statistics
调用接口:
| 属性 | 值 |
|---|---|
| url | /api/statistics/edit |
| http方法 | post |
| Content-Type | application/json或application/x-www-form-urlencoded |
请求参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| statistics_id | 统计映射表标识 | String | 是 | |
| statistics_name | 统计映射表名称 | String | 是 | |
| description | 描述 | Text | 否 | |
| scheduled | 执行时间 | Datetime | 否 | |
| template | 模板/样式 | text | 否 | |
| script | 脚本 | text | 否 | |
| reference | 参考号 | String | 否 | |
| is_available | 是否有效 | Boolean | 1:是,0:否 | 否 |
返回参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| code | 返回码 | Integer | 200:成功 500:失败 | 是 |
| msg | 提示信息 | String | 是 | |
| result | 返回结果 | Json | 是 |
返回示例:
{"code": 200,"msg": "添加成功","mix_code":130001,"mix_msg":"","mix_ext":"","result": []}
2.4.1.7.24.5. 删除statistics
调用接口:
| 属性 | 值 |
|---|---|
| url | /api/statistics/delete |
| http方法 | post |
| Content-Type | application/json或application/x-www-form-urlencoded |
请求参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| statistics_id | 统计映射表标识 | String | 是 |
返回参数:
| 字段 | 字段名称 | 字段类型 | 说明 | 是否必传 |
|---|---|---|---|---|
| code | 返回码 | Integer | 200:成功 500:失败 | 是 |
| msg | 提示信息 | String | 是 | |
| result | 返回结果 | Json | 是 |
返回示例:
{"code": 200,"msg": "删除成功","mix_code":130001,"mix_msg":"","mix_ext":"","result": []}
