Commit 5639719879759c287a0c020818104b9e72ffc292

Authored by 648540858
2 parents 5632718d d72c1c0c

Merge branch 'postgresql' into wvp-28181-2.0

Showing 62 changed files with 1795 additions and 1564 deletions
doc/_media/logo.jpg 0 → 100644

102 KB

libs/jdbc-aarch/kingbase8-8.6.0.jar 0 → 100644
No preview for this file type
libs/jdbc-aarch/kingbase8-8.6.0.jre7.jar 0 → 100644
No preview for this file type
libs/jdbc-aarch/postgresql-42.2.9.jar 0 → 100644
No preview for this file type
libs/jdbc-aarch/postgresql-42.2.9.jre7.jar 0 → 100644
No preview for this file type
... ... @@ -135,11 +135,30 @@
135 135 <version>8.0.30</version>
136 136 </dependency>
137 137  
  138 + <!--postgresql-->
  139 + <dependency>
  140 + <groupId>org.postgresql</groupId>
  141 + <artifactId>postgresql</artifactId>
  142 + <version>42.5.1</version>
  143 + </dependency>
  144 +
  145 + <!-- kingbase人大金仓 -->
  146 + <!-- 手动下载驱动后安装 -->
  147 + <!-- mvn install:install-file -Dfile=/home/lin/soft/kingbase/jdbc-aarch/kingbase8-8.6.0.jar -DgroupId=com.kingbase -DartifactId=kingbase8 -Dversion=8.6.0 -Dpackaging=jar
  148 + -->
  149 + <dependency>
  150 + <groupId>com.kingbase</groupId>
  151 + <artifactId>kingbase8</artifactId>
  152 + <version>8.6.0</version>
  153 + <scope>system</scope>
  154 + <systemPath>${basedir}/libs/jdbc-aarch/kingbase8-8.6.0.jar</systemPath>
  155 + </dependency>
  156 +
138 157 <!--Mybatis分页插件 -->
139 158 <dependency>
140 159 <groupId>com.github.pagehelper</groupId>
141 160 <artifactId>pagehelper-spring-boot-starter</artifactId>
142   - <version>1.4.3</version>
  161 + <version>1.4.6</version>
143 162 </dependency>
144 163  
145 164 <!--在线文档 -->
... ...
sql/2.6.8升级2.6.9.sql 0 → 100644
  1 +alter table device
  2 + change deviceId device_id varchar(50) not null;
  3 +
  4 +alter table device
  5 + change streamMode stream_mode varchar(50) null;
  6 +
  7 +alter table device
  8 + change registerTime register_time varchar(50) null;
  9 +
  10 +alter table device
  11 + change keepaliveTime keepalive_time varchar(50) null;
  12 +
  13 +alter table device
  14 + change createTime create_time varchar(50) not null;
  15 +
  16 +alter table device
  17 + change updateTime update_time varchar(50) not null;
  18 +
  19 +alter table device
  20 + change subscribeCycleForCatalog subscribe_cycle_for_catalog bool default false;
  21 +
  22 +alter table device
  23 + change subscribeCycleForMobilePosition subscribe_cycle_for_mobile_position bool default false;
  24 +
  25 +alter table device
  26 + change mobilePositionSubmissionInterval mobile_position_submission_interval int default 5 not null;
  27 +
  28 +alter table device
  29 + change subscribeCycleForAlarm subscribe_cycle_for_alarm bool default false;
  30 +
  31 +alter table device
  32 + change hostAddress host_address varchar(50) null;
  33 +
  34 +alter table device
  35 + change ssrcCheck ssrc_check bool default false;
  36 +
  37 +alter table device
  38 + change geoCoordSys geo_coord_sys varchar(50) not null;
  39 +
  40 +alter table device
  41 + change treeType tree_type varchar(50) not null;
  42 +
  43 +alter table device
  44 + change mediaServerId media_server_id varchar(50) default 'auto' null;
  45 +
  46 +alter table device
  47 + change sdpIp sdp_ip varchar(50) null;
  48 +
  49 +alter table device
  50 + change localIp local_ip varchar(50) null;
  51 +
  52 +alter table device
  53 + change asMessageChannel as_message_channel bool default false;
  54 +
  55 +alter table device
  56 + change keepaliveIntervalTime keepalive_interval_time int null;
  57 +
  58 +alter table device
  59 + change online on_line varchar(50) null;
  60 +
  61 +alter table device_alarm
  62 + change deviceId device_id varchar(50) not null;
  63 +
  64 +alter table device_alarm
  65 + change channelId channel_id varchar(50) not null;
  66 +
  67 +alter table device_alarm
  68 + change alarmPriority alarm_priority varchar(50) not null;
  69 +
  70 +alter table device_alarm
  71 + change alarmMethod alarm_method varchar(50) null;
  72 +
  73 +alter table device_alarm
  74 + change alarmTime alarm_time varchar(50) not null;
  75 +
  76 +alter table device_alarm
  77 + change alarmDescription alarm_description varchar(255) null;
  78 +
  79 +alter table device_alarm
  80 + change alarmType alarm_type varchar(50) null;
  81 +
  82 +alter table device_alarm
  83 + change createTime create_time varchar(50) null;
  84 +
  85 +alter table device_channel
  86 + change channelId channel_id varchar(50) not null;
  87 +
  88 +alter table device_channel
  89 + change civilCode civil_code varchar(50) null;
  90 +
  91 +alter table device_channel
  92 + change parentId parent_id varchar(50) null;
  93 +
  94 +alter table device_channel
  95 + change safetyWay safety_way int null;
  96 +
  97 +alter table device_channel
  98 + change registerWay register_way int null;
  99 +
  100 +alter table device_channel
  101 + change certNum cert_num varchar(50) null;
  102 +
  103 +alter table device_channel
  104 + change errCode err_code int null;
  105 +
  106 +alter table device_channel
  107 + change endTime end_time varchar(50) null;
  108 +
  109 +alter table device_channel
  110 + change ipAddress ip_address varchar(50) null;
  111 +
  112 +alter table device_channel
  113 + change PTZType ptz_type int null;
  114 +
  115 +alter table device_channel
  116 + change status status bool default false;
  117 +
  118 +alter table device_channel
  119 + change streamId stream_id varchar(50) null;
  120 +
  121 +alter table device_channel
  122 + change deviceId device_id varchar(50) not null;
  123 +
  124 +
  125 +alter table device_channel
  126 + change hasAudio has_audio bool default false;
  127 +
  128 +alter table device_channel
  129 + change createTime create_time varchar(50) not null;
  130 +
  131 +alter table device_channel
  132 + change updateTime update_time varchar(50) not null;
  133 +
  134 +alter table device_channel
  135 + change subCount sub_count int default 0 null;
  136 +
  137 +alter table device_channel
  138 + change longitudeGcj02 longitude_gcj02 double null;
  139 +
  140 +alter table device_channel
  141 + change latitudeGcj02 latitude_gcj02 double null;
  142 +
  143 +alter table device_channel
  144 + change longitudeWgs84 longitude_wgs84 double null;
  145 +
  146 +alter table device_channel
  147 + change latitudeWgs84 latitude_wgs84 double null;
  148 +
  149 +alter table device_channel
  150 + change businessGroupId business_group_id varchar(50) null;
  151 +
  152 +alter table device_channel
  153 + change gpsTime gps_time varchar(50) null;
  154 +
  155 +alter table device_mobile_position
  156 + change deviceId device_id varchar(50) not null;
  157 +
  158 +alter table device_mobile_position
  159 + change channelId channel_id varchar(50) not null;
  160 +
  161 +alter table device_mobile_position
  162 + change deviceName device_name varchar(255) null;
  163 +
  164 +alter table device_mobile_position
  165 + change reportSource report_source varchar(50) null;
  166 +
  167 +alter table device_mobile_position
  168 + change longitudeGcj02 longitude_gcj02 double null;
  169 +
  170 +alter table device_mobile_position
  171 + change latitudeGcj02 latitude_gcj02 double null;
  172 +
  173 +alter table device_mobile_position
  174 + change longitudeWgs84 longitude_wgs84 double null;
  175 +
  176 +alter table device_mobile_position
  177 + change latitudeWgs84 latitude_wgs84 double null;
  178 +
  179 +alter table device_mobile_position
  180 + change createTime create_time varchar(50) null;
  181 +
  182 +alter table gb_stream
  183 + add constraint gb_stream_pk
  184 + primary key (gbStreamId);
  185 +
  186 +alter table gb_stream
  187 + change gbStreamId gb_stream_id int auto_increment;
  188 +
  189 +alter table gb_stream
  190 + change gbId gb_id varchar(50) not null;
  191 +
  192 +alter table gb_stream
  193 + change streamType stream_type varchar(50) null;
  194 +
  195 +alter table gb_stream
  196 + change mediaServerId media_server_id varchar(50) null;
  197 +
  198 +alter table gb_stream
  199 + change createTime create_time varchar(50) null;
  200 +
  201 +alter table log
  202 + change createTime create_time varchar(50) not null;
  203 +
  204 +alter table media_server
  205 + change hookIp hook_ip varchar(50) not null;
  206 +
  207 +alter table media_server
  208 + change sdpIp sdp_ip varchar(50) not null;
  209 +
  210 +alter table media_server
  211 + change streamIp stream_ip varchar(50) not null;
  212 +
  213 +alter table media_server
  214 + change httpPort http_port int not null;
  215 +
  216 +alter table media_server
  217 + change httpSSlPort http_ssl_port int not null;
  218 +
  219 +alter table media_server
  220 + change rtmpPort rtmp_port int not null;
  221 +
  222 +alter table media_server
  223 + change rtmpSSlPort rtmp_ssl_port int not null;
  224 +
  225 +alter table media_server
  226 + change rtpProxyPort rtp_proxy_port int not null;
  227 +
  228 +alter table media_server
  229 + change rtspPort rtsp_port int not null;
  230 +
  231 +alter table media_server
  232 + change rtspSSLPort rtsp_ssl_port int not null;
  233 +
  234 +alter table media_server
  235 + change autoConfig auto_config bool default true;
  236 +
  237 +alter table media_server
  238 + change rtpEnable rtp_enable bool default false;
  239 +
  240 +alter table media_server
  241 + change rtpPortRange rtp_port_range varchar(50) not null;
  242 +
  243 +alter table media_server
  244 + change recordAssistPort record_assist_port int not null;
  245 +
  246 +alter table media_server
  247 + change defaultServer default_server bool default false;
  248 +
  249 +alter table media_server
  250 + change createTime create_time varchar(50) not null;
  251 +
  252 +alter table media_server
  253 + change updateTime update_time varchar(50) not null;
  254 +
  255 +alter table media_server
  256 + change hookAliveInterval hook_alive_interval int not null;
  257 +
  258 +alter table parent_platform
  259 + change serverGBId server_gb_id varchar(50) not null;
  260 +
  261 +alter table parent_platform
  262 + change serverGBDomain server_gb_domain varchar(50) null;
  263 +
  264 +alter table parent_platform
  265 + change serverIP server_ip varchar(50) null;
  266 +
  267 +alter table parent_platform
  268 + change serverPort server_port int null;
  269 +
  270 +alter table parent_platform
  271 + change deviceGBId device_gb_id varchar(50) not null;
  272 +
  273 +alter table parent_platform
  274 + change deviceIp device_ip varchar(50) null;
  275 +
  276 +alter table parent_platform
  277 + change devicePort device_port varchar(50) null;
  278 +
  279 +alter table parent_platform
  280 + change keepTimeout keep_timeout varchar(50) null;
  281 +
  282 +alter table parent_platform
  283 + change characterSet character_set varchar(50) null;
  284 +
  285 +alter table parent_platform
  286 + change catalogId catalog_id varchar(50) not null;
  287 +
  288 +alter table parent_platform
  289 + change startOfflinePush start_offline_push bool default false;
  290 +
  291 +alter table parent_platform
  292 + change administrativeDivision administrative_division varchar(50) not null;
  293 +
  294 +alter table parent_platform
  295 + change catalogGroup catalog_group int default 1 null;
  296 +
  297 +alter table parent_platform
  298 + change createTime create_time varchar(50) null;
  299 +
  300 +alter table parent_platform
  301 + change updateTime update_time varchar(50) null;
  302 +
  303 +alter table parent_platform
  304 + change treeType tree_type varchar(50) not null;
  305 +
  306 +alter table parent_platform
  307 + change asMessageChannel as_message_channel bool default false;
  308 +
  309 +alter table parent_platform
  310 + change enable enable bool default false;
  311 +
  312 +alter table parent_platform
  313 + change ptz ptz bool default false;
  314 +
  315 +alter table parent_platform
  316 + change rtcp rtcp bool default false;
  317 +
  318 +alter table parent_platform
  319 + change status status bool default false;
  320 +
  321 +alter table parent_platform
  322 + change status status bool default false;
  323 +
  324 +alter table platform_catalog
  325 + change platformId platform_id varchar(50) not null;
  326 +
  327 +alter table platform_catalog
  328 + change parentId parent_id varchar(50) null;
  329 +
  330 +alter table platform_catalog
  331 + change civilCode civil_code varchar(50) null;
  332 +
  333 +alter table platform_catalog
  334 + change businessGroupId business_group_id varchar(50) null;
  335 +
  336 +alter table platform_gb_channel
  337 + change platformId platform_id varchar(50) not null;
  338 +
  339 +alter table platform_gb_channel
  340 + change catalogId catalog_id varchar(50) not null;
  341 +
  342 +alter table platform_gb_channel
  343 + change deviceChannelId device_channel_id int not null;
  344 +
  345 +alter table platform_gb_stream
  346 + change platformId platform_id varchar(50) not null;
  347 +
  348 +alter table platform_gb_stream
  349 + change catalogId catalog_id varchar(50) not null;
  350 +
  351 +alter table platform_gb_stream
  352 + change gbStreamId gb_stream_id int not null;
  353 +
  354 +alter table stream_proxy
  355 + change mediaServerId media_server_id varchar(50) null;
  356 +
  357 +alter table stream_proxy
  358 + change createTime create_time varchar(50) not null;
  359 +
  360 +alter table stream_proxy
  361 + change updateTime update_time varchar(50) null;
  362 +
  363 +alter table stream_proxy
  364 + change enable_remove_none_reader enable_remove_none_reader bool default false;
  365 +
  366 +alter table stream_proxy
  367 + change enable_disable_none_reader enable_disable_none_reader bool default false;
  368 +
  369 +alter table stream_proxy
  370 + change enable_audio enable_audio bool default false;
  371 +
  372 +alter table stream_proxy
  373 + change enable_mp4 enable_mp4 bool default false;
  374 +
  375 +alter table stream_proxy
  376 + change enable enable bool default false;
  377 +
  378 +alter table stream_push
  379 + change totalReaderCount total_reader_count varchar(50) null;
  380 +
  381 +alter table stream_push
  382 + change originType origin_type int null;
  383 +
  384 +alter table stream_push
  385 + change originTypeStr origin_type_str varchar(50) null;
  386 +
  387 +alter table stream_push
  388 + change createTime create_time varchar(50) null;
  389 +
  390 +alter table stream_push
  391 + change aliveSecond alive_second int null;
  392 +
  393 +alter table stream_push
  394 + change mediaServerId media_server_id varchar(50) null;
  395 +
  396 +alter table stream_push
  397 + change status status bool default false;
  398 +
  399 +alter table stream_push
  400 + change pushTime push_time varchar(50) null;
  401 +
  402 +alter table stream_push
  403 + change updateTime update_time varchar(50) null;
  404 +
  405 +alter table stream_push
  406 + change pushIng push_ing bool default false;
  407 +
  408 +alter table stream_push
  409 + change status status bool default false;
  410 +
  411 +alter table stream_push
  412 + change self self bool default false;
  413 +
  414 +alter table stream_push
  415 + drop column serverId;
  416 +
  417 +
  418 +alter table user
  419 + change roleId role_id int not null;
  420 +
  421 +alter table user
  422 + change createTime create_time varchar(50) not null;
  423 +
  424 +alter table user
  425 + change updateTime update_time varchar(50) not null;
  426 +
  427 +alter table user
  428 + change pushKey push_key varchar(50) null;
  429 +
  430 +alter table user_role
  431 + change createTime create_time varchar(50) not null;
  432 +
  433 +alter table user_role
  434 + change updateTime update_time varchar(50) not null;
  435 +
  436 +rename table device to wvp_device;
  437 +rename table device_alarm to wvp_device_alarm;
  438 +rename table device_channel to wvp_device_channel;
  439 +rename table device_mobile_position to wvp_device_mobile_position;
  440 +rename table gb_stream to wvp_gb_stream;
  441 +rename table log to wvp_log;
  442 +rename table media_server to wvp_media_server;
  443 +rename table parent_platform to wvp_platform;
  444 +rename table platform_catalog to wvp_platform_catalog;
  445 +rename table platform_gb_channel to wvp_platform_gb_channel;
  446 +rename table platform_gb_stream to wvp_platform_gb_stream;
  447 +rename table stream_proxy to wvp_stream_proxy;
  448 +rename table stream_push to wvp_stream_push;
  449 +rename table user to wvp_user;
  450 +rename table user_role to wvp_user_role;
  451 +
  452 +
  453 +
  454 +
  455 +
  456 +
  457 +
  458 +
  459 +
  460 +
  461 +
  462 +
  463 +
  464 +
  465 +
  466 +
  467 +
  468 +
  469 +
  470 +
  471 +
  472 +
  473 +
  474 +
  475 +
  476 +
  477 +
  478 +
  479 +
... ...
sql/clean.sql
1   -delete from device;
2   -delete from device_alarm;
3   -delete from device_channel;
4   -delete from device_mobile_position;
5   -delete from gb_stream;
6   -delete from log;
7   -delete from media_server;
8   -delete from parent_platform;
9   -delete from platform_catalog;
10   -delete from platform_gb_channel;
11   -delete from platform_gb_stream;
12   -delete from stream_proxy;
13   -delete from stream_push;
14 1 \ No newline at end of file
  2 +delete from wvp-device;
  3 +delete from wvp-device_alarm;
  4 +delete from wvp-device_channel;
  5 +delete from wvp-device_mobile_position;
  6 +delete from wvp-gb_stream;
  7 +delete from wvp-log;
  8 +delete from wvp-media_server;
  9 +delete from wvp-parent_platform;
  10 +delete from wvp-platform_catalog;
  11 +delete from wvp-platform_gb_channel;
  12 +delete from wvp-platform_gb_stream;
  13 +delete from wvp-stream_proxy;
  14 +delete from wvp-stream_push;
15 15 \ No newline at end of file
... ...
sql/初始化.sql
1   --- MySQL dump 10.13 Distrib 8.0.31, for Linux (x86_64)
2   ---
3   --- Host: 127.0.0.1 Database: wvp
4   --- ------------------------------------------------------
5   --- Server version 8.0.30
  1 +/*建表*/
  2 +create table wvp_device (
  3 + id serial primary key ,
  4 + device_id character varying(50) not null ,
  5 + name character varying(255),
  6 + manufacturer character varying(255),
  7 + model character varying(255),
  8 + firmware character varying(255),
  9 + transport character varying(50),
  10 + stream_mode character varying(50),
  11 + on_line bool default false,
  12 + register_time character varying(50),
  13 + keepalive_time character varying(50),
  14 + ip character varying(50),
  15 + create_time character varying(50),
  16 + update_time character varying(50),
  17 + port integer,
  18 + expires integer,
  19 + subscribe_cycle_for_catalog integer DEFAULT 0,
  20 + subscribe_cycle_for_mobile_position integer DEFAULT 0,
  21 + mobile_position_submission_interval integer DEFAULT 5,
  22 + subscribe_cycle_for_alarm integer DEFAULT 0,
  23 + host_address character varying(50),
  24 + charset character varying(50),
  25 + ssrc_check bool default false,
  26 + geo_coord_sys character varying(50),
  27 + tree_type character varying(50),
  28 + media_server_id character varying(50),
  29 + custom_name character varying(255),
  30 + sdp_ip character varying(50),
  31 + local_ip character varying(50),
  32 + password character varying(255),
  33 + as_message_channel bool default false,
  34 + keepalive_interval_time integer,
  35 + constraint uk_device_device unique (device_id)
  36 +);
  37 +
  38 +create table wvp_device_alarm (
  39 + id serial primary key ,
  40 + device_id character varying(50) not null,
  41 + channel_id character varying(50) not null,
  42 + alarm_priority character varying(50),
  43 + alarm_method character varying(50),
  44 + alarm_time character varying(50),
  45 + alarm_description character varying(255),
  46 + longitude double precision,
  47 + latitude double precision,
  48 + alarm_type character varying(50),
  49 + create_time character varying(50) not null
  50 +);
  51 +
  52 +create table wvp_device_channel (
  53 + id serial primary key ,
  54 + channel_id character varying(50) not null,
  55 + name character varying(255),
  56 + manufacture character varying(50),
  57 + model character varying(50),
  58 + owner character varying(50),
  59 + civil_code character varying(50),
  60 + block character varying(50),
  61 + address character varying(50),
  62 + parent_id character varying(50),
  63 + safety_way integer,
  64 + register_way integer,
  65 + cert_num character varying(50),
  66 + certifiable integer,
  67 + err_code integer,
  68 + end_time character varying(50),
  69 + secrecy character varying(50),
  70 + ip_address character varying(50),
  71 + port integer,
  72 + password character varying(255),
  73 + ptz_type integer,
  74 + status bool default false,
  75 + longitude double precision,
  76 + latitude double precision,
  77 + stream_id character varying(50),
  78 + device_id character varying(50) not null,
  79 + parental character varying(50),
  80 + has_audio bool default false,
  81 + create_time character varying(50) not null,
  82 + update_time character varying(50) not null,
  83 + sub_count integer,
  84 + longitude_gcj02 double precision,
  85 + latitude_gcj02 double precision,
  86 + longitude_wgs84 double precision,
  87 + latitude_wgs84 double precision,
  88 + business_group_id character varying(50),
  89 + gps_time character varying(50),
  90 + constraint uk_wvp_device_channel_unique_device_channel unique (device_id, channel_id)
  91 +);
  92 +
  93 +create table wvp_device_mobile_position (
  94 + id serial primary key,
  95 + device_id character varying(50) not null,
  96 + channel_id character varying(50) not null,
  97 + device_name character varying(255),
  98 + time character varying(50),
  99 + longitude double precision,
  100 + latitude double precision,
  101 + altitude double precision,
  102 + speed double precision,
  103 + direction double precision,
  104 + report_source character varying(50),
  105 + longitude_gcj02 double precision,
  106 + latitude_gcj02 double precision,
  107 + longitude_wgs84 double precision,
  108 + latitude_wgs84 double precision,
  109 + create_time character varying(50)
  110 +);
  111 +
  112 +create table wvp_gb_stream (
  113 + gb_stream_id serial primary key,
  114 + app character varying(255) not null,
  115 + stream character varying(255) not null,
  116 + gb_id character varying(50) not null,
  117 + name character varying(255),
  118 + longitude double precision,
  119 + latitude double precision,
  120 + stream_type character varying(50),
  121 + media_server_id character varying(50),
  122 + create_time character varying(50),
  123 + constraint uk_gb_stream_unique_gb_id unique (gb_id),
  124 + constraint uk_gb_stream_unique_app_stream unique (app, stream)
  125 +);
  126 +
  127 +create table wvp_log (
  128 + id serial primary key ,
  129 + name character varying(50),
  130 + type character varying(50),
  131 + uri character varying(200),
  132 + address character varying(50),
  133 + result character varying(50),
  134 + timing bigint,
  135 + username character varying(50),
  136 + create_time character varying(50)
  137 +);
  138 +
  139 +create table wvp_media_server (
  140 + id character varying(255) primary key ,
  141 + ip character varying(50),
  142 + hook_ip character varying(50),
  143 + sdp_ip character varying(50),
  144 + stream_ip character varying(50),
  145 + http_port integer,
  146 + http_ssl_port integer,
  147 + rtmp_port integer,
  148 + rtmp_ssl_port integer,
  149 + rtp_proxy_port integer,
  150 + rtsp_port integer,
  151 + rtsp_ssl_port integer,
  152 + auto_config bool default false,
  153 + secret character varying(50),
  154 + rtp_enable bool default false,
  155 + rtp_port_range character varying(50),
  156 + record_assist_port integer,
  157 + default_server bool default false,
  158 + create_time character varying(50),
  159 + update_time character varying(50),
  160 + hook_alive_interval integer,
  161 + constraint uk_media_server_unique_ip_http_port unique (ip, http_port)
  162 +);
  163 +
  164 +create table wvp_platform (
  165 + id serial primary key ,
  166 + enable bool default false,
  167 + name character varying(255),
  168 + server_gb_id character varying(50),
  169 + server_gb_domain character varying(50),
  170 + server_ip character varying(50),
  171 + server_port integer,
  172 + device_gb_id character varying(50),
  173 + device_ip character varying(50),
  174 + device_port character varying(50),
  175 + username character varying(255),
  176 + password character varying(50),
  177 + expires character varying(50),
  178 + keep_timeout character varying(50),
  179 + transport character varying(50),
  180 + character_set character varying(50),
  181 + catalog_id character varying(50),
  182 + ptz bool default false,
  183 + rtcp bool default false,
  184 + status bool default false,
  185 + start_offline_push bool default false,
  186 + administrative_division character varying(50),
  187 + catalog_group integer,
  188 + create_time character varying(50),
  189 + update_time character varying(50),
  190 + tree_type character varying(50),
  191 + as_message_channel bool default false,
  192 + constraint uk_platform_unique_server_gb_id unique (server_gb_id)
  193 +);
  194 +
  195 +create table wvp_platform_catalog (
  196 + id character varying(50),
  197 + platform_id character varying(50),
  198 + name character varying(255),
  199 + parent_id character varying(50),
  200 + civil_code character varying(50),
  201 + business_group_id character varying(50),
  202 + constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
  203 +);
  204 +
  205 +create table wvp_platform_gb_channel (
  206 + id serial primary key ,
  207 + platform_id character varying(50),
  208 + catalog_id character varying(50),
  209 + device_channel_id integer,
  210 + constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, catalog_id, device_channel_id)
  211 +);
  212 +
  213 +create table wvp_platform_gb_stream (
  214 + id serial primary key,
  215 + platform_id character varying(50),
  216 + catalog_id character varying(50),
  217 + gb_stream_id integer,
  218 + constraint uk_platform_gb_stream_platform_id_catalog_id_gb_stream_id unique (platform_id, catalog_id, gb_stream_id)
  219 +);
  220 +
  221 +create table wvp_stream_proxy (
  222 + id serial primary key,
  223 + type character varying(50),
  224 + app character varying(255),
  225 + stream character varying(255),
  226 + url character varying(255),
  227 + src_url character varying(255),
  228 + dst_url character varying(255),
  229 + timeout_ms integer,
  230 + ffmpeg_cmd_key character varying(255),
  231 + rtp_type character varying(50),
  232 + media_server_id character varying(50),
  233 + enable_audio bool default false,
  234 + enable_mp4 bool default false,
  235 + enable bool default false,
  236 + status boolean,
  237 + enable_remove_none_reader bool default false,
  238 + create_time character varying(50),
  239 + name character varying(255),
  240 + update_time character varying(50),
  241 + enable_disable_none_reader bool default false,
  242 + constraint uk_stream_proxy_app_stream unique (app, stream)
  243 +);
  244 +
  245 +create table wvp_stream_push (
  246 + id serial primary key,
  247 + app character varying(255),
  248 + stream character varying(255),
  249 + total_reader_count character varying(50),
  250 + origin_type integer,
  251 + origin_type_str character varying(50),
  252 + create_time character varying(50),
  253 + alive_second integer,
  254 + media_server_id character varying(50),
  255 + push_time character varying(50),
  256 + status bool default false,
  257 + update_time character varying(50),
  258 + push_ing bool default false,
  259 + self bool default false,
  260 + constraint uk_stream_push_app_stream unique (app, stream)
  261 +);
  262 +
  263 +create table wvp_user (
  264 + id serial primary key,
  265 + username character varying(255),
  266 + password character varying(255),
  267 + role_id integer,
  268 + create_time character varying(50),
  269 + update_time character varying(50),
  270 + push_key character varying(50),
  271 + constraint uk_user_username unique (username)
  272 +);
  273 +
  274 +create table wvp_user_role (
  275 + id serial primary key,
  276 + name character varying(50),
  277 + authority character varying(50),
  278 + create_time character varying(50),
  279 + update_time character varying(50)
  280 +);
  281 +
  282 +/*初始数据*/
  283 +INSERT INTO wvp_user VALUES (1, 'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3');
  284 +INSERT INTO wvp_user_role VALUES (1, 'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
6 285  
7   -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8   -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9   -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10   -/*!50503 SET NAMES utf8mb4 */;
11   -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12   -/*!40103 SET TIME_ZONE='+00:00' */;
13   -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14   -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15   -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16   -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 286  
18   ---
19   --- Table structure for table `device`
20   ---
21 287  
22   -DROP TABLE IF EXISTS `device`;
23   -/*!40101 SET @saved_cs_client = @@character_set_client */;
24   -/*!50503 SET character_set_client = utf8mb4 */;
25   -CREATE TABLE `device` (
26   - `id` int NOT NULL AUTO_INCREMENT,
27   - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
28   - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
29   - `manufacturer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
30   - `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
31   - `firmware` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
32   - `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
33   - `streamMode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
34   - `online` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
35   - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
36   - `registerTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
37   - `keepaliveTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
38   - `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
39   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
40   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
41   - `port` int DEFAULT NULL,
42   - `expires` int DEFAULT NULL,
43   - `keepaliveIntervalTime` int DEFAULT NULL,
44   - `subscribeCycleForCatalog` int DEFAULT NULL,
45   - `hostAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
46   - `charset` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
47   - `subscribeCycleForMobilePosition` int DEFAULT NULL,
48   - `mobilePositionSubmissionInterval` int DEFAULT '5',
49   - `subscribeCycleForAlarm` int DEFAULT NULL,
50   - `ssrcCheck` int DEFAULT '0',
51   - `asMessageChannel` int DEFAULT '0',
52   - `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
53   - `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
54   - `custom_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
55   - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
56   - `sdpIp` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
57   - `localIp` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
58   - PRIMARY KEY (`id`),
59   - UNIQUE KEY `device_deviceId_uindex` (`deviceId`)
60   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
61   -/*!40101 SET character_set_client = @saved_cs_client */;
62   -
63   ---
64   --- Dumping data for table `device`
65   ---
66   -
67   -LOCK TABLES `device` WRITE;
68   -/*!40000 ALTER TABLE `device` DISABLE KEYS */;
69   -/*!40000 ALTER TABLE `device` ENABLE KEYS */;
70   -UNLOCK TABLES;
71   -
72   ---
73   --- Table structure for table `device_alarm`
74   ---
75   -
76   -DROP TABLE IF EXISTS `device_alarm`;
77   -/*!40101 SET @saved_cs_client = @@character_set_client */;
78   -/*!50503 SET character_set_client = utf8mb4 */;
79   -CREATE TABLE `device_alarm` (
80   - `id` int NOT NULL AUTO_INCREMENT,
81   - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
82   - `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
83   - `alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
84   - `alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
85   - `alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
86   - `alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
87   - `longitude` double DEFAULT NULL,
88   - `latitude` double DEFAULT NULL,
89   - `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
90   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
91   - PRIMARY KEY (`id`) USING BTREE
92   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
93   -/*!40101 SET character_set_client = @saved_cs_client */;
94   -
95   ---
96   --- Dumping data for table `device_alarm`
97   ---
98   -
99   -LOCK TABLES `device_alarm` WRITE;
100   -/*!40000 ALTER TABLE `device_alarm` DISABLE KEYS */;
101   -/*!40000 ALTER TABLE `device_alarm` ENABLE KEYS */;
102   -UNLOCK TABLES;
103   -
104   ---
105   --- Table structure for table `device_channel`
106   ---
107   -
108   -DROP TABLE IF EXISTS `device_channel`;
109   -/*!40101 SET @saved_cs_client = @@character_set_client */;
110   -/*!50503 SET character_set_client = utf8mb4 */;
111   -CREATE TABLE `device_channel` (
112   - `id` int NOT NULL AUTO_INCREMENT,
113   - `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
114   - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
115   - `manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
116   - `model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
117   - `owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
118   - `civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
119   - `block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
120   - `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
121   - `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
122   - `safetyWay` int DEFAULT NULL,
123   - `registerWay` int DEFAULT NULL,
124   - `certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
125   - `certifiable` int DEFAULT NULL,
126   - `errCode` int DEFAULT NULL,
127   - `endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
128   - `secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
129   - `ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
130   - `port` int DEFAULT NULL,
131   - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
132   - `PTZType` int DEFAULT NULL,
133   - `status` int DEFAULT NULL,
134   - `longitude` double DEFAULT NULL,
135   - `latitude` double DEFAULT NULL,
136   - `streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
137   - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
138   - `parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
139   - `hasAudio` bit(1) DEFAULT NULL,
140   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
141   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
142   - `subCount` int DEFAULT '0',
143   - `longitudeGcj02` double DEFAULT NULL,
144   - `latitudeGcj02` double DEFAULT NULL,
145   - `longitudeWgs84` double DEFAULT NULL,
146   - `latitudeWgs84` double DEFAULT NULL,
147   - `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
148   - `gpsTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
149   - PRIMARY KEY (`id`),
150   - UNIQUE KEY `device_channel_id_uindex` (`id`),
151   - UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`)
152   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
153   -/*!40101 SET character_set_client = @saved_cs_client */;
154   -
155   ---
156   --- Dumping data for table `device_channel`
157   ---
158   -
159   -LOCK TABLES `device_channel` WRITE;
160   -/*!40000 ALTER TABLE `device_channel` DISABLE KEYS */;
161   -/*!40000 ALTER TABLE `device_channel` ENABLE KEYS */;
162   -UNLOCK TABLES;
163   -
164   ---
165   --- Table structure for table `device_mobile_position`
166   ---
167   -
168   -DROP TABLE IF EXISTS `device_mobile_position`;
169   -/*!40101 SET @saved_cs_client = @@character_set_client */;
170   -/*!50503 SET character_set_client = utf8mb4 */;
171   -CREATE TABLE `device_mobile_position` (
172   - `id` int NOT NULL AUTO_INCREMENT,
173   - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
174   - `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
175   - `deviceName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
176   - `time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
177   - `longitude` double NOT NULL,
178   - `latitude` double NOT NULL,
179   - `altitude` double DEFAULT NULL,
180   - `speed` double DEFAULT NULL,
181   - `direction` double DEFAULT NULL,
182   - `reportSource` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
183   - `longitudeGcj02` double DEFAULT NULL,
184   - `latitudeGcj02` double DEFAULT NULL,
185   - `longitudeWgs84` double DEFAULT NULL,
186   - `latitudeWgs84` double DEFAULT NULL,
187   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
188   - PRIMARY KEY (`id`)
189   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
190   -/*!40101 SET character_set_client = @saved_cs_client */;
191   -
192   ---
193   --- Dumping data for table `device_mobile_position`
194   ---
195   -
196   -LOCK TABLES `device_mobile_position` WRITE;
197   -/*!40000 ALTER TABLE `device_mobile_position` DISABLE KEYS */;
198   -/*!40000 ALTER TABLE `device_mobile_position` ENABLE KEYS */;
199   -UNLOCK TABLES;
200   -
201   ---
202   --- Table structure for table `gb_stream`
203   ---
204   -
205   -DROP TABLE IF EXISTS `gb_stream`;
206   -/*!40101 SET @saved_cs_client = @@character_set_client */;
207   -/*!50503 SET character_set_client = utf8mb4 */;
208   -CREATE TABLE `gb_stream` (
209   - `gbStreamId` int NOT NULL AUTO_INCREMENT,
210   - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
211   - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
212   - `gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
213   - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
214   - `longitude` double DEFAULT NULL,
215   - `latitude` double DEFAULT NULL,
216   - `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
217   - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
218   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
219   - PRIMARY KEY (`gbStreamId`) USING BTREE,
220   - UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
221   - UNIQUE KEY `gbId` (`gbId`) USING BTREE
222   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
223   -/*!40101 SET character_set_client = @saved_cs_client */;
224   -
225   ---
226   --- Dumping data for table `gb_stream`
227   ---
228   -
229   -LOCK TABLES `gb_stream` WRITE;
230   -/*!40000 ALTER TABLE `gb_stream` DISABLE KEYS */;
231   -/*!40000 ALTER TABLE `gb_stream` ENABLE KEYS */;
232   -UNLOCK TABLES;
233   -
234   ---
235   --- Table structure for table `log`
236   ---
237   -
238   -DROP TABLE IF EXISTS `log`;
239   -/*!40101 SET @saved_cs_client = @@character_set_client */;
240   -/*!50503 SET character_set_client = utf8mb4 */;
241   -CREATE TABLE `log` (
242   - `id` int NOT NULL AUTO_INCREMENT,
243   - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
244   - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
245   - `uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
246   - `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
247   - `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
248   - `timing` bigint NOT NULL,
249   - `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
250   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
251   - PRIMARY KEY (`id`) USING BTREE
252   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
253   -/*!40101 SET character_set_client = @saved_cs_client */;
254   -
255   ---
256   --- Dumping data for table `log`
257   ---
258   -
259   -LOCK TABLES `log` WRITE;
260   -/*!40000 ALTER TABLE `log` DISABLE KEYS */;
261   -/*!40000 ALTER TABLE `log` ENABLE KEYS */;
262   -UNLOCK TABLES;
263   -
264   ---
265   --- Table structure for table `media_server`
266   ---
267   -
268   -DROP TABLE IF EXISTS `media_server`;
269   -/*!40101 SET @saved_cs_client = @@character_set_client */;
270   -/*!50503 SET character_set_client = utf8mb4 */;
271   -CREATE TABLE `media_server` (
272   - `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
273   - `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
274   - `hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
275   - `sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
276   - `streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
277   - `httpPort` int NOT NULL,
278   - `httpSSlPort` int NOT NULL,
279   - `rtmpPort` int NOT NULL,
280   - `rtmpSSlPort` int NOT NULL,
281   - `rtpProxyPort` int NOT NULL,
282   - `rtspPort` int NOT NULL,
283   - `rtspSSLPort` int NOT NULL,
284   - `autoConfig` int NOT NULL,
285   - `secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
286   - `rtpEnable` int NOT NULL,
287   - `rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
288   - `recordAssistPort` int NOT NULL,
289   - `defaultServer` int NOT NULL,
290   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
291   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
292   - `hookAliveInterval` int NOT NULL,
293   - PRIMARY KEY (`id`) USING BTREE,
294   - UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE
295   -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
296   -/*!40101 SET character_set_client = @saved_cs_client */;
297   -
298   ---
299   --- Dumping data for table `media_server`
300   ---
301   -
302   -LOCK TABLES `media_server` WRITE;
303   -/*!40000 ALTER TABLE `media_server` DISABLE KEYS */;
304   -/*!40000 ALTER TABLE `media_server` ENABLE KEYS */;
305   -UNLOCK TABLES;
306   -
307   ---
308   --- Table structure for table `parent_platform`
309   ---
310   -
311   -DROP TABLE IF EXISTS `parent_platform`;
312   -/*!40101 SET @saved_cs_client = @@character_set_client */;
313   -/*!50503 SET character_set_client = utf8mb4 */;
314   -CREATE TABLE `parent_platform` (
315   - `id` int NOT NULL AUTO_INCREMENT,
316   - `enable` int DEFAULT NULL,
317   - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
318   - `serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
319   - `serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
320   - `serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
321   - `serverPort` int DEFAULT NULL,
322   - `deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
323   - `deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
324   - `devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
325   - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
326   - `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
327   - `expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
328   - `keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
329   - `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
330   - `characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
331   - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
332   - `ptz` int DEFAULT NULL,
333   - `rtcp` int DEFAULT NULL,
334   - `asMessageChannel` int DEFAULT '0',
335   - `status` bit(1) DEFAULT NULL,
336   - `startOfflinePush` int DEFAULT '0',
337   - `administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
338   - `catalogGroup` int DEFAULT '1',
339   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
340   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
341   - `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
342   - PRIMARY KEY (`id`),
343   - UNIQUE KEY `parent_platform_id_uindex` (`id`),
344   - UNIQUE KEY `parent_platform_pk` (`serverGBId`)
345   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
346   -/*!40101 SET character_set_client = @saved_cs_client */;
347   -
348   ---
349   --- Dumping data for table `parent_platform`
350   ---
351   -
352   -LOCK TABLES `parent_platform` WRITE;
353   -/*!40000 ALTER TABLE `parent_platform` DISABLE KEYS */;
354   -/*!40000 ALTER TABLE `parent_platform` ENABLE KEYS */;
355   -UNLOCK TABLES;
356   -
357   ---
358   --- Table structure for table `platform_catalog`
359   ---
360   -
361   -DROP TABLE IF EXISTS `platform_catalog`;
362   -/*!40101 SET @saved_cs_client = @@character_set_client */;
363   -/*!50503 SET character_set_client = utf8mb4 */;
364   -CREATE TABLE `platform_catalog` (
365   - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
366   - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
367   - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
368   - `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
369   - `civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
370   - `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
371   - PRIMARY KEY (`id`) USING BTREE
372   -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
373   -/*!40101 SET character_set_client = @saved_cs_client */;
374   -
375   ---
376   --- Dumping data for table `platform_catalog`
377   ---
378   -
379   -LOCK TABLES `platform_catalog` WRITE;
380   -/*!40000 ALTER TABLE `platform_catalog` DISABLE KEYS */;
381   -/*!40000 ALTER TABLE `platform_catalog` ENABLE KEYS */;
382   -UNLOCK TABLES;
383   -
384   ---
385   --- Table structure for table `platform_gb_channel`
386   ---
387   -
388   -DROP TABLE IF EXISTS `platform_gb_channel`;
389   -/*!40101 SET @saved_cs_client = @@character_set_client */;
390   -/*!50503 SET character_set_client = utf8mb4 */;
391   -CREATE TABLE `platform_gb_channel` (
392   - `id` int NOT NULL AUTO_INCREMENT,
393   - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
394   - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
395   - `deviceChannelId` int NOT NULL,
396   - PRIMARY KEY (`id`)
397   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
398   -/*!40101 SET character_set_client = @saved_cs_client */;
399   -
400   ---
401   --- Dumping data for table `platform_gb_channel`
402   ---
403   -
404   -LOCK TABLES `platform_gb_channel` WRITE;
405   -/*!40000 ALTER TABLE `platform_gb_channel` DISABLE KEYS */;
406   -/*!40000 ALTER TABLE `platform_gb_channel` ENABLE KEYS */;
407   -UNLOCK TABLES;
408   -
409   ---
410   --- Table structure for table `platform_gb_stream`
411   ---
412   -
413   -DROP TABLE IF EXISTS `platform_gb_stream`;
414   -/*!40101 SET @saved_cs_client = @@character_set_client */;
415   -/*!50503 SET character_set_client = utf8mb4 */;
416   -CREATE TABLE `platform_gb_stream` (
417   - `id` int NOT NULL AUTO_INCREMENT,
418   - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
419   - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
420   - `gbStreamId` int NOT NULL,
421   - PRIMARY KEY (`id`),
422   - UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`)
423   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
424   -/*!40101 SET character_set_client = @saved_cs_client */;
425   -
426   ---
427   --- Dumping data for table `platform_gb_stream`
428   ---
429   -
430   -LOCK TABLES `platform_gb_stream` WRITE;
431   -/*!40000 ALTER TABLE `platform_gb_stream` DISABLE KEYS */;
432   -/*!40000 ALTER TABLE `platform_gb_stream` ENABLE KEYS */;
433   -UNLOCK TABLES;
434   -
435   ---
436   --- Table structure for table `stream_proxy`
437   ---
438   -
439   -DROP TABLE IF EXISTS `stream_proxy`;
440   -/*!40101 SET @saved_cs_client = @@character_set_client */;
441   -/*!50503 SET character_set_client = utf8mb4 */;
442   -CREATE TABLE `stream_proxy` (
443   - `id` int NOT NULL AUTO_INCREMENT,
444   - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
445   - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
446   - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
447   - `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
448   - `src_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
449   - `dst_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
450   - `timeout_ms` int DEFAULT NULL,
451   - `ffmpeg_cmd_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
452   - `rtp_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
453   - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
454   - `enable_audio` bit(1) DEFAULT NULL,
455   - `enable_mp4` bit(1) DEFAULT NULL,
456   - `enable` bit(1) NOT NULL,
457   - `status` bit(1) NOT NULL,
458   - `enable_remove_none_reader` bit(1) NOT NULL,
459   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
460   - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
461   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
462   - `enable_disable_none_reader` bit(1) DEFAULT NULL,
463   - PRIMARY KEY (`id`),
464   - UNIQUE KEY `stream_proxy_pk` (`app`,`stream`)
465   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
466   -/*!40101 SET character_set_client = @saved_cs_client */;
467   -
468   ---
469   --- Dumping data for table `stream_proxy`
470   ---
471   -
472   -LOCK TABLES `stream_proxy` WRITE;
473   -/*!40000 ALTER TABLE `stream_proxy` DISABLE KEYS */;
474   -/*!40000 ALTER TABLE `stream_proxy` ENABLE KEYS */;
475   -UNLOCK TABLES;
476   -
477   ---
478   --- Table structure for table `stream_push`
479   ---
480   -
481   -DROP TABLE IF EXISTS `stream_push`;
482   -/*!40101 SET @saved_cs_client = @@character_set_client */;
483   -/*!50503 SET character_set_client = utf8mb4 */;
484   -CREATE TABLE `stream_push` (
485   - `id` int NOT NULL AUTO_INCREMENT,
486   - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
487   - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
488   - `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
489   - `originType` int DEFAULT NULL,
490   - `originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
491   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
492   - `aliveSecond` int DEFAULT NULL,
493   - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
494   - `serverId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
495   - `pushTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
496   - `status` int DEFAULT NULL,
497   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
498   - `pushIng` int DEFAULT NULL,
499   - `self` int DEFAULT NULL,
500   - PRIMARY KEY (`id`),
501   - UNIQUE KEY `stream_push_pk` (`app`,`stream`)
502   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
503   -/*!40101 SET character_set_client = @saved_cs_client */;
504   -
505   ---
506   --- Dumping data for table `stream_push`
507   ---
508   -
509   -LOCK TABLES `stream_push` WRITE;
510   -/*!40000 ALTER TABLE `stream_push` DISABLE KEYS */;
511   -/*!40000 ALTER TABLE `stream_push` ENABLE KEYS */;
512   -UNLOCK TABLES;
513   -
514   ---
515   --- Table structure for table `user`
516   ---
517   -
518   -DROP TABLE IF EXISTS `user`;
519   -/*!40101 SET @saved_cs_client = @@character_set_client */;
520   -/*!50503 SET character_set_client = utf8mb4 */;
521   -CREATE TABLE `user` (
522   - `id` int NOT NULL AUTO_INCREMENT,
523   - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
524   - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
525   - `roleId` int NOT NULL,
526   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
527   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
528   - `pushKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
529   - PRIMARY KEY (`id`) USING BTREE,
530   - UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
531   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
532   -/*!40101 SET character_set_client = @saved_cs_client */;
533   -
534   ---
535   --- Dumping data for table `user`
536   ---
537   -
538   -LOCK TABLES `user` WRITE;
539   -/*!40000 ALTER TABLE `user` DISABLE KEYS */;
540   -INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3');
541   -/*!40000 ALTER TABLE `user` ENABLE KEYS */;
542   -UNLOCK TABLES;
543   -
544   ---
545   --- Table structure for table `user_role`
546   ---
547   -
548   -DROP TABLE IF EXISTS `user_role`;
549   -/*!40101 SET @saved_cs_client = @@character_set_client */;
550   -/*!50503 SET character_set_client = utf8mb4 */;
551   -CREATE TABLE `user_role` (
552   - `id` int NOT NULL AUTO_INCREMENT,
553   - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
554   - `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
555   - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
556   - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
557   - PRIMARY KEY (`id`) USING BTREE
558   -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
559   -/*!40101 SET character_set_client = @saved_cs_client */;
560   -
561   ---
562   --- Dumping data for table `user_role`
563   ---
564   -
565   -LOCK TABLES `user_role` WRITE;
566   -/*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
567   -INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
568   -/*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
569   -UNLOCK TABLES;
570   -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
571   -
572   -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
573   -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
574   -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
575   -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
576   -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
577   -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
578   -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
579   -
580   --- Dump completed on 2022-11-29 11:47:46
581 288 \ No newline at end of file
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
... ... @@ -77,8 +77,8 @@ public class Device {
77 77 /**
78 78 * 在线
79 79 */
80   - @Schema(description = "是否在线,1为在线,0为离线")
81   - private int online;
  80 + @Schema(description = "是否在线,true为在线,false为离线")
  81 + private boolean onLine;
82 82  
83 83  
84 84 /**
... ... @@ -140,7 +140,7 @@ public class Device {
140 140 /**
141 141 * 目录订阅周期,0为不订阅
142 142 */
143   - @Schema(description = "目录订阅周期,0为不订阅")
  143 + @Schema(description = "目录订阅周期,o为不订阅")
144 144 private int subscribeCycleForCatalog;
145 145  
146 146 /**
... ... @@ -286,12 +286,12 @@ public class Device {
286 286 this.hostAddress = hostAddress;
287 287 }
288 288  
289   - public int getOnline() {
290   - return online;
  289 + public boolean isOnLine() {
  290 + return onLine;
291 291 }
292 292  
293   - public void setOnline(int online) {
294   - this.online = online;
  293 + public void setOnLine(boolean onLine) {
  294 + this.onLine = onLine;
295 295 }
296 296  
297 297 public int getChannelCount() {
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
... ... @@ -172,7 +172,7 @@ public class DeviceChannel {
172 172 * 遇到过NVR下的IPC下发信令可以推流, 但是 Status 响应 OFF
173 173 */
174 174 @Schema(description = "在线/离线, 1在线,0离线")
175   - private int status;
  175 + private boolean status;
176 176  
177 177 /**
178 178 * 经度
... ... @@ -455,11 +455,11 @@ public class DeviceChannel {
455 455 this.PTZTypeText = PTZTypeText;
456 456 }
457 457  
458   - public int getStatus() {
  458 + public boolean isStatus() {
459 459 return status;
460 460 }
461 461  
462   - public void setStatus(int status) {
  462 + public void setStatus(boolean status) {
463 463 this.status = status;
464 464 }
465 465  
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java
... ... @@ -10,7 +10,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
10 10 public class GbStream extends PlatformGbStream{
11 11  
12 12 @Schema(description = "ID")
13   - private Integer gbStreamId;
  13 + private int gbStreamId;
14 14 @Schema(description = "应用名")
15 15 private String app;
16 16 @Schema(description = "流ID")
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformGbStream.java
... ... @@ -5,7 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
5 5 public class PlatformGbStream {
6 6  
7 7 @Schema(description = "ID")
8   - private Integer gbStreamId;
  8 + private int gbStreamId;
9 9  
10 10 @Schema(description = "平台ID")
11 11 private String platformId;
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java
... ... @@ -66,7 +66,7 @@ public interface ISIPCommanderForPlatform {
66 66 * @param fromTag
67 67 * @return
68 68 */
69   - void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,int status) throws SipException, InvalidArgumentException, ParseException;
  69 + void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,boolean status) throws SipException, InvalidArgumentException, ParseException;
70 70  
71 71 /**
72 72 * 向上级回复移动位置订阅消息
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
... ... @@ -221,7 +221,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
221 221 if (!channel.getChannelId().equals(parentPlatform.getDeviceGBId())) {
222 222 catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n");
223 223 if (channel.getParental() == 0) {
224   - catalogXml.append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n");
  224 + catalogXml.append("<Status>" + (channel.isStatus() ? "ON" : "OFF") + "</Status>\r\n");
225 225 }
226 226 }
227 227 if (channel.getParental() == 0) {
... ... @@ -250,7 +250,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
250 250 catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n");
251 251 catalogXml.append("<Password>" + channel.getPort() + "</Password>\r\n");
252 252 catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n");
253   - catalogXml.append("<Status>" + (channel.getStatus() == 1?"ON":"OFF") + "</Status>\r\n");
  253 + catalogXml.append("<Status>" + (channel.isStatus() ? "ON":"OFF") + "</Status>\r\n");
254 254 catalogXml.append("<Longitude>" +
255 255 (channel.getLongitudeWgs84() != 0? channel.getLongitudeWgs84():channel.getLongitude())
256 256 + "</Longitude>\r\n");
... ... @@ -377,11 +377,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
377 377 * @return
378 378 */
379 379 @Override
380   - public void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,int status) throws SipException, InvalidArgumentException, ParseException {
  380 + public void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,boolean status) throws SipException, InvalidArgumentException, ParseException {
381 381 if (parentPlatform == null) {
382 382 return ;
383 383 }
384   - String statusStr = (status==1)?"ONLINE":"OFFLINE";
  384 + String statusStr = (status)?"ONLINE":"OFFLINE";
385 385 String characterSet = parentPlatform.getCharacterSet();
386 386 StringBuffer deviceStatusXml = new StringBuffer(600);
387 387 deviceStatusXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n")
... ... @@ -542,7 +542,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
542 542 catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n")
543 543 .append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n")
544 544 .append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n")
545   - .append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n");
  545 + .append("<Status>" + (channel.isStatus() ? "ON" : "OFF") + "</Status>\r\n");
546 546  
547 547 if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性
548 548 catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n")
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
... ... @@ -65,7 +65,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
65 65 String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader);
66 66  
67 67 Device device = redisCatchStorage.getDevice(deviceId);
68   - if (device == null || device.getOnline() == 0) {
  68 + if (device == null || !device.isOnLine()) {
69 69 logger.warn("[收到目录订阅]:{}, 但是设备已经离线", (device != null ? device.getDeviceId():"" ));
70 70 return;
71 71 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
... ... @@ -372,7 +372,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
372 372 String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader);
373 373  
374 374 Device device = redisCatchStorage.getDevice(deviceId);
375   - if (device == null || device.getOnline() == 0) {
  375 + if (device == null || !device.isOnLine()) {
376 376 logger.warn("[收到目录订阅]:{}, 但是设备已经离线", (device != null ? device.getDeviceId():"" ));
377 377 return;
378 378 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
... ... @@ -166,7 +166,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
166 166 device.setGeoCoordSys("WGS84");
167 167 device.setTreeType("CivilCode");
168 168 device.setDeviceId(deviceId);
169   - device.setOnline(0);
  169 + device.setOnLine(false);
170 170 }
171 171 device.setIp(remoteAddressInfo.getIp());
172 172 device.setPort(remoteAddressInfo.getPort());
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java
... ... @@ -83,12 +83,12 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp
83 83  
84 84 device.setKeepaliveTime(DateUtil.getNow());
85 85  
86   - if (device.getOnline() == 1) {
  86 + if (device.isOnLine()) {
87 87 deviceService.updateDevice(device);
88 88 }else {
89 89 // 对于已经离线的设备判断他的注册是否已经过期
90 90 if (!deviceService.expire(device)){
91   - device.setOnline(0);
  91 + device.setOnLine(false);
92 92 deviceService.online(device, null);
93 93 }
94 94 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceStatusQueryMessageHandler.java
... ... @@ -77,7 +77,7 @@ public class DeviceStatusQueryMessageHandler extends SIPRequestProcessorParent i
77 77 return;
78 78 }
79 79 try {
80   - cmderFroPlatform.deviceStatusResponse(parentPlatform,channelId, sn, fromHeader.getTag(),deviceChannel.getStatus());
  80 + cmderFroPlatform.deviceStatusResponse(parentPlatform,channelId, sn, fromHeader.getTag(),deviceChannel.isStatus());
81 81 } catch (SipException | InvalidArgumentException | ParseException e) {
82 82 logger.error("[命令发送失败] 国标级联 DeviceStatus查询回复: {}", e.getMessage());
83 83 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceInfoResponseMessageHandler.java
1 1 package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd;
2 2  
3   -import com.genersoft.iot.vmp.common.VideoManagerConstants;
4   -import com.genersoft.iot.vmp.conf.SipConfig;
5 3 import com.genersoft.iot.vmp.gb28181.bean.Device;
6 4 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
7   -import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
8 5 import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
9 6 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
10 7 import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
11 8 import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
12 9 import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.ResponseMessageHandler;
13 10 import com.genersoft.iot.vmp.service.IDeviceService;
14   -import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
15   -import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
16 11 import gov.nist.javax.sip.message.SIPRequest;
17 12 import org.dom4j.DocumentException;
18 13 import org.dom4j.Element;
... ... @@ -59,7 +54,7 @@ public class DeviceInfoResponseMessageHandler extends SIPRequestProcessorParent
59 54 public void handForDevice(RequestEvent evt, Device device, Element rootElement) {
60 55 logger.debug("接收到DeviceInfo应答消息");
61 56 // 检查设备是否存在, 不存在则不回复
62   - if (device == null || device.getOnline() == 0) {
  57 + if (device == null || !device.isOnLine()) {
63 58 logger.warn("[接收到DeviceInfo应答消息,但是设备已经离线]:" + (device != null ? device.getDeviceId():"" ));
64 59 return;
65 60 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
... ... @@ -255,7 +255,7 @@ public class XmlUtil {
255 255 }
256 256 if (channelType.equals(ChannelType.CivilCode)) {
257 257 // 行政区划其他字段没必要识别了,默认在线即可
258   - deviceChannel.setStatus(1);
  258 + deviceChannel.setStatus(true);
259 259 deviceChannel.setParental(1);
260 260 deviceChannel.setCreateTime(DateUtil.getNow());
261 261 deviceChannel.setUpdateTime(DateUtil.getNow());
... ... @@ -309,7 +309,7 @@ public class XmlUtil {
309 309 deviceChannel.setBusinessGroupId(businessGroupID);
310 310 if (channelType.equals(ChannelType.BusinessGroup) || channelType.equals(ChannelType.VirtualOrganization)) {
311 311 // 业务分组和虚拟组织 其他字段没必要识别了,默认在线即可
312   - deviceChannel.setStatus(1);
  312 + deviceChannel.setStatus(true);
313 313 deviceChannel.setParental(1);
314 314 deviceChannel.setCreateTime(DateUtil.getNow());
315 315 deviceChannel.setUpdateTime(DateUtil.getNow());
... ... @@ -322,13 +322,13 @@ public class XmlUtil {
322 322 String status = statusElement.getTextTrim().trim();
323 323 // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理
324 324 if (status.equals("ON") || status.equals("On") || status.equals("ONLINE") || status.equals("OK")) {
325   - deviceChannel.setStatus(1);
  325 + deviceChannel.setStatus(true);
326 326 }
327 327 if (status.equals("OFF") || status.equals("Off") || status.equals("OFFLINE")) {
328   - deviceChannel.setStatus(0);
  328 + deviceChannel.setStatus(false);
329 329 }
330 330 }else {
331   - deviceChannel.setStatus(1);
  331 + deviceChannel.setStatus(true);
332 332 }
333 333 // 识别自带的目录标识
334 334 String parental = XmlUtil.getText(itemDevice, "Parental");
... ...
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
... ... @@ -191,13 +191,13 @@ public class ZLMHttpHookListener {
191 191 if (userSetting.getPushAuthority()) {
192 192 // 推流鉴权
193 193 if (param.getParams() == null) {
194   - logger.info("推流鉴权失败: 缺少要参数:sign=md5(user表的pushKey)");
  194 + logger.info("推流鉴权失败: 缺少要参数:sign=md5(user表的pushKey)");
195 195 return new HookResultForOnPublish(401, "Unauthorized");
196 196 }
197 197 Map<String, String> paramMap = urlParamToMap(param.getParams());
198 198 String sign = paramMap.get("sign");
199 199 if (sign == null) {
200   - logger.info("推流鉴权失败: 缺少要参数:sign=md5(user表的pushKey)");
  200 + logger.info("推流鉴权失败: 缺少要参数:sign=md5(user表的pushKey)");
201 201 return new HookResultForOnPublish(401, "Unauthorized");
202 202 }
203 203 // 推流自定义播放鉴权码
... ...
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java
... ... @@ -325,5 +325,65 @@ public class StreamPushItem extends GbStream implements Comparable&lt;StreamPushIte
325 325 public void setSelf(boolean self) {
326 326 this.self = self;
327 327 }
  328 +
  329 +// @Override
  330 +// public Integer getGbStreamId() {
  331 +// return super.getGbStreamId();
  332 +// }
  333 +//
  334 +// @Override
  335 +// public void setGbStreamId(Integer gbStreamId) {
  336 +// super.setGbStreamId(gbStreamId);
  337 +// }
  338 +//
  339 +//
  340 +// public String getGbId() {
  341 +// return super.getGbId();
  342 +// }
  343 +//
  344 +// public void setGbId(String gbId) {
  345 +// super.setGbId(gbId);
  346 +// }
  347 +//
  348 +// public String getName() {
  349 +// return super.getName();
  350 +// }
  351 +//
  352 +// public void setName(String name) {
  353 +// super.setName(name);
  354 +// }
  355 +//
  356 +// public double getLongitude() {
  357 +// return super.getLongitude();
  358 +// }
  359 +//
  360 +// public void setLongitude(double longitude) {
  361 +// super.setLongitude(longitude);
  362 +// }
  363 +//
  364 +// public double getLatitude() {
  365 +// return super.getLatitude();
  366 +// }
  367 +//
  368 +// public void setLatitude(double latitude) {
  369 +// super.setLatitude(latitude);
  370 +// }
  371 +//
  372 +// public String getStreamType() {
  373 +// return super.getStreamType();
  374 +// }
  375 +//
  376 +// public void setStreamType(String streamType) {
  377 +// super.setStreamType(streamType);
  378 +// }
  379 +//
  380 +// public boolean isStatus() {
  381 +// return super.isStatus();
  382 +// }
  383 +//
  384 +// public void setStatus(boolean status) {
  385 +// super.setStatus(status);
  386 +// }
  387 +
328 388 }
329 389  
... ...
src/main/java/com/genersoft/iot/vmp/service/IDeviceChannelService.java
... ... @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.service;
2 2  
3 3 import com.genersoft.iot.vmp.gb28181.bean.Device;
4 4 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
5   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  5 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
6 6 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
7 7  
8 8 import java.util.List;
... ... @@ -38,7 +38,7 @@ public interface IDeviceChannelService {
38 38 * 获取统计信息
39 39 * @return
40 40 */
41   - ResourceBaceInfo getOverview();
  41 + ResourceBaseInfo getOverview();
42 42  
43 43 /**
44 44 * 查询所有未分配的通道
... ...
src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java
... ... @@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
5 5 import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
6 6 import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
7 7 import com.genersoft.iot.vmp.vmanager.bean.BaseTree;
8   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  8 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
9 9  
10 10 import java.util.List;
11 11  
... ... @@ -162,7 +162,7 @@ public interface IDeviceService {
162 162 * 获取统计信息
163 163 * @return
164 164 */
165   - ResourceBaceInfo getOverview();
  165 + ResourceBaseInfo getOverview();
166 166  
167 167 /**
168 168 * 获取所有设备
... ...
src/main/java/com/genersoft/iot/vmp/service/IRecordInfoServer.java deleted 100644 → 0
1   -package com.genersoft.iot.vmp.service;
2   -
3   -import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo;
4   -import com.github.pagehelper.PageInfo;
5   -
6   -public interface IRecordInfoServer {
7   - PageInfo<RecordInfo> getRecordList(int page, int count);
8   -}
src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java
... ... @@ -4,7 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
4 4 import com.genersoft.iot.vmp.common.StreamInfo;
5 5 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
6 6 import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
7   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  7 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
8 8 import com.github.pagehelper.PageInfo;
9 9  
10 10 public interface IStreamProxyService {
... ... @@ -108,6 +108,6 @@ public interface IStreamProxyService {
108 108 * 获取统计信息
109 109 * @return
110 110 */
111   - ResourceBaceInfo getOverview();
  111 + ResourceBaseInfo getOverview();
112 112  
113 113 }
... ...
src/main/java/com/genersoft/iot/vmp/service/IStreamPushService.java
... ... @@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam;
5 5 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
6 6 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
7 7 import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
8   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  8 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
9 9 import com.github.pagehelper.PageInfo;
10 10  
11 11 import java.util.List;
... ... @@ -113,5 +113,5 @@ public interface IStreamPushService {
113 113 * 获取统计信息
114 114 * @return
115 115 */
116   - ResourceBaceInfo getOverview();
  116 + ResourceBaseInfo getOverview();
117 117 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
... ... @@ -11,7 +11,7 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
11 11 import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
12 12 import com.genersoft.iot.vmp.storager.dao.DeviceMapper;
13 13 import com.genersoft.iot.vmp.utils.DateUtil;
14   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  14 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
15 15 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
16 16 import org.slf4j.Logger;
17 17 import org.slf4j.LoggerFactory;
... ... @@ -175,8 +175,12 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
175 175 }
176 176  
177 177 @Override
178   - public ResourceBaceInfo getOverview() {
179   - return channelMapper.getOverview();
  178 + public ResourceBaseInfo getOverview() {
  179 +
  180 + int online = channelMapper.getOnlineCount();
  181 + int total = channelMapper.getAllChannelCount();
  182 +
  183 + return new ResourceBaseInfo(total, online);
180 184 }
181 185  
182 186  
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
... ... @@ -20,7 +20,7 @@ import com.genersoft.iot.vmp.storager.dao.DeviceMapper;
20 20 import com.genersoft.iot.vmp.storager.dao.PlatformChannelMapper;
21 21 import com.genersoft.iot.vmp.utils.DateUtil;
22 22 import com.genersoft.iot.vmp.vmanager.bean.BaseTree;
23   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  23 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
24 24 import org.slf4j.Logger;
25 25 import org.slf4j.LoggerFactory;
26 26 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -118,7 +118,7 @@ public class DeviceServiceImpl implements IDeviceService {
118 118  
119 119 // 第一次上线 或则设备之前是离线状态--进行通道同步和设备信息查询
120 120 if (device.getCreateTime() == null) {
121   - device.setOnline(1);
  121 + device.setOnLine(true);
122 122 device.setCreateTime(now);
123 123 logger.info("[设备上线,首次注册]: {},查询设备信息以及通道信息", device.getDeviceId());
124 124 deviceMapper.add(device);
... ... @@ -130,8 +130,8 @@ public class DeviceServiceImpl implements IDeviceService {
130 130 }
131 131 sync(device);
132 132 }else {
133   - if(device.getOnline() == 0){
134   - device.setOnline(1);
  133 + if(!device.isOnLine()){
  134 + device.setOnLine(true);
135 135 device.setCreateTime(now);
136 136 deviceMapper.update(device);
137 137 redisCatchStorage.updateDevice(device);
... ... @@ -185,7 +185,7 @@ public class DeviceServiceImpl implements IDeviceService {
185 185 }
186 186 String registerExpireTaskKey = VideoManagerConstants.REGISTER_EXPIRE_TASK_KEY_PREFIX + deviceId;
187 187 dynamicTask.stop(registerExpireTaskKey);
188   - device.setOnline(0);
  188 + device.setOnLine(false);
189 189 redisCatchStorage.updateDevice(device);
190 190 deviceMapper.update(device);
191 191 //进行通道离线
... ... @@ -231,7 +231,7 @@ public class DeviceServiceImpl implements IDeviceService {
231 231 }
232 232 logger.info("[移除目录订阅]: {}", device.getDeviceId());
233 233 String taskKey = device.getDeviceId() + "catalog";
234   - if (device.getOnline() == 1) {
  234 + if (device.isOnLine()) {
235 235 Runnable runnable = dynamicTask.get(taskKey);
236 236 if (runnable instanceof ISubscribeTask) {
237 237 ISubscribeTask subscribeTask = (ISubscribeTask) runnable;
... ... @@ -264,7 +264,7 @@ public class DeviceServiceImpl implements IDeviceService {
264 264 }
265 265 logger.info("[移除移动位置订阅]: {}", device.getDeviceId());
266 266 String taskKey = device.getDeviceId() + "mobile_position";
267   - if (device.getOnline() == 1) {
  267 + if (device.isOnLine()) {
268 268 Runnable runnable = dynamicTask.get(taskKey);
269 269 if (runnable instanceof ISubscribeTask) {
270 270 ISubscribeTask subscribeTask = (ISubscribeTask) runnable;
... ... @@ -331,7 +331,7 @@ public class DeviceServiceImpl implements IDeviceService {
331 331  
332 332 @Override
333 333 public void checkDeviceStatus(Device device) {
334   - if (device == null || device.getOnline() == 0) {
  334 + if (device == null || !device.isOnLine()) {
335 335 return;
336 336 }
337 337 try {
... ... @@ -535,7 +535,7 @@ public class DeviceServiceImpl implements IDeviceService {
535 535  
536 536 if (haveChannel) {
537 537 // 查询那些civilCode不在通道中的不规范通道,放置在根目录
538   - List<DeviceChannel> nonstandardNode = deviceChannelMapper.getChannelWithoutCiviCode(deviceId);
  538 + List<DeviceChannel> nonstandardNode = deviceChannelMapper.getChannelWithoutCivilCode(deviceId);
539 539 if (nonstandardNode != null && nonstandardNode.size() > 0) {
540 540 result.addAll(nonstandardNode);
541 541 }
... ... @@ -568,7 +568,7 @@ public class DeviceServiceImpl implements IDeviceService {
568 568  
569 569 @Override
570 570 public void addDevice(Device device) {
571   - device.setOnline(0);
  571 + device.setOnLine(false);
572 572 device.setCreateTime(DateUtil.getNow());
573 573 device.setUpdateTime(DateUtil.getNow());
574 574 deviceMapper.addCustomDevice(device);
... ... @@ -652,8 +652,10 @@ public class DeviceServiceImpl implements IDeviceService {
652 652 }
653 653  
654 654 @Override
655   - public ResourceBaceInfo getOverview() {
656   - return deviceMapper.getOverview();
  655 + public ResourceBaseInfo getOverview() {
  656 + List<Device> onlineDevices = deviceMapper.getOnlineDevices();
  657 + List<Device> all = deviceMapper.getAll();
  658 + return new ResourceBaseInfo(all.size(), onlineDevices.size());
657 659 }
658 660  
659 661 @Override
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
... ... @@ -110,7 +110,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
110 110 deviceChannel.setLatitude(gbStream.getLatitude());
111 111 deviceChannel.setDeviceId(platform.getDeviceGBId());
112 112 deviceChannel.setManufacture("wvp-pro");
113   - deviceChannel.setStatus(gbStream.isStatus()?1:0);
  113 + deviceChannel.setStatus(gbStream.isStatus());
114 114  
115 115 deviceChannel.setRegisterWay(1);
116 116 deviceChannel.setCivilCode(platform.getAdministrativeDivision());
... ... @@ -218,7 +218,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
218 218 }else {
219 219 status = gbStreamMapper.selectStatusForPush(gbStream.getApp(), gbStream.getStream());
220 220 }
221   - deviceChannel.setStatus((status != null && status )?1:0);
  221 + deviceChannel.setStatus(status != null && status);
222 222  
223 223 deviceChannel.setRegisterWay(1);
224 224 deviceChannel.setCivilCode(platform.getAdministrativeDivision());
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
... ... @@ -685,7 +685,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
685 685 // 缓存不存在,从数据库查询,如果数据库不存在则是错误的
686 686 mediaServerItem = getOneFromDatabase(mediaServerId);
687 687 if (mediaServerItem == null) {
688   - logger.warn("[更新ZLM 保活信息]失败,未找到流媒体信息");
  688 + logger.warn("[更新ZLM 保活信息] 流媒体{}尚未加入使用,请检查节点中是否含有此流媒体 ", mediaServerId);
689 689 return;
690 690 }
691 691 // zlm连接重试
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/RecordInfoServerImpl.java deleted 100644 → 0
1   -package com.genersoft.iot.vmp.service.impl;
2   -
3   -import com.genersoft.iot.vmp.service.IRecordInfoServer;
4   -import com.genersoft.iot.vmp.storager.dao.RecordInfoDao;
5   -import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo;
6   -import com.github.pagehelper.PageHelper;
7   -import com.github.pagehelper.PageInfo;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.stereotype.Service;
10   -
11   -import java.util.List;
12   -
13   -@Service
14   -public class RecordInfoServerImpl implements IRecordInfoServer {
15   -
16   - @Autowired
17   - private RecordInfoDao recordInfoDao;
18   -
19   - @Override
20   - public PageInfo<RecordInfo> getRecordList(int page, int count) {
21   - PageHelper.startPage(page, count);
22   - List<RecordInfo> all = recordInfoDao.selectAll();
23   - return new PageInfo<>(all);
24   - }
25   -}
src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
... ... @@ -23,7 +23,7 @@ import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper;
23 23 import com.genersoft.iot.vmp.storager.dao.StreamProxyMapper;
24 24 import com.genersoft.iot.vmp.utils.DateUtil;
25 25 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
26   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  26 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
27 27 import com.github.pagehelper.PageInfo;
28 28 import org.slf4j.Logger;
29 29 import org.slf4j.LoggerFactory;
... ... @@ -332,7 +332,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
332 332 @Override
333 333 public void zlmServerOnline(String mediaServerId) {
334 334 // 移除开启了无人观看自动移除的流
335   - List<StreamProxyItem> streamProxyItemList = streamProxyMapper.selecAutoRemoveItemByMediaServerId(mediaServerId);
  335 + List<StreamProxyItem> streamProxyItemList = streamProxyMapper.selectAutoRemoveItemByMediaServerId(mediaServerId);
336 336 if (streamProxyItemList.size() > 0) {
337 337 gbStreamMapper.batchDel(streamProxyItemList);
338 338 }
... ... @@ -360,7 +360,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
360 360 @Override
361 361 public void zlmServerOffline(String mediaServerId) {
362 362 // 移除开启了无人观看自动移除的流
363   - List<StreamProxyItem> streamProxyItemList = streamProxyMapper.selecAutoRemoveItemByMediaServerId(mediaServerId);
  363 + List<StreamProxyItem> streamProxyItemList = streamProxyMapper.selectAutoRemoveItemByMediaServerId(mediaServerId);
364 364 if (streamProxyItemList.size() > 0) {
365 365 gbStreamMapper.batchDel(streamProxyItemList);
366 366 }
... ... @@ -438,7 +438,11 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
438 438 }
439 439  
440 440 @Override
441   - public ResourceBaceInfo getOverview() {
442   - return streamProxyMapper.getOverview();
  441 + public ResourceBaseInfo getOverview() {
  442 +
  443 + int total = streamProxyMapper.getAllCount();
  444 + int online = streamProxyMapper.getOnline();
  445 +
  446 + return new ResourceBaseInfo(total, online);
443 447 }
444 448 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
... ... @@ -20,7 +20,7 @@ import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
20 20 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
21 21 import com.genersoft.iot.vmp.storager.dao.*;
22 22 import com.genersoft.iot.vmp.utils.DateUtil;
23   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  23 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
24 24 import com.github.pagehelper.PageHelper;
25 25 import com.github.pagehelper.PageInfo;
26 26 import org.slf4j.Logger;
... ... @@ -531,7 +531,10 @@ public class StreamPushServiceImpl implements IStreamPushService {
531 531 }
532 532  
533 533 @Override
534   - public ResourceBaceInfo getOverview() {
535   - return streamPushMapper.getOverview(userSetting.isUsePushingAsStatus());
  534 + public ResourceBaseInfo getOverview() {
  535 + int total = streamPushMapper.getAllCount();
  536 + int online = streamPushMapper.getAllOnline(userSetting.isUsePushingAsStatus());
  537 +
  538 + return new ResourceBaseInfo(total, online);
536 539 }
537 540 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java
... ... @@ -9,7 +9,6 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto;
9 9 import com.google.common.collect.BiMap;
10 10 import com.google.common.collect.HashBiMap;
11 11 import org.springframework.util.ObjectUtils;
12   -import org.springframework.util.StringUtils;
13 12  
14 13 import java.util.*;
15 14  
... ... @@ -33,38 +32,43 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener&lt;StreamPus
33 32 /**
34 33 * 用于存储不加过滤的所有数据
35 34 */
36   - private List<StreamPushItem> streamPushItems = new ArrayList<>();
  35 + private final List<StreamPushItem> streamPushItems = new ArrayList<>();
37 36  
38 37 /**
39 38 * 用于存储更具APP+Stream过滤后的数据,可以直接存入stream_push表与gb_stream表
40 39 */
41   - private Map<String,StreamPushItem> streamPushItemForSave = new HashMap<>();
  40 + private final Map<String,StreamPushItem> streamPushItemForSave = new HashMap<>();
42 41  
43 42 /**
44 43 * 用于存储按照APP+Stream为KEY, 平台ID+目录Id 为value的数据,用于存储到gb_stream表后获取app+Stream对应的平台与目录信息,然后存入关联表
45 44 */
46   - private Map<String, List<String[]>> streamPushItemsForPlatform = new HashMap<>();
  45 + private final Map<String, List<String[]>> streamPushItemsForPlatform = new HashMap<>();
47 46  
48 47 /**
49 48 * 用于判断文件是否存在重复的app+Stream+平台ID
50 49 */
51   - private Set<String> streamPushStreamSet = new HashSet<>();
  50 + private final Set<String> streamPushStreamSet = new HashSet<>();
52 51  
53 52 /**
54 53 * 用于存储APP+Stream->国标ID 的数据结构, 数据一一对应,全局判断APP+Stream->国标ID是否存在不对应
55 54 */
56   - private BiMap<String,String> gBMap = HashBiMap.create();
  55 + private final BiMap<String,String> gBMap = HashBiMap.create();
  56 +
  57 + /**
  58 + * 用于存储APP+Stream-> 在数据库中的数据
  59 + */
  60 + private final BiMap<String,String> pushMapInDb = HashBiMap.create();
57 61  
58 62 /**
59 63 * 记录错误的APP+Stream
60 64 */
61   - private List<String> errorStreamList = new ArrayList<>();
  65 + private final List<String> errorStreamList = new ArrayList<>();
62 66  
63 67  
64 68 /**
65 69 * 记录错误的国标ID
66 70 */
67   - private List<String> errorGBList = new ArrayList<>();
  71 + private final List<String> errorInfoList = new ArrayList<>();
68 72  
69 73 /**
70 74 * 读取数量计数器
... ... @@ -75,6 +79,13 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener&lt;StreamPus
75 79 this.pushService = pushService;
76 80 this.defaultMediaServerId = defaultMediaServerId;
77 81 this.errorDataHandler = errorDataHandler;
  82 + // 获取数据库已有的数据,已经存在的则忽略
  83 + List<String> allAppAndStreams = pushService.getAllAppAndStream();
  84 + if (allAppAndStreams.size() > 0) {
  85 + for (String allAppAndStream : allAppAndStreams) {
  86 + pushMapInDb.put(allAppAndStream, allAppAndStream);
  87 + }
  88 + }
78 89 }
79 90  
80 91 public interface ErrorDataHandler{
... ... @@ -88,26 +99,30 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener&lt;StreamPus
88 99 || ObjectUtils.isEmpty(streamPushExcelDto.getGbId())) {
89 100 return;
90 101 }
  102 + Integer rowIndex = analysisContext.readRowHolder().getRowIndex();
91 103  
92 104 if (gBMap.get(streamPushExcelDto.getApp() + streamPushExcelDto.getStream()) == null) {
93 105 try {
94 106 gBMap.put(streamPushExcelDto.getApp() + streamPushExcelDto.getStream(), streamPushExcelDto.getGbId());
95 107 }catch (IllegalArgumentException e) {
96   - errorGBList.add(streamPushExcelDto.getGbId() + "(不同的app+stream使用了相同的国标ID)");
  108 + errorInfoList.add("行:" + rowIndex + ", " + streamPushExcelDto.getGbId() + " 国标ID重复使用");
97 109 return;
98 110 }
99 111 }else {
100 112 if (!gBMap.get(streamPushExcelDto.getApp() + streamPushExcelDto.getStream()).equals(streamPushExcelDto.getGbId())) {
101   - errorGBList.add(streamPushExcelDto.getGbId() + "(同一组app+stream使用了不同的国标ID)");
  113 + errorInfoList.add("行:" + rowIndex + ", " + streamPushExcelDto.getGbId() + " 同样的应用名和流ID使用了不同的国标ID");
102 114 return;
103 115 }
104 116 }
105 117  
106 118 if (streamPushStreamSet.contains(streamPushExcelDto.getApp() + streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId())) {
107   - errorStreamList.add(streamPushExcelDto.getApp() + "/" + streamPushExcelDto.getStream()+ "/" +
108   - streamPushExcelDto.getPlatformId() + "(同一组app+stream添加在了同一个平台下)");
  119 + errorStreamList.add("行:" + rowIndex + ", " + streamPushExcelDto.getApp() + "/" + streamPushExcelDto.getStream()+ " 平台信息重复");
109 120 return;
110 121 }else {
  122 + if (pushMapInDb.get(streamPushExcelDto.getApp()+streamPushExcelDto.getStream()) != null) {
  123 + errorStreamList.add("行:" + rowIndex + ", " + streamPushExcelDto.getApp() + "/" + streamPushExcelDto.getStream()+ " 数据已存在");
  124 + return;
  125 + }
111 126 streamPushStreamSet.add(streamPushExcelDto.getApp()+streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId());
112 127 }
113 128  
... ... @@ -165,7 +180,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener&lt;StreamPus
165 180 gBMap.clear();
166 181 streamPushStreamSet.clear();
167 182 streamPushItemsForPlatform.clear();
168   - errorDataHandler.handle(errorStreamList, errorGBList);
  183 + errorDataHandler.handle(errorStreamList, errorInfoList);
169 184 }
170 185  
171 186 private void saveData(){
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/UserServiceImpl.java
... ... @@ -7,8 +7,7 @@ import com.github.pagehelper.PageHelper;
7 7 import com.github.pagehelper.PageInfo;
8 8 import org.springframework.beans.factory.annotation.Autowired;
9 9 import org.springframework.stereotype.Service;
10   -import org.springframework.util.ObjectUtils;
11   -import org.springframework.util.StringUtils;
  10 +import org.springframework.util.DigestUtils;
12 11  
13 12 import java.util.List;
14 13  
... ... @@ -61,11 +60,23 @@ public class UserServiceImpl implements IUserService {
61 60  
62 61 @Override
63 62 public boolean checkPushAuthority(String callId, String sign) {
64   - if (ObjectUtils.isEmpty(callId)) {
65   - return userMapper.checkPushAuthorityByCallId(sign).size() > 0;
66   - }else {
67   - return userMapper.checkPushAuthorityByCallIdAndSign(callId, sign).size() > 0;
  63 +
  64 + List<User> users = userMapper.getUsers();
  65 + if (users.size() == 0) {
  66 + return false;
  67 + }
  68 + for (User user : users) {
  69 + if (user.getPushKey() == null) {
  70 + continue;
  71 + }
  72 + String checkStr = callId == null? user.getPushKey():(callId + "_" + user.getPushKey()) ;
  73 + System.out.println(checkStr);
  74 + String checkSign = DigestUtils.md5DigestAsHex(checkStr.getBytes());
  75 + if (checkSign.equals(sign)) {
  76 + return true;
  77 + }
68 78 }
  79 + return false;
69 80 }
70 81  
71 82 @Override
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java
... ... @@ -16,32 +16,32 @@ import java.util.List;
16 16 @Repository
17 17 public interface DeviceAlarmMapper {
18 18  
19   - @Insert("INSERT INTO device_alarm (deviceId, channelId, alarmPriority, alarmMethod, alarmTime, alarmDescription, longitude, latitude, alarmType , createTime ) " +
  19 + @Insert("INSERT INTO wvp_device_alarm (device_id, channel_id, alarm_priority, alarm_method, alarm_time, alarm_description, longitude, latitude, alarm_type , create_time ) " +
20 20 "VALUES (#{deviceId}, #{channelId}, #{alarmPriority}, #{alarmMethod}, #{alarmTime}, #{alarmDescription}, #{longitude}, #{latitude}, #{alarmType}, #{createTime})")
21 21 int add(DeviceAlarm alarm);
22 22  
23 23  
24 24 @Select( value = {" <script>" +
25   - " SELECT * FROM device_alarm " +
  25 + " SELECT * FROM wvp_device_alarm " +
26 26 " WHERE 1=1 " +
27   - " <if test=\"deviceId != null\" > AND deviceId = #{deviceId}</if>" +
28   - " <if test=\"alarmPriority != null\" > AND alarmPriority = #{alarmPriority} </if>" +
29   - " <if test=\"alarmMethod != null\" > AND alarmMethod = #{alarmMethod} </if>" +
30   - " <if test=\"alarmType != null\" > AND alarmType = #{alarmType} </if>" +
31   - " <if test=\"startTime != null\" > AND alarmTime &gt;= #{startTime} </if>" +
32   - " <if test=\"endTime != null\" > AND alarmTime &lt;= #{endTime} </if>" +
33   - " ORDER BY alarmTime ASC " +
  27 + " <if test=\"deviceId != null\" > AND device_id = #{deviceId}</if>" +
  28 + " <if test=\"alarmPriority != null\" > AND alarm_priority = #{alarmPriority} </if>" +
  29 + " <if test=\"alarmMethod != null\" > AND alarm_method = #{alarmMethod} </if>" +
  30 + " <if test=\"alarmType != null\" > AND alarm_type = #{alarmType} </if>" +
  31 + " <if test=\"startTime != null\" > AND alarm_time &gt;= #{startTime} </if>" +
  32 + " <if test=\"endTime != null\" > AND alarm_time &lt;= #{endTime} </if>" +
  33 + " ORDER BY alarm_time ASC " +
34 34 " </script>"})
35 35 List<DeviceAlarm> query(String deviceId, String alarmPriority, String alarmMethod,
36 36 String alarmType, String startTime, String endTime);
37 37  
38 38  
39 39 @Delete(" <script>" +
40   - "DELETE FROM device_alarm WHERE 1=1 " +
41   - " <if test=\"deviceIdList != null and id == null \" > AND deviceId in " +
  40 + "DELETE FROM wvp_device_alarm WHERE 1=1 " +
  41 + " <if test=\"deviceIdList != null and id == null \" > AND device_id in " +
42 42 "<foreach collection='deviceIdList' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
43 43 "</if>" +
44   - " <if test=\"time != null and id == null \" > AND alarmTime &lt;= #{time}</if>" +
  44 + " <if test=\"time != null and id == null \" > AND alarm_time &lt;= #{time}</if>" +
45 45 " <if test=\"id != null\" > AND id = #{id}</if>" +
46 46 " </script>"
47 47 )
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
... ... @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.storager.dao;
3 3 import com.genersoft.iot.vmp.gb28181.bean.Device;
4 4 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
5 5 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform;
6   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
7 6 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
8 7 import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
9 8 import org.apache.ibatis.annotations.*;
... ... @@ -18,10 +17,10 @@ import java.util.List;
18 17 @Repository
19 18 public interface DeviceChannelMapper {
20 19  
21   - @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
22   - "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
23   - "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
24   - "longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " +
  20 + @Insert("INSERT INTO wvp_device_channel (channel_id, device_id, name, manufacture, model, owner, civil_code, block, " +
  21 + "address, parental, parent_id, safety_way, register_way, cert_num, certifiable, err_code, secrecy, " +
  22 + "ip_address, port, password, ptz_type, status, stream_id, longitude, latitude, longitude_gcj02, latitude_gcj02, " +
  23 + "longitude_wgs84, latitude_wgs84, has_audio, create_time, update_time, business_group_id, gps_time) " +
25 24 "VALUES (#{channelId}, #{deviceId}, #{name}, #{manufacture}, #{model}, #{owner}, #{civilCode}, #{block}," +
26 25 "#{address}, #{parental}, #{parentId}, #{safetyWay}, #{registerWay}, #{certNum}, #{certifiable}, #{errCode}, #{secrecy}, " +
27 26 "#{ipAddress}, #{port}, #{password}, #{PTZType}, #{status}, #{streamId}, #{longitude}, #{latitude}, #{longitudeGcj02}, " +
... ... @@ -29,39 +28,39 @@ public interface DeviceChannelMapper {
29 28 int add(DeviceChannel channel);
30 29  
31 30 @Update(value = {" <script>" +
32   - "UPDATE device_channel " +
33   - "SET updateTime=#{updateTime}" +
  31 + "UPDATE wvp_device_channel " +
  32 + "SET update_time=#{updateTime}" +
34 33 "<if test='name != null'>, name=#{name}</if>" +
35 34 "<if test='manufacture != null'>, manufacture=#{manufacture}</if>" +
36 35 "<if test='model != null'>, model=#{model}</if>" +
37 36 "<if test='owner != null'>, owner=#{owner}</if>" +
38   - "<if test='civilCode != null'>, civilCode=#{civilCode}</if>" +
  37 + "<if test='civilCode != null'>, civil_code=#{civilCode}</if>" +
39 38 "<if test='block != null'>, block=#{block}</if>" +
40 39 "<if test='address != null'>, address=#{address}</if>" +
41 40 "<if test='parental != null'>, parental=#{parental}</if>" +
42   - "<if test='parentId != null'>, parentId=#{parentId}</if>" +
43   - "<if test='safetyWay != null'>, safetyWay=#{safetyWay}</if>" +
44   - "<if test='registerWay != null'>, registerWay=#{registerWay}</if>" +
45   - "<if test='certNum != null'>, certNum=#{certNum}</if>" +
  41 + "<if test='parentId != null'>, parent_id=#{parentId}</if>" +
  42 + "<if test='safetyWay != null'>, safety_way=#{safetyWay}</if>" +
  43 + "<if test='registerWay != null'>, register_way=#{registerWay}</if>" +
  44 + "<if test='certNum != null'>, cert_num=#{certNum}</if>" +
46 45 "<if test='certifiable != null'>, certifiable=#{certifiable}</if>" +
47   - "<if test='errCode != null'>, errCode=#{errCode}</if>" +
  46 + "<if test='errCode != null'>, err_code=#{errCode}</if>" +
48 47 "<if test='secrecy != null'>, secrecy=#{secrecy}</if>" +
49   - "<if test='ipAddress != null'>, ipAddress=#{ipAddress}</if>" +
  48 + "<if test='ipAddress != null'>, ip_address=#{ipAddress}</if>" +
50 49 "<if test='port != null'>, port=#{port}</if>" +
51 50 "<if test='password != null'>, password=#{password}</if>" +
52   - "<if test='PTZType != null'>, PTZType=#{PTZType}</if>" +
  51 + "<if test='PTZType != null'>, ptz_type=#{PTZType}</if>" +
53 52 "<if test='status != null'>, status=#{status}</if>" +
54   - "<if test='streamId != null'>, streamId=#{streamId}</if>" +
55   - "<if test='hasAudio != null'>, hasAudio=#{hasAudio}</if>" +
  53 + "<if test='streamId != null'>, stream_id=#{streamId}</if>" +
  54 + "<if test='hasAudio != null'>, has_audio=#{hasAudio}</if>" +
56 55 "<if test='longitude != null'>, longitude=#{longitude}</if>" +
57 56 "<if test='latitude != null'>, latitude=#{latitude}</if>" +
58   - "<if test='longitudeGcj02 != null'>, longitudeGcj02=#{longitudeGcj02}</if>" +
59   - "<if test='latitudeGcj02 != null'>, latitudeGcj02=#{latitudeGcj02}</if>" +
60   - "<if test='longitudeWgs84 != null'>, longitudeWgs84=#{longitudeWgs84}</if>" +
61   - "<if test='latitudeWgs84 != null'>, latitudeWgs84=#{latitudeWgs84}</if>" +
62   - "<if test='businessGroupId != null'>, businessGroupId=#{businessGroupId}</if>" +
63   - "<if test='gpsTime != null'>, gpsTime=#{gpsTime}</if>" +
64   - "WHERE deviceId=#{deviceId} AND channelId=#{channelId}"+
  57 + "<if test='longitudeGcj02 != null'>, longitude_gcj02=#{longitudeGcj02}</if>" +
  58 + "<if test='latitudeGcj02 != null'>, latitude_gcj02=#{latitudeGcj02}</if>" +
  59 + "<if test='longitudeWgs84 != null'>, longitude_wgs84=#{longitudeWgs84}</if>" +
  60 + "<if test='latitudeWgs84 != null'>, latitude_wgs84=#{latitudeWgs84}</if>" +
  61 + "<if test='businessGroupId != null'>, business_group_id=#{businessGroupId}</if>" +
  62 + "<if test='gpsTime != null'>, gps_time=#{gpsTime}</if>" +
  63 + "WHERE device_id=#{deviceId} AND channel_id=#{channelId}"+
65 64 " </script>"})
66 65 int update(DeviceChannel channel);
67 66  
... ... @@ -69,42 +68,42 @@ public interface DeviceChannelMapper {
69 68 "SELECT " +
70 69 "dc.* " +
71 70 "from " +
72   - "device_channel dc " +
  71 + "wvp_device_channel dc " +
73 72 "WHERE " +
74   - "dc.deviceId = #{deviceId} " +
75   -" <if test='query != null'> AND (dc.channelId LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%'))</if> " +
76   - " <if test='parentChannelId != null'> AND (dc.parentId=#{parentChannelId} OR dc.civilCode = #{parentChannelId}) </if> " +
77   - " <if test='online == true' > AND dc.status=1</if>" +
78   - " <if test='online == false' > AND dc.status=0</if>" +
79   - " <if test='hasSubChannel == true' > AND dc.subCount > 0 </if>" +
80   - " <if test='hasSubChannel == false' > AND dc.subCount = 0 </if>" +
81   - "<if test='channelIds != null'> AND dc.channelId in <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
  73 + "dc.device_id = #{deviceId} " +
  74 +" <if test='query != null'> AND (dc.channel_id LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%'))</if> " +
  75 + " <if test='parentChannelId != null'> AND (dc.parent_id=#{parentChannelId} OR dc.civil_code = #{parentChannelId}) </if> " +
  76 + " <if test='online == true' > AND dc.status= true</if>" +
  77 + " <if test='online == false' > AND dc.status= false</if>" +
  78 + " <if test='hasSubChannel == true' > AND dc.sub_count > 0 </if>" +
  79 + " <if test='hasSubChannel == false' > AND dc.sub_count = 0 </if>" +
  80 + "<if test='channelIds != null'> AND dc.channel_id in <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
82 81 "#{item} " +
83 82 "</foreach> </if>" +
84   - "ORDER BY dc.channelId " +
  83 + "ORDER BY dc.channel_id " +
85 84 " </script>"})
86 85 List<DeviceChannel> queryChannels(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, List<String> channelIds);
87 86  
88 87 @Select(value = {" <script>" +
89 88 "SELECT " +
90 89 "dc.*, " +
91   - "de.name as deviceName, " +
92   - "de.online as deviceOnline " +
  90 + "de.name as device_name, " +
  91 + "de.on_line as device_online " +
93 92 "from " +
94   - "device_channel dc " +
95   - "LEFT JOIN device de ON dc.deviceId = de.deviceId " +
  93 + "wvp_device_channel dc " +
  94 + "LEFT JOIN wvp_device de ON dc.device_id = de.device_id " +
96 95 "WHERE 1=1" +
97   - " <if test='deviceId != null'> AND dc.deviceId = #{deviceId} </if> " +
98   - " <if test='query != null'> AND (dc.channelId LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " +
99   - " <if test='parentChannelId != null'> AND dc.parentId=#{parentChannelId} </if> " +
100   - " <if test='online == true' > AND dc.status=1</if>" +
101   - " <if test='online == false' > AND dc.status=0</if>" +
102   - " <if test='hasSubChannel == true' > AND dc.subCount > 0 </if>" +
103   - " <if test='hasSubChannel == false' > AND dc.subCount = 0 </if>" +
104   - "<if test='channelIds != null'> AND dc.channelId in <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
  96 + " <if test='deviceId != null'> AND dc.device_id = #{deviceId} </if> " +
  97 + " <if test='query != null'> AND (dc.channel_id LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " +
  98 + " <if test='parentChannelId != null'> AND dc.parent_id=#{parentChannelId} </if> " +
  99 + " <if test='online == true' > AND dc.status=true</if>" +
  100 + " <if test='online == false' > AND dc.status=false</if>" +
  101 + " <if test='hasSubChannel == true' > AND dc.sub_count > 0 </if>" +
  102 + " <if test='hasSubChannel == false' > AND dc.sub_count = 0 </if>" +
  103 + "<if test='channelIds != null'> AND dc.channel_id in <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
105 104 "#{item} " +
106 105 "</foreach> </if>" +
107   - "ORDER BY dc.channelId ASC" +
  106 + "ORDER BY dc.channel_id ASC" +
108 107 " </script>"})
109 108 List<DeviceChannelExtend> queryChannelsWithDeviceInfo(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, List<String> channelIds);
110 109  
... ... @@ -112,151 +111,97 @@ public interface DeviceChannelMapper {
112 111 @Select(value = {" <script>" +
113 112 "SELECT " +
114 113 "dc.*, " +
115   - "de.name as deviceName, " +
116   - "de.online as deviceOnline " +
  114 + "de.name as device_name, " +
  115 + "de.on_line as device_online " +
117 116 "from " +
118   - "device_channel dc " +
119   - "LEFT JOIN device de ON dc.deviceId = de.deviceId " +
  117 + "wvp_device_channel dc " +
  118 + "LEFT JOIN wvp_device de ON dc.device_id = de.device_id " +
120 119 "WHERE 1=1" +
121   - " <if test='deviceId != null'> AND dc.deviceId = #{deviceId} </if> " +
122   - " <if test='query != null'> AND (dc.channelId LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " +
123   - " <if test='parentChannelId != null'> AND dc.parentId=#{parentChannelId} </if> " +
124   - " <if test='online == true' > AND dc.status=1</if>" +
125   - " <if test='online == false' > AND dc.status=0</if>" +
126   - " <if test='hasSubChannel == true' > AND dc.subCount > 0 </if>" +
127   - " <if test='hasSubChannel == false' > AND dc.subCount = 0 </if>" +
128   - "<if test='channelIds != null'> AND dc.channelId in <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
  120 + " <if test='deviceId != null'> AND dc.device_id = #{deviceId} </if> " +
  121 + " <if test='query != null'> AND (dc.channel_id LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " +
  122 + " <if test='parentChannelId != null'> AND dc.parent_id=#{parentChannelId} </if> " +
  123 + " <if test='online == true' > AND dc.status=true</if>" +
  124 + " <if test='online == false' > AND dc.status=false</if>" +
  125 + " <if test='hasSubChannel == true' > AND dc.sub_count > 0 </if>" +
  126 + " <if test='hasSubChannel == false' > AND dc.sub_count = 0 </if>" +
  127 + "<if test='channelIds != null'> AND dc.channel_id in <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
129 128 "#{item} " +
130 129 "</foreach> </if>" +
131   - "ORDER BY dc.channelId ASC " +
  130 + "ORDER BY dc.channel_id ASC " +
132 131 "Limit #{limit} OFFSET #{start}" +
133 132 " </script>"})
134 133 List<DeviceChannelExtend> queryChannelsByDeviceIdWithStartAndLimit(String deviceId,List<String> channelIds, String parentChannelId, String query,
135 134 Boolean hasSubChannel, Boolean online, int start, int limit);
136 135  
137   - @Select("SELECT * FROM device_channel WHERE deviceId=#{deviceId} AND channelId=#{channelId}")
  136 + @Select("SELECT * FROM wvp_device_channel WHERE device_id=#{deviceId} AND channel_id=#{channelId}")
138 137 DeviceChannel queryChannel(String deviceId, String channelId);
139 138  
140   - @Delete("DELETE FROM device_channel WHERE deviceId=#{deviceId}")
  139 + @Delete("DELETE FROM wvp_device_channel WHERE device_id=#{deviceId}")
141 140 int cleanChannelsByDeviceId(String deviceId);
142 141  
143   - @Delete("DELETE FROM device_channel WHERE deviceId=#{deviceId} AND channelId=#{channelId}")
  142 + @Delete("DELETE FROM wvp_device_channel WHERE device_id=#{deviceId} AND channel_id=#{channelId}")
144 143 int del(String deviceId, String channelId);
145 144  
146   - @Update(value = {"UPDATE device_channel SET streamId=null WHERE deviceId=#{deviceId} AND channelId=#{channelId}"})
  145 + @Update(value = {"UPDATE wvp_device_channel SET stream_id=null WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
147 146 void stopPlay(String deviceId, String channelId);
148 147  
149   - @Update(value = {"UPDATE device_channel SET streamId=#{streamId} WHERE deviceId=#{deviceId} AND channelId=#{channelId}"})
  148 + @Update(value = {"UPDATE wvp_device_channel SET stream_id=#{streamId} WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
150 149 void startPlay(String deviceId, String channelId, String streamId);
151 150  
152 151 @Select(value = {" <script>" +
153 152 "SELECT " +
154 153 " dc.id,\n" +
155   - " dc.channelId,\n" +
156   - " dc.deviceId,\n" +
  154 + " dc.channel_id,\n" +
  155 + " dc.device_id,\n" +
157 156 " dc.name,\n" +
158 157 " de.manufacturer,\n" +
159   - " de.hostAddress,\n" +
160   - " dc.subCount,\n" +
161   - " pgc.platformId as platformId,\n" +
162   - " pgc.catalogId as catalogId " +
163   - " FROM device_channel dc " +
164   - " LEFT JOIN device de ON dc.deviceId = de.deviceId " +
165   - " LEFT JOIN platform_gb_channel pgc on pgc.deviceChannelId = dc.id " +
  158 + " de.host_address,\n" +
  159 + " dc.sub_count,\n" +
  160 + " pgc.platform_id as platform_id,\n" +
  161 + " pgc.catalog_id as catalog_id " +
  162 + " FROM wvp_device_channel dc " +
  163 + " LEFT JOIN wvp_device de ON dc.device_id = de.device_id " +
  164 + " LEFT JOIN wvp_platform_gb_channel pgc on pgc.device_channel_id = dc.id " +
166 165 " WHERE 1=1 " +
167   - " <if test='query != null'> AND (dc.channelId LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%'))</if> " +
168   - " <if test='online == true' > AND dc.status=1</if> " +
169   - " <if test='online == false' > AND dc.status=0</if> " +
170   - " <if test='hasSubChannel!= null and hasSubChannel == true' > AND dc.subCount > 0</if> " +
171   - " <if test='hasSubChannel!= null and hasSubChannel == false' > AND dc.subCount = 0</if> " +
172   - " <if test='catalogId == null ' > AND dc.id not in (select deviceChannelId from platform_gb_channel where platformId=#{platformId} ) </if> " +
173   - " <if test='catalogId != null ' > AND pgc.platformId = #{platformId} and pgc.catalogId=#{catalogId} </if> " +
174   - " ORDER BY dc.deviceId, dc.channelId ASC" +
  166 + " <if test='query != null'> AND (dc.channel_id LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%') OR dc.name LIKE concat('%',#{query},'%'))</if> " +
  167 + " <if test='online == true' > AND dc.status=true</if> " +
  168 + " <if test='online == false' > AND dc.status=false</if> " +
  169 + " <if test='hasSubChannel!= null and has_sub_channel == true' > AND dc.sub_count > 0</if> " +
  170 + " <if test='hasSubChannel!= null and has_sub_channel == false' > AND dc.sub_count = 0</if> " +
  171 + " <if test='catalogId == null ' > AND dc.id not in (select device_channel_id from wvp_platform_gb_channel where platform_id=#{platformId} ) </if> " +
  172 + " <if test='catalogId != null ' > AND pgc.platform_id = #{platformId} and pgc.catalog_id=#{catalogId} </if> " +
  173 + " ORDER BY dc.device_id, dc.channel_id ASC" +
175 174 " </script>"})
176 175 List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, String catalogId);
177 176  
178 177 @Select(value = {" <script>" +
179 178 "SELECT " +
180 179 " dc.*,\n" +
181   - " pgc.platformId as platformId,\n" +
182   - " pgc.catalogId as catalogId " +
183   - " FROM device_channel dc " +
184   - " LEFT JOIN platform_gb_channel pgc on pgc.deviceChannelId = dc.id " +
185   - " WHERE pgc.platformId = #{platformId} " +
186   - " ORDER BY dc.deviceId, dc.channelId ASC" +
  180 + " pgc.platform_id as platform_id,\n" +
  181 + " pgc.catalog_id as catalog_id " +
  182 + " FROM wvp_device_channel dc " +
  183 + " LEFT JOIN wvp_platform_gb_channel pgc on pgc.device_channel_id = dc.id " +
  184 + " WHERE pgc.platform_id = #{platformId} " +
  185 + " ORDER BY dc.device_id, dc.channel_id ASC" +
187 186 " </script>"})
188 187 List<DeviceChannelInPlatform> queryChannelByPlatformId(String platformId);
189 188  
190 189  
191   - @Select("SELECT * FROM device_channel WHERE channelId=#{channelId}")
  190 + @Select("SELECT * FROM wvp_device_channel WHERE channel_id=#{channelId}")
192 191 List<DeviceChannel> queryChannelByChannelId( String channelId);
193 192  
194   - @Update(value = {"UPDATE device_channel SET status=0 WHERE deviceId=#{deviceId} AND channelId=#{channelId}"})
  193 + @Update(value = {"UPDATE wvp_device_channel SET status=false WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
195 194 void offline(String deviceId, String channelId);
196 195  
197   - @Update(value = {"UPDATE device_channel SET status=0 WHERE deviceId=#{deviceId}"})
  196 + @Update(value = {"UPDATE wvp_device_channel SET status=fasle WHERE device_id=#{deviceId}"})
198 197 void offlineByDeviceId(String deviceId);
199 198  
200   -// @Insert("<script> " +
201   -// "insert into device_channel " +
202   -// "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " +
203   -// " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
204   -// " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
205   -// " longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " +
206   -// "values " +
207   -// "<foreach collection='addChannels' index='index' item='item' separator=','> " +
208   -// "(#{item.channelId}, #{item.deviceId}, #{item.name}, #{item.manufacture}, #{item.model}, " +
209   -// "#{item.owner}, #{item.civilCode}, #{item.block},#{item.subCount}," +
210   -// "#{item.address}, #{item.parental}, #{item.parentId}, #{item.safetyWay}, #{item.registerWay}, " +
211   -// "#{item.certNum}, #{item.certifiable}, #{item.errCode}, #{item.secrecy}, " +
212   -// "#{item.ipAddress}, #{item.port}, #{item.password}, #{item.PTZType}, #{item.status}, " +
213   -// "#{item.streamId}, #{item.longitude}, #{item.latitude},#{item.longitudeGcj02}, " +
214   -// "#{item.latitudeGcj02},#{item.longitudeWgs84}, #{item.latitudeWgs84}, #{item.hasAudio}, now(), now(), " +
215   -// "#{item.businessGroupId}, #{item.gpsTime}) " +
216   -// "</foreach> " +
217   -// "ON DUPLICATE KEY UPDATE " +
218   -// "updateTime=VALUES(updateTime), " +
219   -// "name=VALUES(name), " +
220   -// "manufacture=VALUES(manufacture), " +
221   -// "model=VALUES(model), " +
222   -// "owner=VALUES(owner), " +
223   -// "civilCode=VALUES(civilCode), " +
224   -// "block=VALUES(block), " +
225   -// "subCount=VALUES(subCount), " +
226   -// "address=VALUES(address), " +
227   -// "parental=VALUES(parental), " +
228   -// "parentId=VALUES(parentId), " +
229   -// "safetyWay=VALUES(safetyWay), " +
230   -// "registerWay=VALUES(registerWay), " +
231   -// "certNum=VALUES(certNum), " +
232   -// "certifiable=VALUES(certifiable), " +
233   -// "errCode=VALUES(errCode), " +
234   -// "secrecy=VALUES(secrecy), " +
235   -// "ipAddress=VALUES(ipAddress), " +
236   -// "port=VALUES(port), " +
237   -// "password=VALUES(password), " +
238   -// "PTZType=VALUES(PTZType), " +
239   -// "status=VALUES(status), " +
240   -// "streamId=VALUES(streamId), " +
241   -// "longitude=VALUES(longitude), " +
242   -// "latitude=VALUES(latitude), " +
243   -// "longitudeGcj02=VALUES(longitudeGcj02), " +
244   -// "latitudeGcj02=VALUES(latitudeGcj02), " +
245   -// "longitudeWgs84=VALUES(longitudeWgs84), " +
246   -// "latitudeWgs84=VALUES(latitudeWgs84), " +
247   -// "hasAudio=VALUES(hasAudio), " +
248   -// "businessGroupId=VALUES(businessGroupId), " +
249   -// "gpsTime=VALUES(gpsTime)" +
250   -// "</script>")
251   -// int batchAdd(List<DeviceChannel> addChannels);
252   -
253   -
254 199 @Insert("<script> " +
255   - "insert into device_channel " +
256   - "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " +
257   - " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
258   - " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
259   - " longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " +
  200 + "insert into wvp_device_channel " +
  201 + "(channel_id, device_id, name, manufacture, model, owner, civil_code, block, sub_count, " +
  202 + " address, parental, parent_id, safety_way, register_way, cert_num, certifiable, err_code, secrecy, " +
  203 + " ip_address,port,password,ptz_type,status,stream_id,longitude,latitude,longitude_gcj02,latitude_gcj02,"+
  204 + " longitude_wgs84,latitude_wgs84,has_audio,create_time,update_time,business_group_id,gps_time)"+
260 205 "values " +
261 206 "<foreach collection='addChannels' index='index' item='item' separator=','> " +
262 207 "(#{item.channelId}, #{item.deviceId}, #{item.name}, #{item.manufacture}, #{item.model}, " +
... ... @@ -273,11 +218,11 @@ public interface DeviceChannelMapper {
273 218  
274 219  
275 220 @Insert("<script> " +
276   - "insert into device_channel " +
277   - "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " +
278   - " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
279   - " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
280   - " longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " +
  221 + "insert into wvp_device_channel " +
  222 + "(channel_id,device_id,name,manufacture,model,owner,civil_code,block,sub_count,"+
  223 + " address,parental,parent_id,safety_way,register_way,cert_num,certifiable,err_code,secrecy,"+
  224 + " ip_address,port,password,ptz_type,status,stream_id,longitude,latitude,longitude_gcj02,latitude_gcj02,"+
  225 + " longitude_wgs84,latitude_wgs84,has_audio,create_time,update_time,business_group_id,gps_time)"+
281 226 "values " +
282 227 "<foreach collection='addChannels' index='index' item='item' separator=','> " +
283 228 "(#{item.channelId}, #{item.deviceId}, #{item.name}, #{item.manufacture}, #{item.model}, " +
... ... @@ -290,215 +235,219 @@ public interface DeviceChannelMapper {
290 235 "#{item.businessGroupId}, #{item.gpsTime}) " +
291 236 "</foreach> " +
292 237 "ON DUPLICATE KEY UPDATE " +
293   - "updateTime=VALUES(updateTime), " +
  238 + "update_time=VALUES(update_time), " +
294 239 "name=VALUES(name), " +
295 240 "manufacture=VALUES(manufacture), " +
296 241 "model=VALUES(model), " +
297 242 "owner=VALUES(owner), " +
298   - "civilCode=VALUES(civilCode), " +
  243 + "civil_code=VALUES(civil_code), " +
299 244 "block=VALUES(block), " +
300   - "subCount=VALUES(subCount), " +
  245 + "sub_count=VALUES(sub_count), " +
301 246 "address=VALUES(address), " +
302 247 "parental=VALUES(parental), " +
303   - "parentId=VALUES(parentId), " +
304   - "safetyWay=VALUES(safetyWay), " +
305   - "registerWay=VALUES(registerWay), " +
306   - "certNum=VALUES(certNum), " +
  248 + "parent_id=VALUES(parent_id), " +
  249 + "safety_way=VALUES(safety_way), " +
  250 + "register_way=VALUES(register_way), " +
  251 + "cert_num=VALUES(cert_num), " +
307 252 "certifiable=VALUES(certifiable), " +
308   - "errCode=VALUES(errCode), " +
  253 + "err_code=VALUES(err_code), " +
309 254 "secrecy=VALUES(secrecy), " +
310   - "ipAddress=VALUES(ipAddress), " +
  255 + "ip_address=VALUES(ip_address), " +
311 256 "port=VALUES(port), " +
312 257 "password=VALUES(password), " +
313   - "PTZType=VALUES(PTZType), " +
  258 + "ptz_type=VALUES(ptz_type), " +
314 259 "status=VALUES(status), " +
315   - "streamId=VALUES(streamId), " +
  260 + "stream_id=VALUES(stream_id), " +
316 261 "longitude=VALUES(longitude), " +
317 262 "latitude=VALUES(latitude), " +
318   - "longitudeGcj02=VALUES(longitudeGcj02), " +
319   - "latitudeGcj02=VALUES(latitudeGcj02), " +
320   - "longitudeWgs84=VALUES(longitudeWgs84), " +
321   - "latitudeWgs84=VALUES(latitudeWgs84), " +
322   - "hasAudio=VALUES(hasAudio), " +
323   - "businessGroupId=VALUES(businessGroupId), " +
324   - "gpsTime=VALUES(gpsTime)" +
  263 + "longitude_gcj02=VALUES(longitude_gcj02), " +
  264 + "latitude_gcj02=VALUES(latitude_gcj02), " +
  265 + "longitude_wgs84=VALUES(longitude_wgs84), " +
  266 + "latitude_wgs84=VALUES(latitude_wgs84), " +
  267 + "has_audio=VALUES(has_audio), " +
  268 + "business_group_id=VALUES(business_group_id), " +
  269 + "gps_time=VALUES(gps_time)" +
325 270 "</script>")
326 271 int batchAddOrUpdate(List<DeviceChannel> addChannels);
327 272  
328   - @Update(value = {"UPDATE device_channel SET status=1 WHERE deviceId=#{deviceId} AND channelId=#{channelId}"})
  273 + @Update(value = {"UPDATE wvp_device_channel SET status=true WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
329 274 void online(String deviceId, String channelId);
330 275  
331 276 @Update({"<script>" +
332 277 "<foreach collection='updateChannels' item='item' separator=';'>" +
333 278 " UPDATE" +
334   - " device_channel" +
335   - " SET updateTime=#{item.updateTime}" +
  279 + " wvp_device_channel" +
  280 + " SET update_time=#{item.updateTime}" +
336 281 "<if test='item.name != null'>, name=#{item.name}</if>" +
337 282 "<if test='item.manufacture != null'>, manufacture=#{item.manufacture}</if>" +
338 283 "<if test='item.model != null'>, model=#{item.model}</if>" +
339 284 "<if test='item.owner != null'>, owner=#{item.owner}</if>" +
340   - "<if test='item.civilCode != null'>, civilCode=#{item.civilCode}</if>" +
  285 + "<if test='item.civilCode != null'>, civil_code=#{item.civilCode}</if>" +
341 286 "<if test='item.block != null'>, block=#{item.block}</if>" +
342   - "<if test='item.subCount != null'>, subCount=#{item.subCount}</if>" +
  287 + "<if test='item.subCount != null'>, sub_count=#{item.subCount}</if>" +
343 288 "<if test='item.address != null'>, address=#{item.address}</if>" +
344 289 "<if test='item.parental != null'>, parental=#{item.parental}</if>" +
345   - "<if test='item.parentId != null'>, parentId=#{item.parentId}</if>" +
346   - "<if test='item.safetyWay != null'>, safetyWay=#{item.safetyWay}</if>" +
347   - "<if test='item.registerWay != null'>, registerWay=#{item.registerWay}</if>" +
348   - "<if test='item.certNum != null'>, certNum=#{item.certNum}</if>" +
  290 + "<if test='item.parentId != null'>, parent_id=#{item.parentId}</if>" +
  291 + "<if test='item.safetyWay != null'>, safety_way=#{item.safetyWay}</if>" +
  292 + "<if test='item.registerWay != null'>, register_way=#{item.registerWay}</if>" +
  293 + "<if test='item.certNum != null'>, cert_num=#{item.certNum}</if>" +
349 294 "<if test='item.certifiable != null'>, certifiable=#{item.certifiable}</if>" +
350   - "<if test='item.errCode != null'>, errCode=#{item.errCode}</if>" +
  295 + "<if test='item.errCode != null'>, err_code=#{item.errCode}</if>" +
351 296 "<if test='item.secrecy != null'>, secrecy=#{item.secrecy}</if>" +
352   - "<if test='item.ipAddress != null'>, ipAddress=#{item.ipAddress}</if>" +
  297 + "<if test='item.ipAddress != null'>, ip_address=#{item.ipAddress}</if>" +
353 298 "<if test='item.port != null'>, port=#{item.port}</if>" +
354 299 "<if test='item.password != null'>, password=#{item.password}</if>" +
355   - "<if test='item.PTZType != null'>, PTZType=#{item.PTZType}</if>" +
  300 + "<if test='item.PTZType != null'>, ptz_type=#{item.PTZType}</if>" +
356 301 "<if test='item.status != null'>, status=#{item.status}</if>" +
357   - "<if test='item.streamId != null'>, streamId=#{item.streamId}</if>" +
358   - "<if test='item.hasAudio != null'>, hasAudio=#{item.hasAudio}</if>" +
  302 + "<if test='item.streamId != null'>, stream_id=#{item.streamId}</if>" +
  303 + "<if test='item.hasAudio != null'>, has_audio=#{item.hasAudio}</if>" +
359 304 "<if test='item.longitude != null'>, longitude=#{item.longitude}</if>" +
360 305 "<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" +
361   - "<if test='item.longitudeGcj02 != null'>, longitudeGcj02=#{item.longitudeGcj02}</if>" +
362   - "<if test='item.latitudeGcj02 != null'>, latitudeGcj02=#{item.latitudeGcj02}</if>" +
363   - "<if test='item.longitudeWgs84 != null'>, longitudeWgs84=#{item.longitudeWgs84}</if>" +
364   - "<if test='item.latitudeWgs84 != null'>, latitudeWgs84=#{item.latitudeWgs84}</if>" +
365   - "<if test='item.businessGroupId != null'>, businessGroupId=#{item.businessGroupId}</if>" +
366   - "<if test='item.gpsTime != null'>, gpsTime=#{item.gpsTime}</if>" +
  306 + "<if test='item.longitudeGcj02 != null'>, longitude_gcj02=#{item.longitudeGcj02}</if>" +
  307 + "<if test='item.latitudeGcj02 != null'>, latitude_gcj02=#{item.latitudeGcj02}</if>" +
  308 + "<if test='item.longitudeWgs84 != null'>, longitude_wgs84=#{item.longitudeWgs84}</if>" +
  309 + "<if test='item.latitudeWgs84 != null'>, latitude_wgs84=#{item.latitudeWgs84}</if>" +
  310 + "<if test='item.businessGroupId != null'>, business_group_id=#{item.businessGroupId}</if>" +
  311 + "<if test='item.gpsTime != null'>, gps_time=#{item.gpsTime}</if>" +
367 312 "<if test='item.id > 0'>WHERE id=#{item.id}</if>" +
368   - "<if test='item.id == 0'>WHERE deviceId=#{item.deviceId} AND channelId=#{item.channelId}</if>" +
  313 + "<if test='item.id == 0'>WHERE device_id=#{item.deviceId} AND channel_id=#{item.channelId}</if>" +
369 314 "</foreach>" +
370 315 "</script>"})
371 316 int batchUpdate(List<DeviceChannel> updateChannels);
372 317  
373 318  
374   - @Select("SELECT * FROM device_channel WHERE deviceId=#{deviceId} AND status=1")
  319 + @Select("SELECT * FROM wvp_device_channel WHERE device_id=#{deviceId} AND status=true")
375 320 List<DeviceChannel> queryOnlineChannelsByDeviceId(String deviceId);
376 321  
377 322 @Delete(value = {" <script>" +
378 323 "DELETE " +
379 324 "from " +
380   - "device_channel " +
  325 + "wvp_device_channel " +
381 326 "WHERE " +
382   - "deviceId = #{deviceId} " +
383   - " AND channelId NOT IN " +
  327 + "device_id = #{deviceId} " +
  328 + " AND channel_id NOT IN " +
384 329 "<foreach collection='channels' item='item' open='(' separator=',' close=')' > #{item.channelId}</foreach>" +
385 330 " </script>"})
386 331 int cleanChannelsNotInList(String deviceId, List<DeviceChannel> channels);
387 332  
388   - @Update(" update device_channel" +
389   - " set subCount = (select *" +
  333 + @Update(" update wvp_device_channel" +
  334 + " set sub_count = (select *" +
390 335 " from (select count(0)" +
391   - " from device_channel" +
392   - " where deviceId = #{deviceId} and parentId = #{channelId}) as temp)" +
393   - " where deviceId = #{deviceId} " +
394   - " and channelId = #{channelId}")
  336 + " from wvp_device_channel" +
  337 + " where device_id = #{deviceId} and parent_id = #{channelId}) as temp)" +
  338 + " where device_id = #{deviceId} " +
  339 + " and channel_id = #{channelId}")
395 340 int updateChannelSubCount(String deviceId, String channelId);
396 341  
397 342 @Update(value = {" <script>" +
398   - "UPDATE device_channel " +
  343 + "UPDATE wvp_device_channel " +
399 344 "SET " +
400 345 "latitude=#{latitude}, " +
401 346 "longitude=#{longitude}, " +
402   - "longitudeGcj02=#{longitudeGcj02}, " +
403   - "latitudeGcj02=#{latitudeGcj02}, " +
404   - "longitudeWgs84=#{longitudeWgs84}, " +
405   - "latitudeWgs84=#{latitudeWgs84}, " +
406   - "gpsTime=#{gpsTime} " +
407   - "WHERE deviceId=#{deviceId} " +
408   - " <if test='channelId != null' > AND channelId=#{channelId}</if>" +
  347 + "longitude_gcj02=#{longitudeGcj02}, " +
  348 + "latitude_gcj02=#{latitudeGcj02}, " +
  349 + "longitude_wgs84=#{longitudeWgs84}, " +
  350 + "latitude_wgs84=#{latitudeWgs84}, " +
  351 + "gps_time=#{gpsTime} " +
  352 + "WHERE device_id=#{deviceId} " +
  353 + " <if test='channelId != null' > AND channel_id=#{channelId}</if>" +
409 354 " </script>"})
410 355 void updatePosition(DeviceChannel deviceChannel);
411 356  
412   - @Select("SELECT * FROM device_channel WHERE length(trim(streamId)) > 0")
  357 + @Select("SELECT * FROM wvp_device_channel WHERE length(trim(stream_id)) > 0")
413 358 List<DeviceChannel> getAllChannelInPlay();
414 359  
415   - @Select("select * from device_channel where longitude*latitude > 0 and deviceId = #{deviceId}")
  360 + @Select("select * from wvp_device_channel where longitude*latitude > 0 and device_id = #{deviceId}")
416 361 List<DeviceChannel> getAllChannelWithCoordinate(String deviceId);
417 362  
418 363  
419 364 @Select(value = {" <script>" +
420 365 "select * " +
421   - "from device_channel " +
422   - "where deviceId=#{deviceId}" +
423   - " <if test='parentId != null and length != null' > and parentId = #{parentId} or left(channelId, LENGTH(#{parentId})) = #{parentId} and length(channelId)=#{length} </if>" +
424   - " <if test='parentId == null and length != null' > and parentId = #{parentId} or length(channelId)=#{length} </if>" +
425   - " <if test='parentId == null and length == null' > and parentId = #{parentId} </if>" +
426   - " <if test='parentId != null and length == null' > and parentId = #{parentId} or left(channelId, LENGTH(#{parentId})) = #{parentId} </if>" +
  366 + "from wvp_device_channel " +
  367 + "where device_id=#{deviceId}" +
  368 + " <if test='parentId != null and length != null' > and parent_id= #{parentId} or left(channel_id, LENGTH(#{parentId})) = #{parentId} and length(channel_id)=#{length} </if>" +
  369 + " <if test='parentId == null and length != null' > and parent_id= #{parentId} or length(channel_id)=#{length} </if>" +
  370 + " <if test='parentId == null and length == null' > and parent_id= #{parentId} </if>" +
  371 + " <if test='parentId != null and length == null' > and parent_id= #{parentId} or left(channel_id, LENGTH(#{parentId})) = #{parentId} </if>" +
427 372 " </script>"})
428 373 List<DeviceChannel> getChannelsWithCivilCodeAndLength(String deviceId, String parentId, Integer length);
429 374  
430 375 @Select(value = {" <script>" +
431 376 "select * " +
432   - "from device_channel " +
433   - "where deviceId=#{deviceId} and length(channelId)>14 and civilCode=#{parentId}" +
  377 + "from wvp_device_channel " +
  378 + "where device_id=#{deviceId} and length(channel_id)>14 and civil_code=#{parentId}" +
434 379 " </script>"})
435 380 List<DeviceChannel> getChannelsByCivilCode(String deviceId, String parentId);
436 381  
437   - @Select("select min(length(channelId)) as minLength " +
438   - "from device_channel " +
439   - "where deviceId=#{deviceId}")
  382 + @Select("select min(length(channel_id)) as minLength " +
  383 + "from wvp_device_channel " +
  384 + "where device_id=#{deviceId}")
440 385 Integer getChannelMinLength(String deviceId);
441 386  
442   - @Select("select * from device_channel where deviceId=#{deviceId} and civilCode not in " +
443   - "(select civilCode from device_channel where deviceId=#{deviceId} group by civilCode)")
444   - List<DeviceChannel> getChannelWithoutCiviCode(String deviceId);
  387 + @Select("select * from wvp_device_channel where device_id=#{deviceId} and civil_code not in " +
  388 + "(select civil_code from wvp_device_channel where device_id=#{deviceId} group by civil_code)")
  389 + List<DeviceChannel> getChannelWithoutCivilCode(String deviceId);
445 390  
446   - @Select("select * from device_channel where deviceId=#{deviceId} and SUBSTRING(channelId, 11, 3)=#{typeCode}")
  391 + @Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}")
447 392 List<DeviceChannel> getBusinessGroups(String deviceId, String typeCode);
448 393  
449   - @Select("select dc.id, dc.channelId, dc.deviceId, dc.name, dc.manufacture,dc.model,dc.owner, pc.civilCode,dc.block, " +
450   - " dc.address, '0' as parental,'0' as channelType, pc.id as parentId, dc.safetyWay, dc.registerWay,dc.certNum, dc.certifiable, " +
451   - " dc.errCode,dc.endTime, dc.secrecy, dc.ipAddress, dc.port, dc.PTZType, dc.password, dc.status, " +
452   - " dc.longitudeWgs84 as longitude, dc.latitudeWgs84 as latitude, pc.businessGroupId " +
453   - " from device_channel dc" +
454   - " left join platform_gb_channel pgc on dc.id = pgc.deviceChannelId" +
455   - " left join platform_catalog pc on pgc.catalogId = pc.id and pgc.platformId = pc.platformId" +
456   - " where pgc.platformId=#{serverGBId}")
  394 + @Select("select dc.id, dc.channel_id, dc.device_id, dc.name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " +
  395 + " dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " +
  396 + " dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, dc.ptz_type, dc.password, dc.status, " +
  397 + " dc.longitude_wgs84 as longitude, dc.latitude_wgs84 as latitude, pc.business_group_id " +
  398 + " from wvp_device_channel dc" +
  399 + " LEFT JOIN wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id" +
  400 + " LEFT JOIN wvp_platform_catalog pc on pgc.catalog_id = pc.id and pgc.platform_id = pc.platform_id" +
  401 + " where pgc.platform_id=#{serverGBId}")
457 402 List<DeviceChannel> queryChannelWithCatalog(String serverGBId);
458 403  
459   - @Select("select * from device_channel where deviceId = #{deviceId}")
  404 + @Select("select * from wvp_device_channel where device_id = #{deviceId}")
460 405 List<DeviceChannel> queryAllChannels(String deviceId);
461 406  
462 407  
463   - @Select("select count(1) as total, sum(status) as online from device_channel")
464   - ResourceBaceInfo getOverview();
465   -
466 408 @Select("select channelId" +
467   - ", deviceId" +
  409 + ", device_id" +
468 410 ", latitude" +
469   - ", longitude" +
470   - ", latitudeWgs84" +
471   - ", longitudeWgs84" +
472   - ", latitudeGcj02" +
473   - ", longitudeGcj02 " +
474   - "from device_channel where deviceId = #{deviceId} " +
  411 + ", longitude"+
  412 + ",latitude_wgs84"+
  413 + ",longitude_wgs84"+
  414 + ",latitude_gcj02"+
  415 + ",longitude_gcj02"+
  416 + "from wvp_device_channel where device_id = #{deviceId} " +
475 417 "and latitude != 0 " +
476 418 "and longitude != 0 " +
477   - "and (latitudeGcj02 = 0 or latitudeWgs84 = 0 or longitudeWgs84 = 0 or longitudeGcj02 = 0)")
  419 + "and(latitude_gcj02=0 or latitude_wgs84=0 or longitude_wgs84= 0 or longitude_gcj02 = 0)")
478 420 List<DeviceChannel> getChannelsWithoutTransform(String deviceId);
479 421  
480   - @Select("select de.* from device de left join device_channel dc on de.deviceId = dc.deviceId where dc.channelId=#{channelId}")
  422 + @Select("select de.* from wvp_device de left join wvp_device_channel dc on de.device_id = dc.deviceId where dc.channel_id=#{channelId}")
481 423 List<Device> getDeviceByChannelId(String channelId);
482 424  
483 425  
484 426 @Delete({"<script>" +
485 427 "<foreach collection='deleteChannelList' item='item' separator=';'>" +
486   - "DELETE FROM device_channel WHERE deviceId=#{item.deviceId} AND channelId=#{item.channelId}" +
  428 + "DELETE FROM wvp_device_channel WHERE device_id=#{item.deviceId} AND channel_id=#{item.channelId}" +
487 429 "</foreach>" +
488 430 "</script>"})
489 431 int batchDel(List<DeviceChannel> deleteChannelList);
490 432  
491 433 @Update({"<script>" +
492 434 "<foreach collection='channels' item='item' separator=';'>" +
493   - "UPDATE device_channel SET status=1 WHERE deviceId=#{item.deviceId} AND channelId=#{item.channelId}" +
  435 + "UPDATE wvp_device_channel SET status=true WHERE device_id=#{item.deviceId} AND channel_id=#{item.channelId}" +
494 436 "</foreach>" +
495 437 "</script>"})
496 438 int batchOnline(List<DeviceChannel> channels);
497 439  
498 440 @Update({"<script>" +
499 441 "<foreach collection='channels' item='item' separator=';'>" +
500   - "UPDATE device_channel SET status=0 WHERE deviceId=#{item.deviceId} AND channelId=#{item.channelId}" +
  442 + "UPDATE wvp_device_channel SET status= false WHERE device_id=#{item.deviceId} AND channel_id=#{item.channelId}" +
501 443 "</foreach>" +
502 444 "</script>"})
503 445 int batchOffline(List<DeviceChannel> channels);
  446 +
  447 +
  448 + @Select("select count(1) from wvp_device_channel where status = true")
  449 + int getOnlineCount();
  450 +
  451 + @Select("select count(1) from wvp_device_channel")
  452 + int getAllChannelCount();
504 453 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
1 1 package com.genersoft.iot.vmp.storager.dao;
2 2  
3 3 import com.genersoft.iot.vmp.gb28181.bean.Device;
4   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
5 4 import org.apache.ibatis.annotations.*;
6 5 import org.springframework.stereotype.Repository;
7 6  
... ... @@ -15,68 +14,68 @@ import java.util.List;
15 14 public interface DeviceMapper {
16 15  
17 16 @Select("SELECT " +
18   - "deviceId, " +
  17 + "device_id, " +
19 18 "coalesce(custom_name, name) as name, " +
20 19 "password, " +
21 20 "manufacturer, " +
22 21 "model, " +
23 22 "firmware, " +
24 23 "transport," +
25   - "streamMode," +
  24 + "stream_mode," +
26 25 "ip," +
27   - "sdpIp," +
28   - "localIp," +
  26 + "sdp_ip," +
  27 + "local_ip," +
29 28 "port," +
30   - "hostAddress," +
  29 + "host_address," +
31 30 "expires," +
32   - "registerTime," +
33   - "keepaliveTime," +
34   - "createTime," +
35   - "updateTime," +
  31 + "register_time," +
  32 + "keepalive_time," +
  33 + "create_time," +
  34 + "update_time," +
36 35 "charset," +
37   - "subscribeCycleForCatalog," +
38   - "subscribeCycleForMobilePosition," +
39   - "mobilePositionSubmissionInterval," +
40   - "subscribeCycleForAlarm," +
41   - "ssrcCheck," +
42   - "asMessageChannel," +
43   - "geoCoordSys," +
44   - "treeType," +
45   - "online," +
46   - "mediaServerId," +
47   - "(SELECT count(0) FROM device_channel WHERE deviceId=device.deviceId) as channelCount "+
48   - " FROM device WHERE deviceId = #{deviceId}")
  36 + "subscribe_cycle_for_catalog," +
  37 + "subscribe_cycle_for_mobile_position," +
  38 + "mobile_position_submission_interval," +
  39 + "subscribe_cycle_for_alarm," +
  40 + "ssrc_check," +
  41 + "as_message_channel," +
  42 + "geo_coord_sys," +
  43 + "tree_type," +
  44 + "on_line," +
  45 + "media_server_id," +
  46 + "(SELECT count(0) FROM wvp_device_channel WHERE device_id=wvp_device.device_id) as channel_count "+
  47 + " FROM wvp_device WHERE device_id = #{deviceId}")
49 48 Device getDeviceByDeviceId(String deviceId);
50 49  
51   - @Insert("INSERT INTO device (" +
52   - "deviceId, " +
  50 + @Insert("INSERT INTO wvp_device (" +
  51 + "device_id, " +
53 52 "name, " +
54 53 "manufacturer, " +
55 54 "model, " +
56 55 "firmware, " +
57 56 "transport," +
58   - "streamMode," +
  57 + "stream_mode," +
59 58 "ip," +
60   - "sdpIp," +
61   - "localIp," +
  59 + "sdp_ip," +
  60 + "local_ip," +
62 61 "port," +
63   - "hostAddress," +
  62 + "host_address," +
64 63 "expires," +
65   - "registerTime," +
66   - "keepaliveTime," +
67   - "keepaliveIntervalTime," +
68   - "createTime," +
69   - "updateTime," +
  64 + "register_time," +
  65 + "keepalive_time," +
  66 + "keepalive_interval_time," +
  67 + "create_time," +
  68 + "update_time," +
70 69 "charset," +
71   - "subscribeCycleForCatalog," +
72   - "subscribeCycleForMobilePosition," +
73   - "mobilePositionSubmissionInterval," +
74   - "subscribeCycleForAlarm," +
75   - "ssrcCheck," +
76   - "asMessageChannel," +
77   - "geoCoordSys," +
78   - "treeType," +
79   - "online" +
  70 + "subscribe_cycle_for_catalog," +
  71 + "subscribe_cycle_for_mobile_position,"+
  72 + "mobile_position_submission_interval,"+
  73 + "subscribe_cycle_for_alarm,"+
  74 + "ssrc_check,"+
  75 + "as_message_channel,"+
  76 + "geo_coord_sys,"+
  77 + "tree_type,"+
  78 + "on_line"+
80 79 ") VALUES (" +
81 80 "#{deviceId}," +
82 81 "#{name}," +
... ... @@ -105,172 +104,174 @@ public interface DeviceMapper {
105 104 "#{asMessageChannel}," +
106 105 "#{geoCoordSys}," +
107 106 "#{treeType}," +
108   - "#{online}" +
  107 + "#{onLine}" +
109 108 ")")
110 109 int add(Device device);
111 110  
112 111 @Update(value = {" <script>" +
113   - "UPDATE device " +
114   - "SET updateTime=#{updateTime}" +
  112 + "UPDATE wvp_device " +
  113 + "SET update_time=#{updateTime}" +
115 114 "<if test=\"name != null\">, name=#{name}</if>" +
116 115 "<if test=\"manufacturer != null\">, manufacturer=#{manufacturer}</if>" +
117 116 "<if test=\"model != null\">, model=#{model}</if>" +
118 117 "<if test=\"firmware != null\">, firmware=#{firmware}</if>" +
119 118 "<if test=\"transport != null\">, transport=#{transport}</if>" +
120 119 "<if test=\"ip != null\">, ip=#{ip}</if>" +
121   - "<if test=\"localIp != null\">, localIp=#{localIp}</if>" +
  120 + "<if test=\"localIp != null\">, local_ip=#{localIp}</if>" +
122 121 "<if test=\"port != null\">, port=#{port}</if>" +
123   - "<if test=\"hostAddress != null\">, hostAddress=#{hostAddress}</if>" +
124   - "<if test=\"online != null\">, online=#{online}</if>" +
125   - "<if test=\"registerTime != null\">, registerTime=#{registerTime}</if>" +
126   - "<if test=\"keepaliveTime != null\">, keepaliveTime=#{keepaliveTime}</if>" +
127   - "<if test=\"keepaliveIntervalTime != null\">, keepaliveIntervalTime=#{keepaliveIntervalTime}</if>" +
  122 + "<if test=\"hostAddress != null\">, host_address=#{hostAddress}</if>" +
  123 + "<if test=\"onLine != null\">, on_line=#{onLine}</if>" +
  124 + "<if test=\"registerTime != null\">, register_time=#{registerTime}</if>" +
  125 + "<if test=\"keepaliveTime != null\">, keepalive_time=#{keepaliveTime}</if>" +
  126 + "<if test=\"keepaliveIntervalTime != null\">, keepalive_interval_time=#{keepaliveIntervalTime}</if>" +
128 127 "<if test=\"expires != null\">, expires=#{expires}</if>" +
129   - "WHERE deviceId=#{deviceId}"+
  128 + "WHERE device_id=#{deviceId}"+
130 129 " </script>"})
131 130 int update(Device device);
132 131  
133 132 @Select(
134 133 " <script>" +
135 134 "SELECT " +
136   - "deviceId, " +
  135 + "device_id, " +
137 136 "coalesce(custom_name, name) as name, " +
138 137 "password, " +
139 138 "manufacturer, " +
140 139 "model, " +
141 140 "firmware, " +
142 141 "transport," +
143   - "streamMode," +
144   - "ip," +
145   - "sdpIp," +
146   - "localIp," +
147   - "port," +
148   - "hostAddress," +
149   - "expires," +
150   - "registerTime," +
151   - "keepaliveTime," +
152   - "createTime," +
153   - "updateTime," +
154   - "charset," +
155   - "subscribeCycleForCatalog," +
156   - "subscribeCycleForMobilePosition," +
157   - "mobilePositionSubmissionInterval," +
158   - "subscribeCycleForAlarm," +
159   - "ssrcCheck," +
160   - "asMessageChannel," +
161   - "geoCoordSys," +
162   - "treeType," +
163   - "online," +
164   - "mediaServerId," +
165   - "(SELECT count(0) FROM device_channel WHERE deviceId=de.deviceId) as channelCount FROM device de" +
166   - "<if test=\"online != null\"> where online=${online}</if>"+
  142 + "stream_mode," +
  143 + "ip,"+
  144 + "sdp_ip,"+
  145 + "local_ip,"+
  146 + "port,"+
  147 + "host_address,"+
  148 + "expires,"+
  149 + "register_time,"+
  150 + "keepalive_time,"+
  151 + "create_time,"+
  152 + "update_time,"+
  153 + "charset,"+
  154 + "subscribe_cycle_for_catalog,"+
  155 + "subscribe_cycle_for_mobile_position,"+
  156 + "mobile_position_submission_interval,"+
  157 + "subscribe_cycle_for_alarm,"+
  158 + "ssrc_check,"+
  159 + "as_message_channel,"+
  160 + "geo_coord_sys,"+
  161 + "tree_type,"+
  162 + "on_line,"+
  163 + "media_server_id,"+
  164 + "(SELECT count(0) FROM wvp_device_channel WHERE device_id=de.device_id) as channel_count " +
  165 + "FROM wvp_device de" +
  166 + "<if test=\"onLine != null\"> where on_line=${onLine}</if>"+
  167 + " order by create_time desc "+
167 168 " </script>"
168 169 )
169   - List<Device> getDevices(Boolean online);
  170 + List<Device> getDevices(Boolean onLine);
170 171  
171   - @Delete("DELETE FROM device WHERE deviceId=#{deviceId}")
  172 + @Delete("DELETE FROM wvp_device WHERE device_id=#{deviceId}")
172 173 int del(String deviceId);
173 174  
174 175 @Select("SELECT " +
175   - "deviceId, " +
  176 + "device_id, " +
176 177 "coalesce(custom_name, name) as name, " +
177 178 "password, " +
178 179 "manufacturer, " +
179 180 "model, " +
180 181 "firmware, " +
181 182 "transport," +
182   - "streamMode," +
  183 + "stream_mode," +
183 184 "ip," +
184   - "sdpIp," +
185   - "localIp," +
186   - "port," +
187   - "hostAddress," +
188   - "expires," +
189   - "registerTime," +
190   - "keepaliveTime," +
191   - "createTime," +
192   - "updateTime," +
193   - "charset," +
194   - "subscribeCycleForCatalog," +
195   - "subscribeCycleForMobilePosition," +
196   - "mobilePositionSubmissionInterval," +
197   - "subscribeCycleForAlarm," +
198   - "ssrcCheck," +
199   - "asMessageChannel," +
200   - "geoCoordSys," +
201   - "treeType," +
202   - "online " +
203   - " FROM device WHERE online = 1")
  185 + "sdp_ip,"+
  186 + "local_ip,"+
  187 + "port,"+
  188 + "host_address,"+
  189 + "expires,"+
  190 + "register_time,"+
  191 + "keepalive_time,"+
  192 + "create_time,"+
  193 + "update_time,"+
  194 + "charset,"+
  195 + "subscribe_cycle_for_catalog,"+
  196 + "subscribe_cycle_for_mobile_position,"+
  197 + "mobile_position_submission_interval,"+
  198 + "subscribe_cycle_for_alarm,"+
  199 + "ssrc_check,"+
  200 + "as_message_channel,"+
  201 + "geo_coord_sys,"+
  202 + "tree_type,"+
  203 + "on_line"+
  204 + " FROM wvp_device WHERE on_line = true")
204 205 List<Device> getOnlineDevices();
205 206 @Select("SELECT " +
206   - "deviceId, " +
207   - "coalesce(custom_name, name) as name, " +
208   - "password, " +
209   - "manufacturer, " +
210   - "model, " +
211   - "firmware, " +
212   - "transport," +
213   - "streamMode," +
214   - "ip," +
215   - "sdpIp," +
216   - "localIp," +
217   - "port," +
218   - "hostAddress," +
219   - "expires," +
220   - "registerTime," +
221   - "keepaliveTime," +
222   - "createTime," +
223   - "updateTime," +
224   - "charset," +
225   - "subscribeCycleForCatalog," +
226   - "subscribeCycleForMobilePosition," +
227   - "mobilePositionSubmissionInterval," +
228   - "subscribeCycleForAlarm," +
229   - "ssrcCheck," +
230   - "asMessageChannel," +
231   - "geoCoordSys," +
232   - "treeType," +
233   - "online" +
234   - " FROM device WHERE ip = #{host} AND port=#{port}")
  207 + "device_id,"+
  208 + "coalesce(custom_name,name)as name,"+
  209 + "password,"+
  210 + "manufacturer,"+
  211 + "model,"+
  212 + "firmware,"+
  213 + "transport,"+
  214 + "stream_mode,"+
  215 + "ip,"+
  216 + "sdp_ip,"+
  217 + "local_ip,"+
  218 + "port,"+
  219 + "host_address,"+
  220 + "expires,"+
  221 + "register_time,"+
  222 + "keepalive_time,"+
  223 + "create_time,"+
  224 + "update_time,"+
  225 + "charset,"+
  226 + "subscribe_cycle_for_catalog,"+
  227 + "subscribe_cycle_for_mobile_position,"+
  228 + "mobile_position_submission_interval,"+
  229 + "subscribe_cycle_for_alarm,"+
  230 + "ssrc_check,"+
  231 + "as_message_channel,"+
  232 + "geo_coord_sys,"+
  233 + "tree_type,"+
  234 + "on_line"+
  235 + " FROM wvp_device WHERE ip = #{host} AND port=#{port}")
235 236 Device getDeviceByHostAndPort(String host, int port);
236 237  
237 238 @Update(value = {" <script>" +
238   - "UPDATE device " +
239   - "SET updateTime=#{updateTime}" +
  239 + "UPDATE wvp_device " +
  240 + "SET update_time=#{updateTime}" +
240 241 "<if test=\"name != null\">, custom_name=#{name}</if>" +
241 242 "<if test=\"password != null\">, password=#{password}</if>" +
242   - "<if test=\"streamMode != null\">, streamMode=#{streamMode}</if>" +
  243 + "<if test=\"streamMode != null\">, stream_mode=#{streamMode}</if>" +
243 244 "<if test=\"ip != null\">, ip=#{ip}</if>" +
244   - "<if test=\"sdpIp != null\">, sdpIp=#{sdpIp}</if>" +
  245 + "<if test=\"sdpIp != null\">, sdp_ip=#{sdpIp}</if>" +
245 246 "<if test=\"port != null\">, port=#{port}</if>" +
246 247 "<if test=\"charset != null\">, charset=#{charset}</if>" +
247   - "<if test=\"subscribeCycleForCatalog != null\">, subscribeCycleForCatalog=#{subscribeCycleForCatalog}</if>" +
248   - "<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=#{subscribeCycleForMobilePosition}</if>" +
249   - "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=#{mobilePositionSubmissionInterval}</if>" +
250   - "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=#{subscribeCycleForAlarm}</if>" +
251   - "<if test=\"ssrcCheck != null\">, ssrcCheck=#{ssrcCheck}</if>" +
252   - "<if test=\"asMessageChannel != null\">, asMessageChannel=#{asMessageChannel}</if>" +
253   - "<if test=\"geoCoordSys != null\">, geoCoordSys=#{geoCoordSys}</if>" +
254   - "<if test=\"treeType != null\">, treeType=#{treeType}</if>" +
255   - "<if test=\"mediaServerId != null\">, mediaServerId=#{mediaServerId}</if>" +
256   - "WHERE deviceId=#{deviceId}"+
  248 + "<if test=\"subscribeCycleForCatalog != null\">, subscribe_cycle_for_catalog=#{subscribeCycleForCatalog}</if>" +
  249 + "<if test=\"subscribeCycleForMobilePosition != null\">, subscribe_cycle_for_mobile_position=#{subscribeCycleForMobilePosition}</if>" +
  250 + "<if test=\"mobilePositionSubmissionInterval != null\">, mobile_position_submission_interval=#{mobilePositionSubmissionInterval}</if>" +
  251 + "<if test=\"subscribeCycleForAlarm != null\">, subscribe_cycle_for_alarm=#{subscribeCycleForAlarm}</if>" +
  252 + "<if test=\"ssrcCheck != null\">, ssrc_check=#{ssrcCheck}</if>" +
  253 + "<if test=\"asMessageChannel != null\">, as_message_channel=#{asMessageChannel}</if>" +
  254 + "<if test=\"geoCoordSys != null\">, geo_coord_sys=#{geoCoordSys}</if>" +
  255 + "<if test=\"treeType != null\">, tree_type=#{treeType}</if>" +
  256 + "<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" +
  257 + "WHERE device_id=#{deviceId}"+
257 258 " </script>"})
258 259 void updateCustom(Device device);
259 260  
260   - @Insert("INSERT INTO device (" +
261   - "deviceId, " +
262   - "custom_name, " +
263   - "password, " +
264   - "sdpIp, " +
265   - "createTime," +
266   - "updateTime," +
267   - "charset," +
268   - "ssrcCheck," +
269   - "asMessageChannel," +
270   - "geoCoordSys," +
271   - "treeType," +
272   - "online," +
273   - "mediaServerId" +
  261 + @Insert("INSERT INTO wvp_device (" +
  262 + "device_id,"+
  263 + "custom_name,"+
  264 + "password,"+
  265 + "sdp_ip,"+
  266 + "create_time,"+
  267 + "update_time,"+
  268 + "charset,"+
  269 + "ssrc_check,"+
  270 + "as_message_channel,"+
  271 + "geo_coord_sys,"+
  272 + "tree_type,"+
  273 + "on_line,"+
  274 + "media_server_id"+
274 275 ") VALUES (" +
275 276 "#{deviceId}," +
276 277 "#{name}," +
... ... @@ -283,17 +284,14 @@ public interface DeviceMapper {
283 284 "#{asMessageChannel}," +
284 285 "#{geoCoordSys}," +
285 286 "#{treeType}," +
286   - "#{online}," +
  287 + "#{onLine}," +
287 288 "#{mediaServerId}" +
288 289 ")")
289 290 void addCustomDevice(Device device);
290 291  
291   - @Select("select count(1) as total, sum(online) as online from device")
292   - ResourceBaceInfo getOverview();
293   -
294   - @Select("select * from device")
  292 + @Select("select * FROM wvp_device")
295 293 List<Device> getAll();
296 294  
297   - @Select("select * from device where asMessageChannel = 1")
  295 + @Select("select * FROM wvp_device where as_message_channel = true")
298 296 List<Device> queryDeviceWithAsMessageChannel();
299 297 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMobilePositionMapper.java
... ... @@ -11,25 +11,25 @@ import java.util.List;
11 11 @Mapper
12 12 public interface DeviceMobilePositionMapper {
13 13  
14   - @Insert("INSERT INTO device_mobile_position (deviceId,channelId, deviceName, time, longitude, latitude, altitude, speed, direction, reportSource, longitudeGcj02, latitudeGcj02, longitudeWgs84, latitudeWgs84, createTime) " +
  14 + @Insert("INSERT INTO wvp_device_mobile_position (device_id,channel_id, device_name,time,longitude,latitude,altitude,speed,direction,report_source,longitude_gcj02,latitude_gcj02,longitude_wgs84,latitude_wgs84,create_time)"+
15 15 "VALUES (#{deviceId}, #{channelId}, #{deviceName}, #{time}, #{longitude}, #{latitude}, #{altitude}, #{speed}, #{direction}, #{reportSource}, #{longitudeGcj02}, #{latitudeGcj02}, #{longitudeWgs84}, #{latitudeWgs84}, #{createTime})")
16 16 int insertNewPosition(MobilePosition mobilePosition);
17 17  
18 18 @Select(value = {" <script>" +
19   - "SELECT * FROM device_mobile_position" +
20   - " WHERE deviceId = #{deviceId}" +
21   - "<if test=\"channelId != null\"> and channelId = #{channelId}</if>" +
  19 + "SELECT * FROM wvp_device_mobile_position" +
  20 + " WHERE device_id = #{deviceId}" +
  21 + "<if test=\"channelId != null\"> and channel_id = #{channelId}</if>" +
22 22 "<if test=\"startTime != null\"> AND time&gt;=#{startTime}</if>" +
23 23 "<if test=\"endTime != null\"> AND time&lt;=#{endTime}</if>" +
24 24 " ORDER BY time ASC" +
25 25 " </script>"})
26 26 List<MobilePosition> queryPositionByDeviceIdAndTime(String deviceId, String channelId, String startTime, String endTime);
27 27  
28   - @Select("SELECT * FROM device_mobile_position WHERE deviceId = #{deviceId}" +
  28 + @Select("SELECT * FROM wvp_device_mobile_position WHERE device_id = #{deviceId}" +
29 29 " ORDER BY time DESC LIMIT 1")
30 30 MobilePosition queryLatestPositionByDevice(String deviceId);
31 31  
32   - @Delete("DELETE FROM device_mobile_position WHERE deviceId = #{deviceId}")
  32 + @Delete("DELETE FROM wvp_device_mobile_position WHERE device_id = #{deviceId}")
33 33 int clearMobilePositionsByDeviceId(String deviceId);
34 34  
35 35 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
... ... @@ -14,94 +14,94 @@ import java.util.List;
14 14 @Repository
15 15 public interface GbStreamMapper {
16 16  
17   - @Insert("REPLACE INTO gb_stream (app, stream, gbId, name, " +
18   - "longitude, latitude, streamType, mediaServerId, createTime) VALUES" +
  17 + @Insert("REPLACE INTO wvp_gb_stream (app, stream, gb_id, name, " +
  18 + "longitude, latitude, stream_type,media_server_id,create_time) VALUES" +
19 19 "(#{app}, #{stream}, #{gbId}, #{name}, " +
20 20 "#{longitude}, #{latitude}, #{streamType}, " +
21 21 "#{mediaServerId}, #{createTime})")
22 22 @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
23 23 int add(GbStream gbStream);
24 24  
25   - @Update("UPDATE gb_stream " +
  25 + @Update("UPDATE wvp_gb_stream " +
26 26 "SET app=#{app}," +
27 27 "stream=#{stream}," +
28   - "gbId=#{gbId}," +
  28 + "gb_id=#{gbId}," +
29 29 "name=#{name}," +
30   - "streamType=#{streamType}," +
  30 + "stream_type=#{streamType}," +
31 31 "longitude=#{longitude}, " +
32 32 "latitude=#{latitude}," +
33   - "mediaServerId=#{mediaServerId}" +
  33 + "media_server_id=#{mediaServerId}" +
34 34 "WHERE app=#{app} AND stream=#{stream}")
35 35 int updateByAppAndStream(GbStream gbStream);
36 36  
37   - @Update("UPDATE gb_stream " +
  37 + @Update("UPDATE wvp_gb_stream " +
38 38 "SET app=#{app}," +
39 39 "stream=#{stream}," +
40   - "gbId=#{gbId}," +
  40 + "gb_id=#{gbId}," +
41 41 "name=#{name}," +
42   - "streamType=#{streamType}," +
  42 + "stream_type=#{streamType}," +
43 43 "longitude=#{longitude}, " +
44 44 "latitude=#{latitude}," +
45   - "mediaServerId=#{mediaServerId}" +
46   - "WHERE gbStreamId=#{gbStreamId}")
  45 + "media_server_id=#{mediaServerId}" +
  46 + "WHERE gb_stream_id=#{gbStreamId}")
47 47 int update(GbStream gbStream);
48 48  
49   - @Delete("DELETE FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
  49 + @Delete("DELETE FROM wvp_gb_stream WHERE app=#{app} AND stream=#{stream}")
50 50 int del(String app, String stream);
51 51  
52 52 @Select("<script> "+
53   - "SELECT gs.* FROM gb_stream gs " +
  53 + "SELECT gs.* FROM wvp_gb_stream gs " +
54 54 "WHERE " +
55 55 "1=1 " +
56   - " <if test='catalogId != null'> AND gs.gbStreamId in" +
57   - "(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId} and pgs.catalogId=#{catalogId})</if> " +
58   - " <if test='catalogId == null'> AND gs.gbStreamId not in" +
59   - "(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId}) </if> " +
60   - " <if test='query != null'> AND (gs.app LIKE concat('%',#{query},'%') OR gs.stream LIKE concat('%',#{query},'%') OR gs.gbId LIKE concat('%',#{query},'%') OR gs.name LIKE concat('%',#{query},'%'))</if> " +
61   - " <if test='mediaServerId != null' > AND gs.mediaServerId=#{mediaServerId} </if>" +
62   - " order by gs.gbStreamId asc " +
  56 + " <if test='catalogId != null'> AND gs.gb_stream_id in" +
  57 + "(select pgs.gb_stream_id from wvp_platform_gb_stream pgs where pgs.platform_id = #{platformId} and pgs.catalog_id=#{catalogId})</if> " +
  58 + " <if test='catalogId == null'> AND gs.gb_stream_id not in" +
  59 + "(select pgs.gb_stream_id from wvp_platform_gb_stream pgs where pgs.platform_id = #{platformId}) </if> " +
  60 + " <if test='query != null'> AND (gs.app LIKE concat('%',#{query},'%') OR gs.stream LIKE concat('%',#{query},'%') OR gs.gb_id LIKE concat('%',#{query},'%') OR gs.name LIKE concat('%',#{query},'%'))</if> " +
  61 + " <if test='mediaServerId != null' > AND gs.media_server_id=#{mediaServerId} </if>" +
  62 + " order by gs.gb_stream_id asc " +
63 63 "</script>")
64 64 List<GbStream> selectAll(String platformId, String catalogId, String query, String mediaServerId);
65 65  
66   - @Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
  66 + @Select("SELECT * FROM wvp_gb_stream WHERE app=#{app} AND stream=#{stream}")
67 67 GbStream selectOne(String app, String stream);
68 68  
69   - @Select("SELECT * FROM gb_stream WHERE gbId=#{gbId}")
  69 + @Select("SELECT * FROM wvp_gb_stream WHERE gb_id=#{gbId}")
70 70 List<GbStream> selectByGBId(String gbId);
71 71  
72   - @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " +
73   - "LEFT JOIN platform_gb_stream pgs ON gs.gbStreamId = pgs.gbStreamId " +
74   - "WHERE gs.gbId = #{gbId} AND pgs.platformId = #{platformId}")
  72 + @Select("SELECT gs.*, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id FROM wvp_gb_stream gs " +
  73 + "LEFT JOIN wvp_platform_gb_stream pgs ON gs.gb_stream_id = pgs.gb_stream_id " +
  74 + "WHERE gs.gb_id = #{gbId} AND pgs.platform_id = #{platformId}")
75 75 GbStream queryStreamInPlatform(String platformId, String gbId);
76 76  
77 77 @Select("<script> "+
78   - "select gt.gbId as channelId, gt.name, 'wvp-pro' as manufacture, st.status, gt.longitude, gt.latitude, pc.id as parentId," +
79   - " '1' as registerWay, pc.civilCode, 'live' as model, 'wvp-pro' as owner, '0' as parental,'0' as secrecy" +
80   - " from gb_stream gt " +
  78 + "select gt.gb_id as channel_id, gt.name, 'wvp-pro' as manufacture, st.status, gt.longitude, gt.latitude, pc.id as parent_id," +
  79 + " '1' as register_way, pc.civil_code, 'live' as model, 'wvp-pro' as owner, '0' as parental,'0' as secrecy" +
  80 + " from wvp_gb_stream gt " +
81 81 " left join (" +
82 82 " select " +
83 83 " <if test='usPushingAsStatus != true'> sp.status as status, </if>" +
84   - " <if test='usPushingAsStatus == true'> sp.pushIng as status, </if>" +
85   - "sp.app, sp.stream from stream_push sp" +
  84 + " <if test='usPushingAsStatus == true'> sp.push_ing as status, </if>" +
  85 + "sp.app, sp.stream from wvp_stream_push sp" +
86 86 " union all" +
87   - " select spxy.status, spxy.app, spxy.stream from stream_proxy spxy" +
  87 + " select spxy.status, spxy.app, spxy.stream from wvp_stream_proxy spxy" +
88 88 " ) st on st.app = gt.app and st.stream = gt.stream" +
89   - " left join platform_gb_stream pgs on gt.gbStreamId = pgs.gbStreamId" +
90   - " left join platform_catalog pc on pgs.catalogId = pc.id and pgs.platformId = pc.platformId" +
91   - " where pgs.platformId=#{platformId}" +
  89 + " left join wvp_platform_gb_stream pgs on gt.gb_stream_id = pgs.gb_stream_id" +
  90 + " left join wvp_platform_catalog pc on pgs.catalog_id = pc.id and pgs.platform_id = pc.platform_id" +
  91 + " where pgs.platform_id=#{platformId}" +
92 92 "</script>")
93 93 List<DeviceChannel> queryGbStreamListInPlatform(String platformId, boolean usPushingAsStatus);
94 94  
95 95  
96   - @Select("SELECT gs.* FROM gb_stream gs LEFT JOIN platform_gb_stream pgs " +
97   - "ON gs.gbStreamId = pgs.gbStreamId WHERE pgs.gbStreamId is NULL")
  96 + @Select("SELECT gs.* FROM wvp_gb_stream gs left join wvp_platform_gb_stream pgs " +
  97 + "ON gs.gb_stream_id = pgs.gb_stream_id WHERE pgs.gb_stream_id is NULL")
98 98 List<GbStream> queryStreamNotInPlatform();
99 99  
100   - @Delete("DELETE FROM gb_stream WHERE streamType=#{type} AND gbId=NULL AND mediaServerId=#{mediaServerId}")
  100 + @Delete("DELETE FROM wvp_gb_stream WHERE stream_type=#{type} AND gb_id=NULL AND media_server_id=#{mediaServerId}")
101 101 void deleteWithoutGBId(String type, String mediaServerId);
102 102  
103 103 @Delete("<script> "+
104   - "DELETE FROM gb_stream where " +
  104 + "DELETE FROM wvp_gb_stream where " +
105 105 "<foreach collection='streamProxyItemList' item='item' separator='or'>" +
106 106 "(app=#{item.app} and stream=#{item.stream}) " +
107 107 "</foreach>" +
... ... @@ -109,7 +109,7 @@ public interface GbStreamMapper {
109 109 void batchDel(List<StreamProxyItem> streamProxyItemList);
110 110  
111 111 @Delete("<script> "+
112   - "DELETE FROM gb_stream where " +
  112 + "DELETE FROM wvp_gb_stream where " +
113 113 "<foreach collection='gbStreams' item='item' separator='or'>" +
114 114 "(app=#{item.app} and stream=#{item.stream}) " +
115 115 "</foreach>" +
... ... @@ -117,9 +117,9 @@ public interface GbStreamMapper {
117 117 void batchDelForGbStream(List<GbStream> gbStreams);
118 118  
119 119 @Insert("<script> " +
120   - "INSERT IGNORE into gb_stream " +
121   - "(app, stream, gbId, name, " +
122   - "longitude, latitude, streamType, mediaServerId, createTime)" +
  120 + "INSERT into wvp_gb_stream " +
  121 + "(app, stream, gb_id, name, " +
  122 + "longitude, latitude, stream_type,media_server_id,create_time)" +
123 123 "values " +
124 124 "<foreach collection='subList' index='index' item='item' separator=','> " +
125 125 "(#{item.app}, #{item.stream}, #{item.gbId}, #{item.name}, " +
... ... @@ -127,46 +127,46 @@ public interface GbStreamMapper {
127 127 "#{item.mediaServerId}, #{item.createTime}) "+
128 128 "</foreach> " +
129 129 "</script>")
130   - @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
  130 + @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gb_stream_id")
131 131 void batchAdd(List<StreamPushItem> subList);
132 132  
133 133 @Update({"<script>" +
134 134 "<foreach collection='gpsMsgInfos' item='item' separator=';'>" +
135 135 " UPDATE" +
136   - " gb_stream" +
  136 + " wvp_gb_stream" +
137 137 " SET longitude=#{item.lng}, latitude=#{item.lat} " +
138   - "WHERE gbId=#{item.id}"+
  138 + "WHERE gb_id=#{item.id}"+
139 139 "</foreach>" +
140 140 "</script>"})
141 141 int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfos);
142 142  
143 143 @Select("<script> "+
144   - "SELECT * FROM gb_stream where " +
  144 + "SELECT * FROM wvp_gb_stream where " +
145 145 "<foreach collection='streamPushItems' item='item' separator='or'>" +
146 146 "(app=#{item.app} and stream=#{item.stream}) " +
147 147 "</foreach>" +
148 148 "</script>")
149 149 List<GbStream> selectAllForAppAndStream(List<StreamPushItem> streamPushItems);
150 150  
151   - @Update("UPDATE gb_stream " +
152   - "SET mediaServerId=#{mediaServerId}" +
  151 + @Update("UPDATE wvp_gb_stream " +
  152 + "SET media_server_id=#{mediaServerId}" +
153 153 "WHERE app=#{app} AND stream=#{stream}")
154 154 void updateMediaServer(String app, String stream, String mediaServerId);
155 155  
156 156 @Update("<script> "+
157 157 " <foreach collection='list' item='item' index='index' separator=';'>"+
158   - "UPDATE gb_stream " +
  158 + "UPDATE wvp_gb_stream " +
159 159 " SET name=#{item.name},"+
160   - " gbId=#{item.gbId}"+
  160 + " gb_id=#{item.gb_id}"+
161 161 " WHERE app=#{item.app} and stream=#{item.stream}"+
162 162 "</foreach>"+
163 163 "</script>")
164 164 int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate);
165 165  
166   - @Select("SELECT status FROM stream_proxy WHERE app=#{app} AND stream=#{stream}")
  166 + @Select("SELECT status FROM wvp_stream_proxy WHERE app=#{app} AND stream=#{stream}")
167 167 Boolean selectStatusForProxy(String app, String stream);
168 168  
169   - @Select("SELECT status FROM stream_push WHERE app=#{app} AND stream=#{stream}")
  169 + @Select("SELECT status FROM wvp_stream_push WHERE app=#{app} AND stream=#{stream}")
170 170 Boolean selectStatusForPush(String app, String stream);
171 171  
172 172 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java
1 1 package com.genersoft.iot.vmp.storager.dao;
2 2  
3   -import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
4 3 import com.genersoft.iot.vmp.storager.dao.dto.LogDto;
5 4 import org.apache.ibatis.annotations.Delete;
6 5 import org.apache.ibatis.annotations.Insert;
... ... @@ -17,21 +16,21 @@ import java.util.List;
17 16 @Repository
18 17 public interface LogMapper {
19 18  
20   - @Insert("insert into log ( name, type, uri, address, result, timing, username, createTime) " +
  19 + @Insert("insert into wvp_log ( name,type,uri,address,result,timing,username,create_time) " +
21 20 "values (#{name}, #{type}, #{uri}, #{address}, #{result}, #{timing}, #{username}, #{createTime})")
22 21 int add(LogDto logDto);
23 22  
24 23 @Select(value = {"<script>" +
25   - " SELECT * FROM log " +
  24 + " SELECT * FROM wvp_log " +
26 25 " WHERE 1=1 " +
27 26 " <if test=\"query != null\"> AND (name LIKE concat('%',#{query},'%'))</if> " +
28 27 " <if test=\"type != null\" > AND type = #{type}</if>" +
29   - " <if test=\"startTime != null\" > AND createTime &gt;= #{startTime} </if>" +
30   - " <if test=\"endTime != null\" > AND createTime &lt;= #{endTime} </if>" +
31   - " ORDER BY createTime DESC " +
  28 + " <if test=\"startTime != null\" > AND create_time &gt;= #{startTime} </if>" +
  29 + " <if test=\"endTime != null\" > AND create_time &lt;= #{endTime} </if>" +
  30 + " ORDER BY create_time DESC " +
32 31 " </script>"})
33 32 List<LogDto> query(String query, String type, String startTime, String endTime);
34 33  
35   - @Delete("DELETE FROM log")
  34 + @Delete("DELETE FROM wvp_log")
36 35 int clear();
37 36 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java
... ... @@ -11,28 +11,28 @@ import java.util.List;
11 11 @Repository
12 12 public interface MediaServerMapper {
13 13  
14   - @Insert("INSERT INTO media_server (" +
15   - "id, " +
16   - "ip, " +
17   - "hookIp, " +
18   - "sdpIp, " +
19   - "streamIp, " +
20   - "httpPort, " +
21   - "httpSSlPort, " +
22   - "rtmpPort, " +
23   - "rtmpSSlPort, " +
24   - "rtpProxyPort, " +
25   - "rtspPort, " +
26   - "rtspSSLPort, " +
27   - "autoConfig, " +
28   - "secret, " +
29   - "rtpEnable, " +
30   - "rtpPortRange, " +
31   - "recordAssistPort, " +
32   - "defaultServer, " +
33   - "createTime, " +
34   - "updateTime, " +
35   - "hookAliveInterval" +
  14 + @Insert("INSERT INTO wvp_media_server (" +
  15 + "id,"+
  16 + "ip,"+
  17 + "hook_ip,"+
  18 + "sdp_ip,"+
  19 + "stream_ip,"+
  20 + "http_port,"+
  21 + "http_ssl_port,"+
  22 + "rtmp_port,"+
  23 + "rtmp_ssl_port,"+
  24 + "rtp_proxy_port,"+
  25 + "rtsp_port,"+
  26 + "rtsp_ssl_port,"+
  27 + "auto_config,"+
  28 + "secret,"+
  29 + "rtp_enable,"+
  30 + "rtp_port_range,"+
  31 + "record_assist_port,"+
  32 + "default_server,"+
  33 + "create_time,"+
  34 + "update_time,"+
  35 + "hook_alive_interval"+
36 36 ") VALUES " +
37 37 "(" +
38 38 "#{id}, " +
... ... @@ -59,70 +59,70 @@ public interface MediaServerMapper {
59 59 int add(MediaServerItem mediaServerItem);
60 60  
61 61 @Update(value = {" <script>" +
62   - "UPDATE media_server " +
63   - "SET updateTime=#{updateTime}" +
  62 + "UPDATE wvp_media_server " +
  63 + "SET update_time=#{updateTime}" +
64 64 "<if test=\"ip != null\">, ip=#{ip}</if>" +
65   - "<if test=\"hookIp != null\">, hookIp=#{hookIp}</if>" +
66   - "<if test=\"sdpIp != null\">, sdpIp=#{sdpIp}</if>" +
67   - "<if test=\"streamIp != null\">, streamIp=#{streamIp}</if>" +
68   - "<if test=\"httpPort != null\">, httpPort=#{httpPort}</if>" +
69   - "<if test=\"httpSSlPort != null\">, httpSSlPort=#{httpSSlPort}</if>" +
70   - "<if test=\"rtmpPort != null\">, rtmpPort=#{rtmpPort}</if>" +
71   - "<if test=\"rtmpSSlPort != null\">, rtmpSSlPort=#{rtmpSSlPort}</if>" +
72   - "<if test=\"rtpProxyPort != null\">, rtpProxyPort=#{rtpProxyPort}</if>" +
73   - "<if test=\"rtspPort != null\">, rtspPort=#{rtspPort}</if>" +
74   - "<if test=\"rtspSSLPort != null\">, rtspSSLPort=#{rtspSSLPort}</if>" +
75   - "<if test=\"autoConfig != null\">, autoConfig=#{autoConfig}</if>" +
76   - "<if test=\"rtpEnable != null\">, rtpEnable=#{rtpEnable}</if>" +
77   - "<if test=\"rtpPortRange != null\">, rtpPortRange=#{rtpPortRange}</if>" +
  65 + "<if test=\"hookIp != null\">, hook_ip=#{hookIp}</if>" +
  66 + "<if test=\"sdpIp != null\">, sdp_ip=#{sdpIp}</if>" +
  67 + "<if test=\"streamIp != null\">, stream_ip=#{streamIp}</if>" +
  68 + "<if test=\"httpPort != null\">, http_port=#{httpPort}</if>" +
  69 + "<if test=\"httpSSlPort != null\">, http_ssl_port=#{httpSSlPort}</if>" +
  70 + "<if test=\"rtmpPort != null\">, rtmp_port=#{rtmpPort}</if>" +
  71 + "<if test=\"rtmpSSlPort != null\">, rtmp_ssl_port=#{rtmpSSlPort}</if>" +
  72 + "<if test=\"rtpProxyPort != null\">, rtp_proxy_port=#{rtpProxyPort}</if>" +
  73 + "<if test=\"rtspPort != null\">, rtsp_port=#{rtspPort}</if>" +
  74 + "<if test=\"rtspSSLPort != null\">, rtsp_ssl_port=#{rtspSSLPort}</if>" +
  75 + "<if test=\"autoConfig != null\">, auto_config=#{autoConfig}</if>" +
  76 + "<if test=\"rtpEnable != null\">, rtp_enable=#{rtpEnable}</if>" +
  77 + "<if test=\"rtpPortRange != null\">, rtp_port_range=#{rtpPortRange}</if>" +
78 78 "<if test=\"secret != null\">, secret=#{secret}</if>" +
79   - "<if test=\"recordAssistPort != null\">, recordAssistPort=#{recordAssistPort}</if>" +
80   - "<if test=\"hookAliveInterval != null\">, hookAliveInterval=#{hookAliveInterval}</if>" +
  79 + "<if test=\"recordAssistPort != null\">, record_assist_port=#{recordAssistPort}</if>" +
  80 + "<if test=\"hookAliveInterval != null\">, hook_alive_interval=#{hookAliveInterval}</if>" +
81 81 "WHERE id=#{id}"+
82 82 " </script>"})
83 83 int update(MediaServerItem mediaServerItem);
84 84  
85 85 @Update(value = {" <script>" +
86   - "UPDATE media_server " +
87   - "SET updateTime=#{updateTime}" +
  86 + "UPDATE wvp_media_server " +
  87 + "SET update_time=#{updateTime}" +
88 88 "<if test=\"id != null\">, id=#{id}</if>" +
89   - "<if test=\"hookIp != null\">, hookIp=#{hookIp}</if>" +
90   - "<if test=\"sdpIp != null\">, sdpIp=#{sdpIp}</if>" +
91   - "<if test=\"streamIp != null\">, streamIp=#{streamIp}</if>" +
92   - "<if test=\"httpSSlPort != null\">, httpSSlPort=#{httpSSlPort}</if>" +
93   - "<if test=\"rtmpPort != null\">, rtmpPort=#{rtmpPort}</if>" +
94   - "<if test=\"rtmpSSlPort != null\">, rtmpSSlPort=#{rtmpSSlPort}</if>" +
95   - "<if test=\"rtpProxyPort != null\">, rtpProxyPort=#{rtpProxyPort}</if>" +
96   - "<if test=\"rtspPort != null\">, rtspPort=#{rtspPort}</if>" +
97   - "<if test=\"rtspSSLPort != null\">, rtspSSLPort=#{rtspSSLPort}</if>" +
98   - "<if test=\"autoConfig != null\">, autoConfig=#{autoConfig}</if>" +
99   - "<if test=\"rtpEnable != null\">, rtpEnable=#{rtpEnable}</if>" +
100   - "<if test=\"rtpPortRange != null\">, rtpPortRange=#{rtpPortRange}</if>" +
  89 + "<if test=\"hookIp != null\">, hook_ip=#{hookIp}</if>" +
  90 + "<if test=\"sdpIp != null\">, sdp_ip=#{sdpIp}</if>" +
  91 + "<if test=\"streamIp != null\">, stream_ip=#{streamIp}</if>" +
  92 + "<if test=\"httpSSlPort != null\">, http_ssl_port=#{httpSSlPort}</if>" +
  93 + "<if test=\"rtmpPort != null\">, rtmp_port=#{rtmpPort}</if>" +
  94 + "<if test=\"rtmpSSlPort != null\">, rtmp_ssl_port=#{rtmpSSlPort}</if>" +
  95 + "<if test=\"rtpProxyPort != null\">, rtp_proxy_port=#{rtpProxyPort}</if>" +
  96 + "<if test=\"rtspPort != null\">, rtsp_port=#{rtspPort}</if>" +
  97 + "<if test=\"rtspSSLPort != null\">, rtsp_ssl_port=#{rtspSSLPort}</if>" +
  98 + "<if test=\"autoConfig != null\">, auto_config=#{autoConfig}</if>" +
  99 + "<if test=\"rtpEnable != null\">, rtp_enable=#{rtpEnable}</if>" +
  100 + "<if test=\"rtpPortRange != null\">, rtp_port_range=#{rtpPortRange}</if>" +
101 101 "<if test=\"secret != null\">, secret=#{secret}</if>" +
102   - "<if test=\"recordAssistPort != null\">, recordAssistPort=#{recordAssistPort}</if>" +
103   - "<if test=\"hookAliveInterval != null\">, hookAliveInterval=#{hookAliveInterval}</if>" +
104   - "WHERE ip=#{ip} and httpPort=#{httpPort}"+
  102 + "<if test=\"recordAssistPort != null\">, record_assist_port=#{recordAssistPort}</if>" +
  103 + "<if test=\"hookAliveInterval != null\">, hook_alive_interval=#{hookAliveInterval}</if>" +
  104 + "WHERE ip=#{ip} and http_port=#{httpPort}"+
105 105 " </script>"})
106 106 int updateByHostAndPort(MediaServerItem mediaServerItem);
107 107  
108   - @Select("SELECT * FROM media_server WHERE id=#{id}")
  108 + @Select("SELECT * FROM wvp_media_server WHERE id=#{id}")
109 109 MediaServerItem queryOne(String id);
110 110  
111   - @Select("SELECT * FROM media_server")
  111 + @Select("SELECT * FROM wvp_media_server")
112 112 List<MediaServerItem> queryAll();
113 113  
114   - @Delete("DELETE FROM media_server WHERE id=#{id}")
  114 + @Delete("DELETE FROM wvp_media_server WHERE id=#{id}")
115 115 void delOne(String id);
116 116  
117   - @Select("DELETE FROM media_server WHERE ip=#{host} and httpPort=#{port}")
  117 + @Select("DELETE FROM wvp_media_server WHERE ip=#{host} and http_port=#{port}")
118 118 void delOneByIPAndPort(String host, int port);
119 119  
120   - @Delete("DELETE FROM media_server WHERE defaultServer=1")
  120 + @Delete("DELETE FROM wvp_media_server WHERE default_server=true")
121 121 int delDefault();
122 122  
123   - @Select("SELECT * FROM media_server WHERE ip=#{host} and httpPort=#{port}")
  123 + @Select("SELECT * FROM wvp_media_server WHERE ip=#{host} and http_port=#{port}")
124 124 MediaServerItem queryOneByHostAndPort(String host, int port);
125 125  
126   - @Select("SELECT * FROM media_server WHERE defaultServer=1")
  126 + @Select("SELECT * FROM wvp_media_server WHERE default_server=true")
127 127 MediaServerItem queryDefault();
128 128 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
... ... @@ -14,88 +14,88 @@ import java.util.List;
14 14 @Repository
15 15 public interface ParentPlatformMapper {
16 16  
17   - @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " +
18   - " devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, asMessageChannel, " +
19   - " status, startOfflinePush, catalogId, administrativeDivision, catalogGroup, createTime, updateTime, treeType) " +
  17 + @Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+
  18 + "device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,as_message_channel,"+
  19 + "status,start_offline_push,catalog_id,administrative_division,catalog_group,create_time,update_time,tree_type) " +
20 20 " VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIP}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " +
21 21 " #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{asMessageChannel}, " +
22 22 " #{status}, #{startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{treeType})")
23 23 int addParentPlatform(ParentPlatform parentPlatform);
24 24  
25   - @Update("UPDATE parent_platform " +
  25 + @Update("UPDATE wvp_platform " +
26 26 "SET enable=#{enable}, " +
27 27 "name=#{name}," +
28   - "deviceGBId=#{deviceGBId}," +
29   - "serverGBId=#{serverGBId}, " +
30   - "serverGBDomain=#{serverGBDomain}, " +
31   - "serverIP=#{serverIP}," +
32   - "serverPort=#{serverPort}, " +
33   - "deviceIp=#{deviceIp}, " +
34   - "devicePort=#{devicePort}, " +
  28 + "device_gb_id=#{deviceGBId}," +
  29 + "server_gb_id=#{serverGBId}, " +
  30 + "server_gb_domain=#{serverGBDomain}, " +
  31 + "server_ip=#{serverIP}," +
  32 + "server_port=#{serverPort}, " +
  33 + "device_ip=#{deviceIp}, " +
  34 + "device_port=#{devicePort}, " +
35 35 "username=#{username}, " +
36 36 "password=#{password}, " +
37 37 "expires=#{expires}, " +
38   - "keepTimeout=#{keepTimeout}, " +
  38 + "keep_timeout=#{keepTimeout}, " +
39 39 "transport=#{transport}, " +
40   - "characterSet=#{characterSet}, " +
  40 + "character_set=#{characterSet}, " +
41 41 "ptz=#{ptz}, " +
42 42 "rtcp=#{rtcp}, " +
43   - "asMessageChannel=#{asMessageChannel}, " +
  43 + "as_message_channel=#{asMessageChannel}, " +
44 44 "status=#{status}, " +
45   - "startOfflinePush=#{startOfflinePush}, " +
46   - "catalogGroup=#{catalogGroup}, " +
47   - "administrativeDivision=#{administrativeDivision}, " +
48   - "createTime=#{createTime}, " +
49   - "updateTime=#{updateTime}, " +
50   - "treeType=#{treeType}, " +
51   - "catalogId=#{catalogId} " +
  45 + "start_offline_push=#{startOfflinePush}, " +
  46 + "catalog_group=#{catalogGroup}, " +
  47 + "administrative_division=#{administrativeDivision}, " +
  48 + "create_time=#{createTime}, " +
  49 + "update_time=#{updateTime}, " +
  50 + "tree_type=#{treeType}, " +
  51 + "catalog_id=#{catalogId} " +
52 52 "WHERE id=#{id}")
53 53 int updateParentPlatform(ParentPlatform parentPlatform);
54 54  
55   - @Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}")
  55 + @Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
56 56 int delParentPlatform(ParentPlatform parentPlatform);
57 57  
58 58 @Select("SELECT *, ((SELECT count(0)\n" +
59   - " FROM platform_gb_channel pc\n" +
60   - " WHERE pc.platformId = pp.serverGBId)\n" +
  59 + " FROM wvp_platform_gb_channel pc\n" +
  60 + " WHERE pc.platform_id = pp.server_gb_id)\n" +
61 61 " +\n" +
62 62 " (SELECT count(0)\n" +
63   - " FROM platform_gb_stream pgs\n" +
64   - " WHERE pgs.platformId = pp.serverGBId)\n" +
  63 + " FROM wvp_platform_gb_stream pgs\n" +
  64 + " WHERE pgs.platform_id = pp.server_gb_id)\n" +
65 65 " +\n" +
66 66 " (SELECT count(0)\n" +
67   - " FROM platform_catalog pgc\n" +
68   - " WHERE pgc.platformId = pp.serverGBId)) as channelCount\n" +
69   - "FROM parent_platform pp ")
  67 + " FROM wvp_platform_catalog pgc\n" +
  68 + " WHERE pgc.platform_id = pp.server_gb_id)) as channel_count\n" +
  69 + "FROM wvp_platform pp ")
70 70 List<ParentPlatform> getParentPlatformList();
71 71  
72   - @Select("SELECT * FROM parent_platform WHERE enable=#{enable} ")
  72 + @Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
73 73 List<ParentPlatform> getEnableParentPlatformList(boolean enable);
74 74  
75   - @Select("SELECT * FROM parent_platform WHERE enable=1 and asMessageChannel = 1")
  75 + @Select("SELECT * FROM wvp_platform WHERE enable=true and as_message_channel=true")
76 76 List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel();
77 77  
78   - @Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}")
  78 + @Select("SELECT * FROM wvp_platform WHERE server_gb_id=#{platformGbId}")
79 79 ParentPlatform getParentPlatByServerGBId(String platformGbId);
80 80  
81   - @Select("SELECT * FROM parent_platform WHERE id=#{id}")
  81 + @Select("SELECT * FROM wvp_platform WHERE id=#{id}")
82 82 ParentPlatform getParentPlatById(int id);
83 83  
84   - @Update("UPDATE parent_platform SET status=false" )
  84 + @Update("UPDATE wvp_platform SET status=false" )
85 85 int outlineForAllParentPlatform();
86 86  
87   - @Update("UPDATE parent_platform SET status=#{online} WHERE serverGBId=#{platformGbID}" )
  87 + @Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" )
88 88 int updateParentPlatformStatus(String platformGbID, boolean online);
89 89  
90 90 @Update(value = {" <script>" +
91   - "UPDATE parent_platform " +
92   - "SET catalogId=#{catalogId}, updateTime=#{updateTime}" +
93   - "WHERE serverGBId=#{platformId}"+
  91 + "UPDATE wvp_platform " +
  92 + "SET catalog_id=#{catalogId}, update_time=#{updateTime}" +
  93 + "WHERE server_gb_id=#{platformId}"+
94 94 "</script>"})
95 95 int setDefaultCatalog(String platformId, String catalogId, String updateTime);
96 96  
97   - @Select("select 'channel' as name, count(pgc.platformId) count from platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId where pgc.platformId=#{platformId} and dc.channelId =#{gbId} " +
  97 + @Select("select 'channel' as name, count(pgc.platform_id) count from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id where pgc.platform_id=#{platform_id} and dc.channel_id =#{gbId} " +
98 98 "union " +
99   - "select 'stream' as name, count(pgs.platformId) count from platform_gb_stream pgs left join gb_stream gs on pgs.gbStreamId = gs.gbStreamId where pgs.platformId=#{platformId} and gs.gbId = #{gbId}")
100   - List<ChannelSourceInfo> getChannelSource(String platformId, String gbId);
  99 + "select 'stream' as name, count(pgs.platform_id) count from wvp_platform_gb_stream pgs left join wvp_gb_stream gs on pgs.gb_stream_id = gs.gb_stream_id where pgs.platform_id=#{platform_id} and gs.gb_id #{gbId}")
  100 + List<ChannelSourceInfo> getChannelSource(String platform_id, String gbId);
101 101 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java
1 1 package com.genersoft.iot.vmp.storager.dao;
2 2  
3 3 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
4   -import com.genersoft.iot.vmp.gb28181.bean.GbStream;
5 4 import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
6   -import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
7   -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
8 5 import org.apache.ibatis.annotations.*;
9 6 import org.springframework.stereotype.Repository;
10 7  
... ... @@ -15,22 +12,23 @@ import java.util.List;
15 12 @Repository
16 13 public interface PlatformCatalogMapper {
17 14  
18   - @Insert("INSERT INTO platform_catalog (id, name, platformId, parentId, civilCode, businessGroupId) VALUES" +
  15 + @Insert("INSERT INTO platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" +
19 16 "(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
20 17 int add(PlatformCatalog platformCatalog);
21 18  
22   - @Delete("DELETE FROM platform_catalog WHERE id=#{id}")
  19 + @Delete("DELETE from wvp_platform_catalog WHERE id=#{id}")
23 20 int del(String id);
24 21  
25   - @Delete("DELETE FROM platform_catalog WHERE platformId=#{platformId}")
  22 + @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
26 23 int delByPlatformId(String platformId);
27 24  
28   - @Select("SELECT pc.*, count(pc2.id) as childrenCount FROM platform_catalog pc " +
29   - "left join platform_catalog pc2 on pc.id = pc2.parentId " +
30   - "WHERE pc.parentId=#{parentId} AND pc.platformId=#{platformId} group by pc.id")
  25 + @Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " +
  26 + "left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " +
  27 + "WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " +
  28 + "group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id")
31 29 List<PlatformCatalog> selectByParentId(String platformId, String parentId);
32 30  
33   - @Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id) as childrenCount FROM platform_catalog pc WHERE pc.id=#{id}")
  31 + @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.id=#{id}")
34 32 PlatformCatalog select(String id);
35 33  
36 34 @Update(value = {" <script>" +
... ... @@ -40,17 +38,17 @@ public interface PlatformCatalogMapper {
40 38 "</script>"})
41 39 int update(PlatformCatalog platformCatalog);
42 40  
43   - @Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id) as childrenCount FROM platform_catalog pc WHERE pc.platformId=#{platformId}")
  41 + @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
44 42 List<PlatformCatalog> selectByPlatForm(String platformId);
45 43  
46   - @Select("SELECT pc.* FROM platform_catalog pc WHERE pc.id = (SELECT pp.catalogId from parent_platform pp WHERE pp.serverGBId=#{platformId})")
  44 + @Select("SELECT pc.* FROM platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})")
47 45 PlatformCatalog selectDefaultByPlatFormId(String platformId);
48 46  
49 47  
50 48 @Select("SELECT pc.* FROM platform_catalog pc WHERE pc.id = #{id}")
51 49 PlatformCatalog selectParentCatalog(String id);
52 50  
53   - @Select("SELECT pc.id as channelId, pc.name, pc.civilCode, pc.businessGroupId,'1' as parental, pc.parentId " +
54   - " FROM platform_catalog pc WHERE pc.platformId=#{platformId}")
  51 + @Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " +
  52 + " from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
55 53 List<DeviceChannel> queryCatalogInPlatform(String platformId);
56 54 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
... ... @@ -21,13 +21,13 @@ public interface PlatformChannelMapper {
21 21 * 查询列表里已经关联的
22 22 */
23 23 @Select("<script> "+
24   - "SELECT deviceChannelId FROM platform_gb_channel WHERE platformId=#{platformId} AND deviceChannelId in" +
  24 + "SELECT device_channel_id from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
25 25 "<foreach collection='channelReduces' open='(' item='item' separator=',' close=')'> #{item.id}</foreach>" +
26 26 "</script>")
27 27 List<Integer> findChannelRelatedPlatform(String platformId, List<ChannelReduce> channelReduces);
28 28  
29 29 @Insert("<script> "+
30   - "INSERT INTO platform_gb_channel (platformId, deviceChannelId, catalogId) VALUES" +
  30 + "INSERT INTO wvp_platform_gb_channel (platform_id, device_channel_id, catalog_id) VALUES" +
31 31 "<foreach collection='channelReducesToAdd' item='item' separator=','>" +
32 32 " (#{platformId}, #{item.id} , #{item.catalogId} )" +
33 33 "</foreach>" +
... ... @@ -35,50 +35,50 @@ public interface PlatformChannelMapper {
35 35 int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd);
36 36  
37 37 @Delete("<script> "+
38   - "DELETE FROM platform_gb_channel WHERE platformId=#{platformId} AND deviceChannelId in" +
  38 + "DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
39 39 "<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
40 40 "</script>")
41 41 int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel);
42 42  
43 43 @Delete("<script> "+
44   - "DELETE FROM platform_gb_channel WHERE deviceChannelId in " +
45   - "( select temp.deviceChannelId from " +
46   - "(select pgc.deviceChannelId from platform_gb_channel pgc " +
47   - "left join device_channel dc on dc.id = pgc.deviceChannelId where dc.deviceId =#{deviceId} " +
  44 + "DELETE from wvp_platform_gb_channel WHERE device_channel_id in " +
  45 + "( select temp.device_channel_id from " +
  46 + "(select pgc.device_channel_id from wvp_platform_gb_channel pgc " +
  47 + "left join wvp_device_channel dc on dc.id = pgc.device_channel_id where dc.device_id =#{deviceId} " +
48 48 ") temp)" +
49 49 "</script>")
50 50 int delChannelForDeviceId(String deviceId);
51 51  
52 52 @Delete("<script> "+
53   - "DELETE FROM platform_gb_channel WHERE platformId=#{platformId}" +
  53 + "DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId}" +
54 54 "</script>")
55 55 int cleanChannelForGB(String platformId);
56 56  
57   - @Select("SELECT dc.* FROM platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId WHERE dc.channelId=#{channelId} and pgc.platformId=#{platformId}")
  57 + @Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
58 58 List<DeviceChannel> queryChannelInParentPlatform(String platformId, String channelId);
59 59  
60   - @Select("SELECT dc.* FROM platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId WHERE pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}")
  60 + @Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
61 61 List<DeviceChannel> queryAllChannelInCatalog(String platformId, String catalogId);
62 62  
63   - @Select(" select dc.channelId as id, dc.name as name, pgc.platformId as platformId, pgc.catalogId as parentId, 0 as childrenCount, 1 as type " +
64   - " from device_channel dc left join platform_gb_channel pgc on dc.id = pgc.deviceChannelId " +
65   - " where pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}")
  63 + @Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " +
  64 + " from wvp_device_channel dc left join wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id " +
  65 + " where pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
66 66 List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
67 67  
68 68 @Select("select d.*\n" +
69   - "from platform_gb_channel pgc\n" +
70   - " left join device_channel dc on dc.id = pgc.deviceChannelId\n" +
71   - " left join device d on dc.deviceId = d.deviceId\n" +
72   - "where dc.channelId = #{channelId} and pgc.platformId=#{platformId}")
  69 + "from wvp_platform_gb_channel pgc\n" +
  70 + " left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
  71 + " left join wvp_device d on dc.device_id = d.device_id\n" +
  72 + "where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
73 73 List<Device> queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
74 74  
75 75 @Delete("<script> "+
76   - "DELETE FROM platform_gb_channel WHERE catalogId=#{id}" +
  76 + "DELETE from wvp_platform_gb_channel WHERE catalog_id=#{id}" +
77 77 "</script>")
78 78 int delByCatalogId(String id);
79 79  
80 80 @Delete("<script> "+
81   - "DELETE FROM platform_gb_channel WHERE catalogId=#{parentId} AND platformId=#{platformId} AND channelId=#{id}" +
  81 + "DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
82 82 "</script>")
83 83 int delByCatalogIdAndChannelIdAndPlatformId(PlatformCatalog platformCatalog);
84 84  
... ... @@ -86,35 +86,35 @@ public interface PlatformChannelMapper {
86 86 "SELECT " +
87 87 "pp.* " +
88 88 "FROM " +
89   - "parent_platform pp " +
90   - "left join platform_gb_channel pgc on " +
91   - "pp.serverGBId = pgc.platformId " +
92   - "left join device_channel dc on " +
93   - "dc.id = pgc.deviceChannelId " +
  89 + "wvp_platform pp " +
  90 + "left join wvp_platform_gb_channel pgc on " +
  91 + "pp.server_gb_id = pgc.platform_id " +
  92 + "left join wvp_device_channel dc on " +
  93 + "dc.id = pgc.device_channel_id " +
94 94 "WHERE " +
95   - "dc.channelId = #{channelId} and pp.status = true " +
96   - "AND pp.serverGBId IN" +
97   - "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
  95 + "dc.channel_id = #{channelId} and pp.status = true " +
  96 + "AND pp.server_gb_id IN" +
  97 + "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
98 98 "</script> ")
99 99 List<ParentPlatform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms);
100 100  
101 101 @Delete("<script> " +
102   - "DELETE FROM platform_gb_channel WHERE platformId=#{serverGBId}" +
  102 + "DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" +
103 103 "</script>")
104 104 void delByPlatformId(String serverGBId);
105 105  
106 106 @Delete("<script> " +
107   - "DELETE FROM platform_gb_channel WHERE platformId=#{platformId} and catalogId=#{catalogId}" +
  107 + "DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{catalogId}" +
108 108 "</script>")
109 109 int delChannelForGBByCatalogId(String platformId, String catalogId);
110 110  
111   - @Select("select dc.channelId deviceId,dc.name,d.manufacturer,d.model,d.firmware\n" +
112   - "from platform_gb_channel pgc\n" +
113   - " left join device_channel dc on dc.id = pgc.deviceChannelId\n" +
114   - " left join device d on dc.deviceId = d.deviceId\n" +
115   - "where dc.channelId = #{channelId} and pgc.platformId=#{platformId}")
  111 + @Select("select dc.channel_id dc.device_id,dc.name,d.manufacturer,d.model,d.firmware\n" +
  112 + "from wvp_platform_gb_channel pgc\n" +
  113 + " left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
  114 + " left join wvp_device d on dc.device_id = d.device_id\n" +
  115 + "where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
116 116 List<Device> queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId);
117 117  
118   - @Select("SELECT pgc.platformId FROM platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId WHERE dc.channelId='${channelId}'")
  118 + @Select("SELECT pgc.platform_id from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id='${channelId}'")
119 119 List<String> queryParentPlatformByChannelId(String channelId);
120 120 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
... ... @@ -16,82 +16,82 @@ import java.util.List;
16 16 @Repository
17 17 public interface PlatformGbStreamMapper {
18 18  
19   - @Insert("REPLACE INTO platform_gb_stream (gbStreamId, platformId, catalogId) VALUES" +
  19 + @Insert("REPLACE INTO wvp_platform_gb_stream (gb_stream_id, platform_id, catalog_id) VALUES" +
20 20 "( #{gbStreamId}, #{platformId}, #{catalogId})")
21 21 int add(PlatformGbStream platformGbStream);
22 22  
23 23  
24 24 @Insert("<script> " +
25   - "INSERT into platform_gb_stream " +
26   - "(gbStreamId, platformId, catalogId) " +
  25 + "INSERT into wvp_platform_gb_stream " +
  26 + "(gb_stream_id, platform_id, catalog_id) " +
27 27 "values " +
28 28 "<foreach collection='streamPushItems' index='index' item='item' separator=','> " +
29   - "(#{item.gbStreamId}, #{item.platformId}, #{item.catalogId})" +
  29 + "(#{item.gbStreamId}, #{item.platform_id}, #{item.catalogId})" +
30 30 "</foreach> " +
31 31 "</script>")
32 32 int batchAdd(List<StreamPushItem> streamPushItems);
33 33  
34   - @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select gbStreamId from gb_stream where app=#{app} AND stream=#{stream})")
  34 + @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})")
35 35 int delByAppAndStream(String app, String stream);
36 36  
37   - @Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}")
  37 + @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}")
38 38 int delByPlatformId(String platformId);
39 39  
40 40 @Select("SELECT " +
41 41 "pp.* " +
42 42 "FROM " +
43   - "platform_gb_stream pgs " +
44   - "LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " +
45   - "LEFT JOIN gb_stream gs ON gs.gbStreamId = pgs.gbStreamId " +
  43 + "wvp_platform_gb_stream pgs " +
  44 + "LEFT JOIN wvp_platform pp ON pp.server_gb_id = pgs.platform_id " +
  45 + "LEFT join wvp_gb_stream gs ON gs.gb_stream_id = pgs.gb_stream_id " +
46 46 "WHERE " +
47 47 "gs.app =#{app} " +
48 48 "AND gs.stream =#{stream} ")
49 49 List<ParentPlatform> selectByAppAndStream(String app, String stream);
50 50  
51   - @Select("SELECT pgs.*, gs.gbId FROM platform_gb_stream pgs " +
52   - "LEFT JOIN gb_stream gs ON pgs.gbStreamId = gs.gbStreamId " +
53   - "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platformId=#{serverGBId}")
  51 + @Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " +
  52 + "LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " +
  53 + "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{serverGBId}")
54 54 StreamProxyItem selectOne(String app, String stream, String serverGBId);
55 55  
56 56 @Select("select gs.* \n" +
57   - "from gb_stream gs\n" +
58   - " left join platform_gb_stream pgs\n" +
59   - " on gs.gbStreamId = pgs.gbStreamId\n" +
60   - "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
  57 + "from wvp_gb_stream gs\n" +
  58 + " left join wvp_platform_gb_stream pgs\n" +
  59 + " on gs.gb_stream_id = pgs.gb_stream_id\n" +
  60 + "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
61 61 List<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
62 62  
63   - @Select("select gs.gbId as id, gs.name as name, pgs.platformId as platformId, pgs.catalogId as catalogId , 0 as childrenCount, 2 as type\n" +
64   - "from gb_stream gs\n" +
65   - " left join platform_gb_stream pgs\n" +
66   - " on gs.gbStreamId = pgs.gbStreamId\n" +
67   - "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
  63 + @Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" +
  64 + "from wvp_gb_stream gs\n" +
  65 + " left join wvp_platform_gb_stream pgs\n" +
  66 + " on gs.gb_stream_id = pgs.gb_stream_id\n" +
  67 + "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
68 68 List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId);
69 69  
70   - @Delete("DELETE FROM platform_gb_stream WHERE catalogId=#{id}")
  70 + @Delete("DELETE from wvp_platform_gb_stream WHERE catalog_id=#{id}")
71 71 int delByCatalogId(String id);
72 72  
73 73 @Select("<script> " +
74 74 "SELECT " +
75 75 "pp.* " +
76 76 "FROM " +
77   - "parent_platform pp " +
78   - "left join platform_gb_stream pgs on " +
79   - "pp.serverGBId = pgs.platformId " +
80   - "left join gb_stream gs " +
81   - "on gs.gbStreamId = pgs.gbStreamId " +
  77 + "wvp_platform pp " +
  78 + "left join wvp_platform_gb_stream pgs on " +
  79 + "pp.server_gb_id = pgs.platform_id " +
  80 + "left join wvp_gb_stream gs " +
  81 + "on gs.gb_stream_id = pgs.gb_stream_id " +
82 82 "WHERE " +
83 83 "gs.app = #{app} " +
84 84 "AND gs.stream = #{stream}" +
85   - "AND pp.serverGBId IN" +
  85 + "AND pp.server_gb_id IN" +
86 86 "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
87 87 "</script> ")
88 88 List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms);
89 89  
90   - @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select id from gb_stream where app=#{app} AND stream=#{stream}) AND platformId=#{platformId}")
  90 + @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select id from wvp_gb_stream where app=#{app} AND stream=#{stream}) AND platform_id=#{platformId}")
91 91 int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
92 92  
93 93 @Delete("<script> "+
94   - "DELETE FROM platform_gb_stream where gbStreamId in " +
  94 + "DELETE from wvp_platform_gb_stream where gb_stream_id in " +
95 95 "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" +
96 96 "#{item.gbStreamId}" +
97 97 "</foreach>" +
... ... @@ -99,13 +99,13 @@ public interface PlatformGbStreamMapper {
99 99 void delByGbStreams(List<GbStream> gbStreams);
100 100  
101 101 @Delete("<script> "+
102   - "DELETE FROM platform_gb_stream where platformId=#{platformId} and gbStreamId in " +
  102 + "DELETE from wvp_platform_gb_stream where platform_id=#{platformId} and gb_stream_id in " +
103 103 "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" +
104 104 "#{item.gbStreamId} " +
105 105 "</foreach>" +
106 106 "</script>")
107 107 void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId);
108 108  
109   - @Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId} and catalogId=#{catalogId}")
  109 + @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId} and catalog_id=#{catalogId}")
110 110 int delByPlatformAndCatalogId(String platformId, String catalogId);
111 111 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/RecordInfoDao.java deleted 100644 → 0
1   -package com.genersoft.iot.vmp.storager.dao;
2   -
3   -import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo;
4   -import org.apache.ibatis.annotations.Delete;
5   -import org.apache.ibatis.annotations.Insert;
6   -import org.apache.ibatis.annotations.Mapper;
7   -import org.apache.ibatis.annotations.Select;
8   -import org.springframework.stereotype.Repository;
9   -
10   -import java.util.List;
11   -
12   -@Mapper
13   -@Repository
14   -public interface RecordInfoDao {
15   -
16   - @Insert("INSERT INTO recordInfo (app, stream, mediaServerId, createTime, type, deviceId, channelId, name) VALUES" +
17   - "(#{app}, #{stream}, #{mediaServerId}, datetime('now','localtime')), #{type}, #{deviceId}, #{channelId}, #{name}")
18   - int add(RecordInfo recordInfo);
19   -
20   - @Delete("DELETE FROM user WHERE createTime < #{beforeTime}")
21   - int deleteBefore(String beforeTime);
22   -
23   - @Select("select * FROM recordInfo")
24   - List<RecordInfo> selectAll();
25   -}
src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
1 1 package com.genersoft.iot.vmp.storager.dao;
2 2  
3 3 import com.genersoft.iot.vmp.storager.dao.dto.Role;
4   -import com.genersoft.iot.vmp.storager.dao.dto.User;
5 4 import org.apache.ibatis.annotations.*;
6 5 import org.springframework.stereotype.Repository;
7 6  
... ... @@ -11,25 +10,25 @@ import java.util.List;
11 10 @Repository
12 11 public interface RoleMapper {
13 12  
14   - @Insert("INSERT INTO user_role (name, authority, createTime, updateTime) VALUES" +
  13 + @Insert("INSERT INTO wvp_user_role (name, authority, create_time, update_time) VALUES" +
15 14 "(#{name}, #{authority}, #{createTime}, #{updateTime})")
16 15 int add(Role role);
17 16  
18 17 @Update(value = {" <script>" +
19   - "UPDATE user_role " +
20   - "SET updateTime=#{updateTime} " +
  18 + "UPDATE wvp_user_role " +
  19 + "SET update_time=#{updateTime} " +
21 20 "<if test=\"name != null\">, name=#{name}</if>" +
22 21 "<if test=\"authority != null\">, authority=#{authority}</if>" +
23 22 "WHERE id != 1 and id=#{id}" +
24 23 " </script>"})
25 24 int update(Role role);
26 25  
27   - @Delete("DELETE FROM user_role WHERE id != 1 and id=#{id}")
  26 + @Delete("DELETE from wvp_user_role WHERE id != 1 and id=#{id}")
28 27 int delete(int id);
29 28  
30   - @Select("select * FROM user_role WHERE id=#{id}")
  29 + @Select("select * from wvp_user_role WHERE id=#{id}")
31 30 Role selectById(int id);
32 31  
33   - @Select("select * FROM user_role")
  32 + @Select("select * from wvp_user_role")
34 33 List<Role> selectAll();
35 34 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java
1 1 package com.genersoft.iot.vmp.storager.dao;
2 2  
3 3 import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
4   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  4 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
5 5 import org.apache.ibatis.annotations.*;
6 6 import org.springframework.stereotype.Repository;
7 7  
... ... @@ -11,20 +11,20 @@ import java.util.List;
11 11 @Repository
12 12 public interface StreamProxyMapper {
13 13  
14   - @Insert("INSERT INTO stream_proxy (type, name, app, stream,mediaServerId, url, src_url, dst_url, " +
15   - "timeout_ms, ffmpeg_cmd_key, rtp_type, enable_audio, enable_mp4, enable, status, enable_remove_none_reader, enable_disable_none_reader, createTime) VALUES" +
  14 + @Insert("INSERT INTO wvp_stream_proxy (type, name, app, stream,media_server_id, url, src_url, dst_url, " +
  15 + "timeout_ms, ffmpeg_cmd_key, rtp_type, enable_audio, enable_mp4, enable, status, enable_remove_none_reader, enable_disable_none_reader, create_time) VALUES" +
16 16 "(#{type}, #{name}, #{app}, #{stream}, #{mediaServerId}, #{url}, #{src_url}, #{dst_url}, " +
17 17 "#{timeout_ms}, #{ffmpeg_cmd_key}, #{rtp_type}, #{enable_audio}, #{enable_mp4}, #{enable}, #{status}, " +
18 18 "#{enable_remove_none_reader}, #{enable_disable_none_reader}, #{createTime} )")
19 19 int add(StreamProxyItem streamProxyDto);
20 20  
21   - @Update("UPDATE stream_proxy " +
  21 + @Update("UPDATE wvp_stream_proxy " +
22 22 "SET type=#{type}, " +
23 23 "name=#{name}," +
24 24 "app=#{app}," +
25 25 "stream=#{stream}," +
26 26 "url=#{url}, " +
27   - "mediaServerId=#{mediaServerId}, " +
  27 + "media_server_id=#{mediaServerId}, " +
28 28 "src_url=#{src_url}," +
29 29 "dst_url=#{dst_url}, " +
30 30 "timeout_ms=#{timeout_ms}, " +
... ... @@ -39,44 +39,51 @@ public interface StreamProxyMapper {
39 39 "WHERE app=#{app} AND stream=#{stream}")
40 40 int update(StreamProxyItem streamProxyDto);
41 41  
42   - @Delete("DELETE FROM stream_proxy WHERE app=#{app} AND stream=#{stream}")
  42 + @Delete("DELETE FROM wvp_stream_proxy WHERE app=#{app} AND stream=#{stream}")
43 43 int del(String app, String stream);
44 44  
45   - @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream order by st.createTime desc")
  45 + @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream order by st.create_time desc")
46 46 List<StreamProxyItem> selectAll();
47 47  
48   - @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable=#{enable} order by st.createTime desc")
  48 + @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable=#{enable} order by st.create_time desc")
49 49 List<StreamProxyItem> selectForEnable(boolean enable);
50 50  
51   - @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.app=#{app} AND st.stream=#{stream} order by st.createTime desc")
  51 + @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.app=#{app} AND st.stream=#{stream} order by st.create_time desc")
52 52 StreamProxyItem selectOne(String app, String stream);
53 53  
54   - @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st " +
55   - "LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
56   - "WHERE st.enable=#{enable} and st.mediaServerId = #{id} order by st.createTime desc")
  54 + @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " +
  55 + "LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
  56 + "WHERE st.enable=#{enable} and st.media_server_id= #{id} order by st.create_time desc")
57 57 List<StreamProxyItem> selectForEnableInMediaServer(String id, boolean enable);
58 58  
59   - @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st " +
60   - "LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
61   - "WHERE st.mediaServerId = #{id} order by st.createTime desc")
  59 + @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " +
  60 + "LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
  61 + "WHERE st.media_server_id= #{id} order by st.create_time desc")
62 62 List<StreamProxyItem> selectInMediaServer(String id);
63 63  
64   - @Update("UPDATE stream_proxy " +
  64 + @Update("UPDATE wvp_stream_proxy " +
65 65 "SET status=#{status} " +
66   - "WHERE mediaServerId=#{mediaServerId}")
  66 + "WHERE media_server_id=#{mediaServerId}")
67 67 void updateStatusByMediaServerId(String mediaServerId, boolean status);
68 68  
69   - @Update("UPDATE stream_proxy " +
  69 + @Update("UPDATE wvp_stream_proxy " +
70 70 "SET status=#{status} " +
71 71 "WHERE app=#{app} AND stream=#{stream}")
72 72 int updateStatus(String app, String stream, boolean status);
73 73  
74   - @Delete("DELETE FROM stream_proxy WHERE enable_remove_none_reader=true AND mediaServerId=#{mediaServerId}")
  74 + @Delete("DELETE FROM wvp_stream_proxy WHERE enable_remove_none_reader=true AND media_server_id=#{mediaServerId}")
75 75 void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
76 76  
77   - @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable_remove_none_reader=true AND st.mediaServerId=#{mediaServerId} order by st.createTime desc")
78   - List<StreamProxyItem> selecAutoRemoveItemByMediaServerId(String mediaServerId);
  77 + @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable_remove_none_reader=true AND st.media_server_id=#{mediaServerId} order by st.create_time desc")
  78 + List<StreamProxyItem> selectAutoRemoveItemByMediaServerId(String mediaServerId);
79 79  
80   - @Select("select count(1) as total, sum(status) as online from stream_proxy")
81   - ResourceBaceInfo getOverview();
  80 + @Select("select count(1) as total, sum(status) as online from wvp_stream_proxy")
  81 + ResourceBaseInfo getOverview();
  82 +
  83 + @Select("select count(1) from wvp_stream_proxy")
  84 +
  85 + int getAllCount();
  86 +
  87 + @Select("select count(1) from wvp_stream_proxy where status = true")
  88 + int getOnline();
82 89 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java
... ... @@ -3,54 +3,51 @@ package com.genersoft.iot.vmp.storager.dao;
3 3 import com.genersoft.iot.vmp.gb28181.bean.GbStream;
4 4 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
5 5 import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
6   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
7 6 import org.apache.ibatis.annotations.*;
8   -// import org.omg.PortableInterceptor.INACTIVE;
9 7 import org.springframework.stereotype.Repository;
10 8  
11   -import java.util.Collection;
12 9 import java.util.List;
13 10  
14 11 @Mapper
15 12 @Repository
16 13 public interface StreamPushMapper {
17 14  
18   - @Insert("INSERT INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " +
19   - "pushTime, aliveSecond, mediaServerId, serverId, updateTime, createTime, pushIng, self) VALUES" +
  15 + @Insert("INSERT INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
  16 + "push_time, alive_second, media_server_id, update_time, create_time, push_ing, self) VALUES" +
20 17 "(#{app}, #{stream}, #{totalReaderCount}, #{originType}, #{originTypeStr}, " +
21   - "#{pushTime}, #{aliveSecond}, #{mediaServerId} , #{serverId} , #{updateTime} , #{createTime}, " +
  18 + "#{pushTime}, #{aliveSecond}, #{mediaServerId} , #{updateTime} , #{createTime}, " +
22 19 "#{pushIng}, #{self} )")
23 20 int add(StreamPushItem streamPushItem);
24 21  
25 22  
26 23 @Update(value = {" <script>" +
27   - "UPDATE stream_push " +
28   - "SET updateTime=#{updateTime}" +
29   - "<if test=\"mediaServerId != null\">, mediaServerId=#{mediaServerId}</if>" +
30   - "<if test=\"totalReaderCount != null\">, totalReaderCount=#{totalReaderCount}</if>" +
31   - "<if test=\"originType != null\">, originType=#{originType}</if>" +
32   - "<if test=\"originTypeStr != null\">, originTypeStr=#{originTypeStr}</if>" +
33   - "<if test=\"pushTime != null\">, pushTime=#{pushTime}</if>" +
34   - "<if test=\"aliveSecond != null\">, aliveSecond=#{aliveSecond}</if>" +
35   - "<if test=\"pushIng != null\">, pushIng=#{pushIng}</if>" +
  24 + "UPDATE wvp_stream_push " +
  25 + "SET update_time=#{updateTime}" +
  26 + "<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" +
  27 + "<if test=\"totalReaderCount != null\">, total_reader_count=#{totalReaderCount}</if>" +
  28 + "<if test=\"originType != null\">, origin_type=#{originType}</if>" +
  29 + "<if test=\"originTypeStr != null\">, origin_type_str=#{originTypeStr}</if>" +
  30 + "<if test=\"pushTime != null\">, push_time=#{pushTime}</if>" +
  31 + "<if test=\"aliveSecond != null\">, alive_second=#{aliveSecond}</if>" +
  32 + "<if test=\"pushIng != null\">, push_ing=#{pushIng}</if>" +
36 33 "<if test=\"self != null\">, self=#{self}</if>" +
37 34 "WHERE app=#{app} AND stream=#{stream}"+
38 35 " </script>"})
39 36 int update(StreamPushItem streamPushItem);
40 37  
41   - @Delete("DELETE FROM stream_push WHERE app=#{app} AND stream=#{stream}")
  38 + @Delete("DELETE FROM wvp_stream_push WHERE app=#{app} AND stream=#{stream}")
42 39 int del(String app, String stream);
43 40  
44 41 @Delete("<script> "+
45   - "DELETE sp FROM stream_push sp left join gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where " +
  42 + "DELETE sp FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where " +
46 43 "<foreach collection='streamPushItems' item='item' separator='or'>" +
47   - "(sp.app=#{item.app} and sp.stream=#{item.stream} and gs.gbId is null) " +
  44 + "(sp.app=#{item.app} and sp.stream=#{item.stream} and gs.gb_id is null) " +
48 45 "</foreach>" +
49 46 "</script>")
50 47 int delAllWithoutGBId(List<StreamPushItem> streamPushItems);
51 48  
52 49 @Delete("<script> "+
53   - "DELETE FROM stream_push where " +
  50 + "DELETE FROM wvp_stream_push where " +
54 51 "<foreach collection='streamPushItems' item='item' separator='or'>" +
55 52 "(app=#{item.app} and stream=#{item.stream}) " +
56 53 "</foreach>" +
... ... @@ -58,7 +55,7 @@ public interface StreamPushMapper {
58 55 int delAll(List<StreamPushItem> streamPushItems);
59 56  
60 57 @Delete("<script> "+
61   - "DELETE FROM stream_push where " +
  58 + "DELETE FROM wvp_stream_push where " +
62 59 "<foreach collection='gbStreams' item='item' separator='or'>" +
63 60 "(app=#{item.app} and stream=#{item.stream}) " +
64 61 "</foreach>" +
... ... @@ -69,30 +66,30 @@ public interface StreamPushMapper {
69 66 @Select(value = {" <script>" +
70 67 "SELECT " +
71 68 "st.*, " +
72   - "gs.gbId, gs.name, gs.longitude, gs.latitude, gs.gbStreamId " +
  69 + "gs.gb_id, gs.name, gs.longitude, gs.latitude, gs.gb_stream_id " +
73 70 "from " +
74   - "stream_push st " +
75   - "LEFT JOIN gb_stream gs " +
  71 + "wvp_stream_push st " +
  72 + "LEFT join wvp_gb_stream gs " +
76 73 "on st.app = gs.app AND st.stream = gs.stream " +
77 74 "WHERE " +
78 75 "1=1 " +
79   - " <if test='query != null'> AND (st.app LIKE concat('%',#{query},'%') OR st.stream LIKE concat('%',#{query},'%') OR gs.gbId LIKE concat('%',#{query},'%') OR gs.name LIKE concat('%',#{query},'%'))</if> " +
80   - " <if test='pushing == true' > AND (gs.gbId is null OR st.pushIng=1)</if>" +
81   - " <if test='pushing == false' > AND (st.pushIng is null OR st.pushIng=0) </if>" +
82   - " <if test='mediaServerId != null' > AND st.mediaServerId=#{mediaServerId} </if>" +
83   - "order by st.createTime desc" +
  76 + " <if test='query != null'> AND (st.app LIKE concat('%',#{query},'%') OR st.stream LIKE concat('%',#{query},'%') OR gs.gb_id LIKE concat('%',#{query},'%') OR gs.name LIKE concat('%',#{query},'%'))</if> " +
  77 + " <if test='pushing == true' > AND (gs.gb_id is null OR st.push_ing=1)</if>" +
  78 + " <if test='pushing == false' > AND (st.push_ing is null OR st.push_ing=0) </if>" +
  79 + " <if test='mediaServerId != null' > AND st.media_server_id=#{mediaServerId} </if>" +
  80 + "order by st.create_time desc" +
84 81 " </script>"})
85 82 List<StreamPushItem> selectAllForList(String query, Boolean pushing, String mediaServerId);
86 83  
87   - @Select("SELECT st.*, gs.gbId, gs.name, gs.longitude, gs.latitude FROM stream_push st LEFT JOIN gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.createTime desc")
  84 + @Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.create_time desc")
88 85 List<StreamPushItem> selectAll();
89 86  
90   - @Select("SELECT st.*, gs.gbId, gs.name, gs.longitude, gs.latitude FROM stream_push st LEFT JOIN gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}")
  87 + @Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}")
91 88 StreamPushItem selectOne(String app, String stream);
92 89  
93 90 @Insert("<script>" +
94   - "Insert IGNORE INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " +
95   - "createTime, aliveSecond, mediaServerId, status, pushIng) " +
  91 + "Insert INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
  92 + "create_time, alive_second, media_server_id, status, push_ing) " +
96 93 "VALUES <foreach collection='streamPushItems' item='item' index='index' separator=','>" +
97 94 "( #{item.app}, #{item.stream}, #{item.totalReaderCount}, #{item.originType}, " +
98 95 "#{item.originTypeStr},#{item.createTime}, #{item.aliveSecond}, #{item.mediaServerId}, #{item.status} ," +
... ... @@ -102,37 +99,45 @@ public interface StreamPushMapper {
102 99 @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
103 100 int addAll(List<StreamPushItem> streamPushItems);
104 101  
105   - @Delete("DELETE FROM stream_push")
  102 + @Delete("DELETE FROM wvp_stream_push")
106 103 void clear();
107 104  
108   - @Delete("DELETE sp FROM stream_push sp left join gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.mediaServerId=#{mediaServerId} and gs.gbId is null ")
  105 + @Delete("delete" +
  106 + " from wvp_stream_push " +
  107 + " where id in " +
  108 + " (select temp.id from " +
  109 + " (select wgs.gb_stream_id as id " +
  110 + " from wvp_gb_stream wgs" +
  111 + " left join wvp_stream_push sp on sp.id = wgs.gb_stream_id" +
  112 + " where wgs.gb_id is null and wgs.media_server_id = #{mediaServerId}) temp)"
  113 + )
109 114 void deleteWithoutGBId(String mediaServerId);
110 115  
111   - @Select("SELECT * FROM stream_push WHERE mediaServerId=#{mediaServerId}")
  116 + @Select("SELECT * FROM wvp_stream_push WHERE media_server_id=#{mediaServerId}")
112 117 List<StreamPushItem> selectAllByMediaServerId(String mediaServerId);
113 118  
114   - @Select("SELECT sp.* FROM stream_push sp left join gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.mediaServerId=#{mediaServerId} and gs.gbId is null")
  119 + @Select("SELECT sp.* FROM wvp_stream_push sp left join wvp_gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.media_server_id=#{mediaServerId} and gs.gb_id is null")
115 120 List<StreamPushItem> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
116 121  
117   - @Update("UPDATE stream_push " +
  122 + @Update("UPDATE wvp_stream_push " +
118 123 "SET status=#{status} " +
119 124 "WHERE app=#{app} AND stream=#{stream}")
120 125 int updateStatus(String app, String stream, boolean status);
121 126  
122   - @Update("UPDATE stream_push " +
123   - "SET pushIng=#{pushIng} " +
  127 + @Update("UPDATE wvp_stream_push " +
  128 + "SET push_ing=#{pushIng} " +
124 129 "WHERE app=#{app} AND stream=#{stream}")
125 130 int updatePushStatus(String app, String stream, boolean pushIng);
126 131  
127   - @Update("UPDATE stream_push " +
  132 + @Update("UPDATE wvp_stream_push " +
128 133 "SET status=#{status} " +
129   - "WHERE mediaServerId=#{mediaServerId}")
  134 + "WHERE media_server_id=#{mediaServerId}")
130 135 void updateStatusByMediaServerId(String mediaServerId, boolean status);
131 136  
132 137  
133 138 @Select("<script> "+
134   - "SELECT gs.* FROM stream_push sp left join gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
135   - "where sp.status = 1 and (gs.app, gs.stream) in (" +
  139 + "SELECT gs.* FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
  140 + "where sp.status = true and (gs.app, gs.stream) in (" +
136 141 "<foreach collection='offlineStreams' item='item' separator=','>" +
137 142 "(#{item.app}, #{item.stream}) " +
138 143 "</foreach>" +
... ... @@ -140,7 +145,7 @@ public interface StreamPushMapper {
140 145 List<GbStream> getOnlinePusherForGbInList(List<StreamPushItemFromRedis> offlineStreams);
141 146  
142 147 @Update("<script> "+
143   - "UPDATE stream_push SET status=0 where (app, stream) in (" +
  148 + "UPDATE wvp_stream_push SET status=0 where (app, stream) in (" +
144 149 "<foreach collection='offlineStreams' item='item' separator=','>" +
145 150 "(#{item.app}, #{item.stream}) " +
146 151 "</foreach>" +
... ... @@ -148,7 +153,7 @@ public interface StreamPushMapper {
148 153 void offline(List<StreamPushItemFromRedis> offlineStreams);
149 154  
150 155 @Select("<script> "+
151   - "SELECT * FROM stream_push sp left join gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
  156 + "SELECT * FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
152 157 "where sp.status = 0 and (gs.app, gs.stream) in (" +
153 158 "<foreach collection='onlineStreams' item='item' separator=','>" +
154 159 "(#{item.app}, #{item.stream}) " +
... ... @@ -157,25 +162,36 @@ public interface StreamPushMapper {
157 162 List<GbStream> getOfflinePusherForGbInList(List<StreamPushItemFromRedis> onlineStreams);
158 163  
159 164 @Update("<script> "+
160   - "UPDATE stream_push SET status=1 where (app, stream) in (" +
  165 + "UPDATE wvp_stream_push SET status=1 where (app, stream) in (" +
161 166 "<foreach collection='onlineStreams' item='item' separator=','>" +
162 167 "(#{item.app}, #{item.stream}) " +
163 168 "</foreach>" +
164 169 ")</script>")
165 170 void online(List<StreamPushItemFromRedis> onlineStreams);
166 171  
167   - @Select("SELECT gs.* FROM stream_push sp left join gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where sp.status = 1")
  172 + @Select("SELECT gs.* FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where sp.status = true")
168 173 List<GbStream> getOnlinePusherForGb();
169 174  
170   - @Update("UPDATE stream_push SET status=0")
  175 + @Update("UPDATE wvp_stream_push SET status=0")
171 176 void setAllStreamOffline();
172 177  
173   - @Select("SELECT CONCAT(app,stream) FROM gb_stream")
  178 + @Select("SELECT CONCAT(app,stream) from wvp_gb_stream")
174 179 List<String> getAllAppAndStream();
175 180  
  181 + @Select("select count(1) from wvp_stream_push ")
  182 + int getAllCount();
  183 +
176 184 @Select(value = {" <script>" +
177   - " <if test='pushIngAsOnline == true'> select count(1) as total, sum(pushIng) as online from stream_push </if>" +
178   - " <if test='pushIngAsOnline == false'> select count(1) as total, sum(status) as online from stream_push </if>" +
  185 + " <if test='pushIngAsOnline == true'> select count(1) from wvp_stream_push where push_ing = true </if>" +
  186 + " <if test='pushIngAsOnline == false'> select count(1)from wvp_stream_push where status = true </if>" +
179 187 " </script>"})
180   - ResourceBaceInfo getOverview(boolean pushIngAsOnline);
  188 + int getAllOnline(Boolean usePushingAsStatus);
  189 +
  190 + @Select("<script> " +
  191 + "select app, stream from wvp_stream_push where (app, stream) in " +
  192 + "<foreach collection='streamPushItems' item='item' separator=','>" +
  193 + "(#{item.app}, #{item.stream}) " +
  194 + "</foreach>" +
  195 + "</script>")
  196 + List<StreamPushItem> getListIn(List<StreamPushItem> streamPushItems);
181 197 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java
... ... @@ -10,56 +10,50 @@ import java.util.List;
10 10 @Repository
11 11 public interface UserMapper {
12 12  
13   - @Insert("INSERT INTO user (username, password, roleId, pushKey, createTime, updateTime) VALUES" +
  13 + @Insert("INSERT INTO wvp_user (username, password, role_id, push_key, create_time, update_time) VALUES" +
14 14 "(#{username}, #{password}, #{role.id}, #{pushKey}, #{createTime}, #{updateTime})")
15 15 int add(User user);
16 16  
17 17 @Update(value = {" <script>" +
18   - "UPDATE user " +
19   - "SET updateTime=#{updateTime} " +
20   - "<if test=\"pushKey != null\">, pushKey=#{pushKey}</if>" +
21   - "<if test=\"role != null\">, roleId=#{role.id}</if>" +
  18 + "UPDATE wvp_user " +
  19 + "SET update_time=#{updateTime} " +
  20 + "<if test=\"pushKey != null\">, push_key=#{pushKey}</if>" +
  21 + "<if test=\"role != null\">, role_id=#{role.id}</if>" +
22 22 "<if test=\"password != null\">, password=#{password}</if>" +
23 23 "<if test=\"username != null\">, username=#{username}</if>" +
24 24 "WHERE id=#{id}" +
25 25 " </script>"})
26 26 int update(User user);
27 27  
28   - @Delete("DELETE FROM user WHERE id != 1 and id=#{id}")
  28 + @Delete("DELETE from wvp_user WHERE id != 1 and id=#{id}")
29 29 int delete(int id);
30 30  
31   - @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.username=#{username} AND u.password=#{password}")
  31 + @Select("select u.*, r.id as role_id, r.name as roleName, r.authority as roleAuthority , r.create_time as role_create_time , r.update_time as role_update_time from wvp_user u, wvp_user_role r WHERE u.role_id=r.id and u.username=#{username} AND u.password=#{password}")
32 32 @Results(id = "roleMap", value = {
33   - @Result(column = "roleID", property = "role.id"),
34   - @Result(column = "roleName", property = "role.name"),
35   - @Result(column = "roleAuthority", property = "role.authority"),
36   - @Result(column = "roleCreateTime", property = "role.createTime"),
37   - @Result(column = "roleUpdateTime", property = "role.updateTime")
  33 + @Result(column = "role_id", property = "role.id"),
  34 + @Result(column = "role_name", property = "role.name"),
  35 + @Result(column = "role_authority", property = "role.authority"),
  36 + @Result(column = "role_create_time", property = "role.createTime"),
  37 + @Result(column = "role_update_time", property = "role.updateTime")
38 38 })
39 39 User select(String username, String password);
40 40  
41   - @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.id=#{id}")
  41 + @Select("select u.*, r.id as role_id, r.name as role_name, r.authority as role_authority , r.create_time as role_create_time , r.update_time as role_update_time from wvp_user u, wvp_user_role r WHERE u.role_id=r.id and u.id=#{id}")
42 42 @ResultMap(value="roleMap")
43 43 User selectById(int id);
44 44  
45   - @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.username=#{username}")
  45 + @Select("select u.*, r.id as role_id, r.name as role_name, r.authority as role_authority , r.create_time as role_create_time , r.update_time as role_update_time from wvp_user u, wvp_user_role r WHERE u.role_id=r.id and u.username=#{username}")
46 46 @ResultMap(value="roleMap")
47 47 User getUserByUsername(String username);
48 48  
49   - @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id")
  49 + @Select("select u.*, r.id as role_id, r.name as role_name, r.authority as role_authority , r.create_time as role_create_time , r.update_time as role_update_time from wvp_user u, wvp_user_role r WHERE u.role_id=r.id")
50 50 @ResultMap(value="roleMap")
51 51 List<User> selectAll();
52 52  
53   - @Select("select * from (select user.*, concat(concat(#{callId}, '_'), pushKey) as str1 from user) as u where md5(u.str1) = #{sign}")
54   - List<User> checkPushAuthorityByCallIdAndSign(String callId, String sign);
55   -
56   - @Select("select * from user where md5(pushKey) = #{sign}")
57   - List<User> checkPushAuthorityByCallId(String sign);
58   -
59   - @Select("select u.id, u.username,u.pushKey,u.roleId, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u join user_role r on u.roleId=r.id")
  53 + @Select("select u.id, u.username,u.push_key,u.role_id, r.id as role_id, r.name as role_name, r.authority as role_authority , r.create_time as role_create_time , r.update_time as role_update_time from wvp_user u join wvp_user_role r on u.role_id=r.id")
60 54 @ResultMap(value="roleMap")
61 55 List<User> getUsers();
62 56  
63   - @Update("update user set pushKey=#{pushKey} where id=#{id}")
  57 + @Update("UPDATE wvp_user set push_key=#{pushKey} where id=#{id}")
64 58 int changePushKey(int id, String pushKey);
65 59 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
... ... @@ -561,7 +561,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
561 561  
562 562 @Override
563 563 public boolean deviceIsOnline(String deviceId) {
564   - return getDevice(deviceId).getOnline() == 1;
  564 + return getDevice(deviceId).isOnLine();
565 565 }
566 566  
567 567  
... ...
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
... ... @@ -123,6 +123,9 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
123 123 TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
124 124 // 数据去重
125 125 List<DeviceChannel> channels = new ArrayList<>();
  126 +
  127 + List<DeviceChannel> updateChannels = new ArrayList<>();
  128 + List<DeviceChannel> addChannels = new ArrayList<>();
126 129 StringBuilder stringBuilder = new StringBuilder();
127 130 Map<String, Integer> subContMap = new HashMap<>();
128 131 if (deviceChannelList.size() > 0) {
... ... @@ -131,18 +134,22 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
131 134 for (DeviceChannel deviceChannel : deviceChannelList) {
132 135 if (!gbIdSet.contains(deviceChannel.getChannelId())) {
133 136 gbIdSet.add(deviceChannel.getChannelId());
  137 + deviceChannel.setUpdateTime(DateUtil.getNow());
134 138 if (allChannelMap.containsKey(deviceChannel.getChannelId())) {
135 139 deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
136 140 deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
137   - if (allChannelMap.get(deviceChannel.getChannelId()).getStatus() !=deviceChannel.getStatus()){
  141 + if (allChannelMap.get(deviceChannel.getChannelId()).isStatus() !=deviceChannel.isStatus()){
138 142 List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId());
139 143 if (!CollectionUtils.isEmpty(strings)){
140 144 strings.forEach(platformId->{
141   - eventPublisher.catalogEventPublish(platformId, deviceChannel, deviceChannel.getStatus()==1?CatalogEvent.ON:CatalogEvent.OFF);
  145 + eventPublisher.catalogEventPublish(platformId, deviceChannel, deviceChannel.isStatus()?CatalogEvent.ON:CatalogEvent.OFF);
142 146 });
143 147 }
144   -
145 148 }
  149 + updateChannels.add(deviceChannel);
  150 + }else {
  151 + deviceChannel.setCreateTime(DateUtil.getNow());
  152 + addChannels.add(deviceChannel);
146 153 }
147 154 channels.add(deviceChannel);
148 155 if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) {
... ... @@ -175,21 +182,36 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
175 182 }
176 183 try {
177 184 int cleanChannelsResult = deviceChannelMapper.cleanChannelsNotInList(deviceId, channels);
  185 +
178 186 int limitCount = 300;
179 187 boolean result = cleanChannelsResult < 0;
180   - if (!result && channels.size() > 0) {
181   - if (channels.size() > limitCount) {
182   - for (int i = 0; i < channels.size(); i += limitCount) {
  188 + if (!result && addChannels.size() > 0) {
  189 + if (addChannels.size() > limitCount) {
  190 + for (int i = 0; i < addChannels.size(); i += limitCount) {
  191 + int toIndex = i + limitCount;
  192 + if (i + limitCount > addChannels.size()) {
  193 + toIndex = addChannels.size();
  194 + }
  195 + result = result || deviceChannelMapper.batchAdd(addChannels.subList(i, toIndex)) < 0;
  196 + }
  197 + }else {
  198 + result = result || deviceChannelMapper.batchAdd(addChannels) < 0;
  199 + }
  200 + }
  201 + if (!result && updateChannels.size() > 0) {
  202 + if (updateChannels.size() > limitCount) {
  203 + for (int i = 0; i < updateChannels.size(); i += limitCount) {
183 204 int toIndex = i + limitCount;
184   - if (i + limitCount > channels.size()) {
185   - toIndex = channels.size();
  205 + if (i + limitCount > updateChannels.size()) {
  206 + toIndex = updateChannels.size();
186 207 }
187   - result = result || deviceChannelMapper.batchAddOrUpdate(channels.subList(i, toIndex)) < 0;
  208 + result = result || deviceChannelMapper.batchUpdate(updateChannels.subList(i, toIndex)) < 0;
188 209 }
189 210 }else {
190   - result = result || deviceChannelMapper.batchAddOrUpdate(channels) < 0;
  211 + result = result || deviceChannelMapper.batchUpdate(updateChannels) < 0;
191 212 }
192 213 }
  214 +
193 215 if (result) {
194 216 //事务回滚
195 217 dataSourceTransactionManager.rollback(transactionStatus);
... ... @@ -919,7 +941,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
919 941 deviceChannel.setLatitude(0.0);
920 942 deviceChannel.setDeviceId(platform.getDeviceGBId());
921 943 deviceChannel.setManufacture("wvp-pro");
922   - deviceChannel.setStatus(1);
  944 + deviceChannel.setStatus(true);
923 945 deviceChannel.setParental(1);
924 946  
925 947 deviceChannel.setRegisterWay(1);
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/bean/ResourceBaceInfo.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/bean/ResourceBaseInfo.java
1 1 package com.genersoft.iot.vmp.vmanager.bean;
2 2  
3   -public class ResourceBaceInfo {
  3 +public class ResourceBaseInfo {
4 4 private int total;
5 5 private int online;
6 6  
  7 + public ResourceBaseInfo() {
  8 + }
  9 +
  10 + public ResourceBaseInfo(int total, int online) {
  11 + this.total = total;
  12 + this.online = online;
  13 + }
  14 +
7 15 public int getTotal() {
8 16 return total;
9 17 }
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/bean/ResourceInfo.java
... ... @@ -2,40 +2,40 @@ package com.genersoft.iot.vmp.vmanager.bean;
2 2  
3 3 public class ResourceInfo {
4 4  
5   - private ResourceBaceInfo device;
6   - private ResourceBaceInfo channel;
7   - private ResourceBaceInfo push;
8   - private ResourceBaceInfo proxy;
  5 + private ResourceBaseInfo device;
  6 + private ResourceBaseInfo channel;
  7 + private ResourceBaseInfo push;
  8 + private ResourceBaseInfo proxy;
9 9  
10   - public ResourceBaceInfo getDevice() {
  10 + public ResourceBaseInfo getDevice() {
11 11 return device;
12 12 }
13 13  
14   - public void setDevice(ResourceBaceInfo device) {
  14 + public void setDevice(ResourceBaseInfo device) {
15 15 this.device = device;
16 16 }
17 17  
18   - public ResourceBaceInfo getChannel() {
  18 + public ResourceBaseInfo getChannel() {
19 19 return channel;
20 20 }
21 21  
22   - public void setChannel(ResourceBaceInfo channel) {
  22 + public void setChannel(ResourceBaseInfo channel) {
23 23 this.channel = channel;
24 24 }
25 25  
26   - public ResourceBaceInfo getPush() {
  26 + public ResourceBaseInfo getPush() {
27 27 return push;
28 28 }
29 29  
30   - public void setPush(ResourceBaceInfo push) {
  30 + public void setPush(ResourceBaseInfo push) {
31 31 this.push = push;
32 32 }
33 33  
34   - public ResourceBaceInfo getProxy() {
  34 + public ResourceBaseInfo getProxy() {
35 35 return proxy;
36 36 }
37 37  
38   - public void setProxy(ResourceBaceInfo proxy) {
  38 + public void setProxy(ResourceBaseInfo proxy) {
39 39 this.proxy = proxy;
40 40 }
41 41 }
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
... ... @@ -15,7 +15,7 @@ import com.genersoft.iot.vmp.service.*;
15 15 import com.genersoft.iot.vmp.service.bean.MediaServerLoad;
16 16 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
17 17 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
18   -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
  18 +import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
19 19 import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo;
20 20 import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo;
21 21 import io.swagger.v3.oas.annotations.Operation;
... ... @@ -251,13 +251,13 @@ public class ServerController {
251 251 @Operation(summary = "获取负载信息")
252 252 public ResourceInfo getResourceInfo() {
253 253 ResourceInfo result = new ResourceInfo();
254   - ResourceBaceInfo deviceInfo = deviceService.getOverview();
  254 + ResourceBaseInfo deviceInfo = deviceService.getOverview();
255 255 result.setDevice(deviceInfo);
256   - ResourceBaceInfo channelInfo = channelService.getOverview();
  256 + ResourceBaseInfo channelInfo = channelService.getOverview();
257 257 result.setChannel(channelInfo);
258   - ResourceBaceInfo pushInfo = pushService.getOverview();
  258 + ResourceBaseInfo pushInfo = pushService.getOverview();
259 259 result.setPush(pushInfo);
260   - ResourceBaceInfo proxyInfo = proxyService.getOverview();
  260 + ResourceBaseInfo proxyInfo = proxyService.getOverview();
261 261 result.setProxy(proxyInfo);
262 262  
263 263 return result;
... ...
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
... ... @@ -90,7 +90,7 @@ public class ApiDeviceController {
90 90 deviceJsonObject.put("RecvStreamIP", "");
91 91 deviceJsonObject.put("CatalogInterval", 3600); // 通道目录抓取周期
92 92 deviceJsonObject.put("SubscribeInterval", device.getSubscribeCycleForCatalog()); // 订阅周期(秒), 0 表示后台不周期订阅
93   - deviceJsonObject.put("Online", device.getOnline() == 1);
  93 + deviceJsonObject.put("Online", device.isOnLine());
94 94 deviceJsonObject.put("Password", "");
95 95 deviceJsonObject.put("MediaTransport", device.getTransport());
96 96 deviceJsonObject.put("RemoteIP", device.getIp());
... ... @@ -148,7 +148,7 @@ public class ApiDeviceController {
148 148 deviceJOSNChannel.put("ID", deviceChannelExtend.getChannelId());
149 149 deviceJOSNChannel.put("DeviceID", deviceChannelExtend.getDeviceId());
150 150 deviceJOSNChannel.put("DeviceName", deviceChannelExtend.getDeviceName());
151   - deviceJOSNChannel.put("DeviceOnline", deviceChannelExtend.getDeviceOnline() == 1);
  151 + deviceJOSNChannel.put("DeviceOnline", deviceChannelExtend.isDeviceOnline());
152 152 deviceJOSNChannel.put("Channel", 0); // TODO 自定义序号
153 153 deviceJOSNChannel.put("Name", deviceChannelExtend.getName());
154 154 deviceJOSNChannel.put("Custom", false);
... ... @@ -167,7 +167,7 @@ public class ApiDeviceController {
167 167 // 1-IETF RFC3261,
168 168 // 2-基于口令的双向认证,
169 169 // 3-基于数字证书的双向认证
170   - deviceJOSNChannel.put("Status", deviceChannelExtend.getStatus() == 1 ? "ON":"OFF");
  170 + deviceJOSNChannel.put("Status", deviceChannelExtend.isStatus() ? "ON":"OFF");
171 171 deviceJOSNChannel.put("Longitude", deviceChannelExtend.getLongitude());
172 172 deviceJOSNChannel.put("Latitude", deviceChannelExtend.getLatitude());
173 173 deviceJOSNChannel.put("PTZType ", deviceChannelExtend.getPTZType()); // 云台类型, 0 - 未知, 1 - 球机, 2 - 半球,
... ...
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
... ... @@ -92,7 +92,7 @@ public class ApiStreamController {
92 92 result.put("error","device[ " + serial + " ]未找到");
93 93 resultDeferredResult.setResult(result);
94 94 return resultDeferredResult;
95   - }else if (device.getOnline() == 0) {
  95 + }else if (!device.isOnLine()) {
96 96 JSONObject result = new JSONObject();
97 97 result.put("error","device[ " + code + " ]offline");
98 98 resultDeferredResult.setResult(result);
... ... @@ -113,7 +113,7 @@ public class ApiStreamController {
113 113 result.put("error","channel[ " + code + " ]未找到");
114 114 resultDeferredResult.setResult(result);
115 115 return resultDeferredResult;
116   - }else if (deviceChannel.getStatus() == 0) {
  116 + }else if (!deviceChannel.isStatus()) {
117 117 JSONObject result = new JSONObject();
118 118 result.put("error","channel[ " + code + " ]offline");
119 119 resultDeferredResult.setResult(result);
... ...
src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtend.java
... ... @@ -25,7 +25,7 @@ public class DeviceChannelExtend {
25 25  
26 26 private String deviceName;
27 27  
28   - private int deviceOnline;
  28 + private boolean deviceOnline;
29 29  
30 30 /**
31 31 * 生产厂商
... ... @@ -146,7 +146,7 @@ public class DeviceChannelExtend {
146 146 * <Status>OFF</Status>
147 147 * 遇到过NVR下的IPC下发信令可以推流, 但是 Status 响应 OFF
148 148 */
149   - private int status;
  149 + private boolean status;
150 150  
151 151 /**
152 152 * 经度
... ... @@ -417,11 +417,11 @@ public class DeviceChannelExtend {
417 417 this.PTZTypeText = PTZTypeText;
418 418 }
419 419  
420   - public int getStatus() {
  420 + public boolean isStatus() {
421 421 return status;
422 422 }
423 423  
424   - public void setStatus(int status) {
  424 + public void setStatus(boolean status) {
425 425 this.status = status;
426 426 }
427 427  
... ... @@ -545,11 +545,11 @@ public class DeviceChannelExtend {
545 545 this.deviceName = deviceName;
546 546 }
547 547  
548   - public int getDeviceOnline() {
  548 + public boolean isDeviceOnline() {
549 549 return deviceOnline;
550 550 }
551 551  
552   - public void setDeviceOnline(int deviceOnline) {
  552 + public void setDeviceOnline(boolean deviceOnline) {
553 553 this.deviceOnline = deviceOnline;
554 554 }
555 555 }
... ...