Commit a988566f3c5859b05e9e8c1dd87d7491db487bf1

Authored by xp.Huang
1 parent d50fe949

feat: 数据库更新脚本(v1.2.1_v1.2.2)

... ... @@ -19,6 +19,8 @@ UPDATE "public"."sys_menu" SET "parent_id" = '6beed0bb-df31-43c4-ae38-66c1a24de9
19 19 INSERT INTO "public"."sys_dict_item"("id", "dict_id", "item_text", "item_value", "description", "sort", "status", "tenant_id", "creator", "create_time", "updater", "update_time") VALUES ('5a0ce281-e2f3-44cb-9ead-a62d63060e04', 'a1e13e20-cc41-48ea-8085-dfca512911b5', '语音通知', 'VOICE_MESSAGE', '通过语音电话通知', 1, 1, '13814000-1dd2-11b2-8080-808080808080', '80808080-8080-8080-8080-808080808080', '2023-12-13 10:46:02.203451', '80808080-8080-8080-8080-808080808080', '2023-12-13 10:46:15.623905');
20 20 INSERT INTO "public"."sys_dict_item"("id", "dict_id", "item_text", "item_value", "description", "sort", "status", "tenant_id", "creator", "create_time", "updater", "update_time") VALUES ('f8b914da-443d-4215-a6f2-66489156de4a', 'b453de11-b1c5-40f0-a048-3485862d387f', '阿里云语音平台', 'ALI_VOICE', '阿里云语音平台', 1, 1, '13814000-1dd2-11b2-8080-808080808080', '80808080-8080-8080-8080-808080808080', '2023-12-13 10:47:45.358334', NULL, NULL);
21 21
  22 +--物模型属性添加枚举值
  23 +INSERT INTO "public"."sys_dict_item"("id", "dict_id", "item_text", "item_value", "description", "sort", "status", "tenant_id", "creator", "create_time", "updater", "update_time") VALUES ('d1a40179-4956-4a21-9e72-3a5fed077306', '553f8e2c-8246-4ad5-8cd8-e6202aca058a', 'enum(枚举值)', 'ENUM', 'enum(枚举值)', 6, 1, '13814000-1dd2-11b2-8080-808080808080', '80808080-8080-8080-8080-808080808080', '2023-12-27 16:47:22.304029', '80808080-8080-8080-8080-808080808080', '2023-12-27 16:47:46.05208');
22 24
23 25 --插入视频流所用字典
24 26 INSERT INTO "public"."sys_dict"("id", "dict_name", "dict_code", "description", "tenant_id", "creator", "create_time", "updater", "update_time") VALUES ('773c10d0-2eac-4ff4-bd79-42644a8106a8', '流媒体平台类型', 'streaming_media_type', '用于区分流媒体平台类型', '13814000-1dd2-11b2-8080-808080808080', '80808080-8080-8080-8080-808080808080', '2023-12-19 17:19:48.095885', NULL, NULL);
... ... @@ -27,4 +29,21 @@ INSERT INTO "public"."sys_dict_item"("id", "dict_id", "item_text", "item_value",
27 29 INSERT INTO "public"."sys_dict_item"("id", "dict_id", "item_text", "item_value", "description", "sort", "status", "tenant_id", "creator", "create_time", "updater", "update_time") VALUES ('416ad944-f838-4444-8957-3da28d273b2d', '773c10d0-2eac-4ff4-bd79-42644a8106a8', '海康ISC平台', '0', NULL, 1, 1, '13814000-1dd2-11b2-8080-808080808080', '80808080-8080-8080-8080-808080808080', '2023-12-19 17:20:01.050091', '80808080-8080-8080-8080-808080808080', '2023-12-19 17:20:28.458445');
28 30
29 31 --移除不需要的表
30   -DROP TABLE IF EXISTS "public"."tk_device_user";
\ No newline at end of file
  32 +DROP TABLE IF EXISTS "public"."tk_device_user";
  33 +
  34 +--提供实时轨迹、设备历史轨迹
  35 +INSERT INTO "public"."tk_data_view_interface"("id", "interface_name", "request_content_type", "request_origin_url", "request_http_type", "request_url", "request_params", "state", "creator", "create_time", "updater", "update_time", "tenant_id", "remark", "interface_type", "filter") VALUES ('ed7eda3a-be5f-4a71-a5c8-4e137f6aab8c', '实时轨迹(适合设备实时轨迹地图)', 2, 'localhost', NULL, '/api/ws/plugins/telemetry', '{"requestSQLContent":{},"Params":[{"key":"deviceProfileId,organizationId,entityId,keys","value":"","mores":null,"editDisabled":true,"required":false}]}', 1, '80808080-8080-8080-8080-808080808080', '2023-12-26 14:24:50.001094', '80808080-8080-8080-8080-808080808080', '2023-12-26 14:25:37.070572', '13814000-1dd2-11b2-8080-808080808080', NULL, 'SYSTEM', 'return res');
  36 +
  37 +INSERT INTO "public"."tk_data_view_interface"("id", "interface_name", "request_content_type", "request_origin_url", "request_http_type", "request_url", "request_params", "state", "creator", "create_time", "updater", "update_time", "tenant_id", "remark", "interface_type", "filter") VALUES ('f65d5637-3e60-48d7-b3cc-6791fb3883fd', '设备历史轨迹(适合设备历史轨迹地图)', 0, 'localhost', 'GET', '/api/plugins/telemetry/{entityType}/{entityId}/values/timeseries{?agg,endTs,interval,keys,limit,orderBy,startTs,endTs,useStrictDataTypes}', '{"requestSQLContent":{},"Params":[{"key":"scope","value":"entityType","mores":null,"editDisabled":false,"required":true},{"key":"date_range","value":"startTs,endTs","mores":true,"editDisabled":true,"required":false},{"key":"deviceProfileId,organizationId,entityId,keys","value":"","mores":null,"editDisabled":true,"required":false}],"Header":[{"key":"ContentType","value":"none","required":false}]}', 1, '80808080-8080-8080-8080-808080808080', '2023-12-26 14:36:44.891373', '80808080-8080-8080-8080-808080808080', '2023-12-27 09:52:10.131713', '13814000-1dd2-11b2-8080-808080808080', NULL, 'SYSTEM', 'const longKey = ''longitude''
  38 +const latKey = ''latitude''
  39 +
  40 +let list = []
  41 +
  42 +res[longKey].forEach((longItem, longIndex) => {
  43 + list.push([
  44 + Number(longItem.value),
  45 + Number(res[latKey][longIndex].value),
  46 + ])
  47 +})
  48 +
  49 +return list.reverse()');
\ No newline at end of file
... ...