Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-opsdoc
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 42f68af2
authored
Apr 27, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
去掉概览信息
1 parent
553e980a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
27 deletions
1.6.0_四月/1.6.0数据库SQL脚本.sql
1.6.0_四月/1.6.0数据库SQL脚本.sql
View file @
42f68af
...
@@ -33,27 +33,6 @@ CREATE TABLE `t_alarm_electric_fence`
...
@@ -33,27 +33,6 @@ CREATE TABLE `t_alarm_electric_fence`
COMMENT
=
'新e盾|围栏报警数据表'
;
COMMENT
=
'新e盾|围栏报警数据表'
;
-- 设备里程概览信息表
create
table
t_device_journey_overview
(
id
int
(
11
)
auto_increment
comment
'里程主键ID'
primary
key
,
sn
varchar
(
32
)
null
comment
'设备序列号'
,
vd_id
int
(
11
)
default
0
null
comment
'车辆、设备关系id'
,
total_journey_count
int
(
11
)
null
comment
'总行驶次数'
,
distance
int
(
11
)
null
comment
'总里程m'
,
del_flag
tinyint
default
0
null
comment
'是否删除 0=正常 -1=删除'
,
created_date
datetime
null
comment
'创建时间|入库时间'
,
created_by
int
(
11
)
null
comment
'创建人用户id'
,
updated_date
datetime
null
comment
'更新时间'
,
updated_by
int
(
11
)
null
comment
'更新人用户id'
)
comment
'新e盾|里程概览信息表'
;
ALTER
TABLE
`t_device_journey_overview`
ADD
INDEX
idx_sn
(
`sn`
);
ALTER
TABLE
`t_device_journey_overview`
ADD
INDEX
idx_vd_id
(
`vd_id`
);
ALTER
TABLE
`t_device_journey`
ALTER
TABLE
`t_device_journey`
ADD
INDEX
idx_begin_time
(
`begin_time`
);
ADD
INDEX
idx_begin_time
(
`begin_time`
);
...
@@ -157,9 +136,3 @@ set tefs.vd_id = tvd.id
...
@@ -157,9 +136,3 @@ set tefs.vd_id = tvd.id
where
tvd
.
sn
=
tefs
.
sn
where
tvd
.
sn
=
tefs
.
sn
and
tv
.
id
=
tvd
.
vehicle_id
;
and
tv
.
id
=
tvd
.
vehicle_id
;
-- 里程初始化
INSERT
INTO
t_device_journey_overview
(
sn
,
vd_id
,
total_journey_count
,
distance
,
created_by
,
created_date
,
updated_date
)
select
sn
,
vd_id
,
count
(
1
),
sum
(
mileage
),
created_by
,
created_date
,
updated_date
from
t_device_journey
where
vd_id
is
not
null
group
by
sn
,
vd_id
;
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment