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 bd07e249
authored
Apr 27, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
去掉数据同步的sql
1 parent
fcdc5fd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
41 deletions
1.6.0_四月/1.6.0数据库SQL脚本.sql
1.6.0_四月/1.6.0数据库SQL脚本.sql
View file @
bd07e24
...
...
@@ -54,29 +54,7 @@ ALTER TABLE `t_device_journey_overview`
ALTER
TABLE
`t_device_journey_overview`
ADD
INDEX
idx_vd_id
(
`vd_id`
);
-- 设备行程表
create
table
t_device_journey
(
id
int
(
11
)
auto_increment
comment
'里程主键ID'
primary
key
,
sn
varchar
(
32
)
null
comment
'设备序列号'
,
vd_id
int
(
11
)
null
comment
'车辆、设备关系id'
,
begin_time
datetime
null
comment
'里程开始时间'
,
end_time
datetime
null
comment
'里程结束时间'
,
begin_address
varchar
(
64
)
null
comment
'里程开始地址'
,
end_address
varchar
(
64
)
null
comment
'里程结束地址'
,
mileage
int
(
11
)
null
comment
'行驶里程km'
,
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`
ADD
INDEX
idx_sn
(
`sn`
);
ALTER
TABLE
`t_device_journey`
ADD
INDEX
idx_vd_id
(
`vd_id`
);
ALTER
TABLE
`t_device_journey`
ADD
INDEX
idx_begin_time
(
`begin_time`
);
...
...
@@ -163,24 +141,6 @@ CREATE TABLE `t_zhongli_carservice_info` (
)
ENGINE
=
INNODB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'仲利新E盾包活干对应服务商信息'
;
-- 里程初始化
-- 更新vdId
update
t_device_journey
tdj
INNER
JOIN
t_vehicle_device
tvd
on
tvd
.
sn
=
tdj
.
sn
LEFT
JOIN
t_vehicle
tv
on
tv
.
id
=
tvd
.
vehicle_id
SET
tdj
.
vd_id
=
tvd
.
id
,
tdj
.
created_by
=
tv
.
created_by
where
tvd
.
del_flag
=
0
and
tdj
.
begin_time
>=
tv
.
created_date
and
tvd
.
bind_status
=
1
and
tdj
.
id
<
500000
and
tdj
.
id
>=
0
;
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
;
alter
table
t_electric_fence_sns
add
vd_id
int
null
comment
'车辆设备绑定关系'
after
sn
;
alter
table
t_electric_fence_sns_copy
add
vd_id
int
null
comment
'车辆设备绑定关系'
after
sn
;
...
...
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