Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
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 0520cfcf
authored
Dec 27, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化首页设备激活趋势展示
1 parent
45608875
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
src/main/resources/mapper/VehicleMapper.xml
src/main/resources/mapper/VehicleMapper.xml
View file @
0520cfc
...
@@ -761,22 +761,30 @@
...
@@ -761,22 +761,30 @@
</select>
</select>
<select
id=
"getActiveDeviceInfoWithAuth"
resultType=
"cn.com.glsx.admin.modules.model.ActiveDeviceVo"
>
<select
id=
"getActiveDeviceInfoWithAuth"
resultType=
"cn.com.glsx.admin.modules.model.ActiveDeviceVo"
>
SELECT count(t
vd
.id) AS activeDeviceNumber,
SELECT count(t
emp
.id) AS activeDeviceNumber,
<choose>
<choose>
<when
test=
"period == 1 || period == 2"
>
<when
test=
"period == 1 || period == 2"
>
DATE_FORMAT(tvd.created_date,'%H') as activeDate
DATE_FORMAT(temp.created_date,'%H') as activeDate
from (
select tvd.id,
tvd.created_date
FROM t_vehicle tv
FROM t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
WHERE tvd.bind_status = 1 and tv.del_flag = 0 and tvd.del_flag = 0
WHERE tvd.bind_status = 1 and tv.del_flag = 0 and tvd.del_flag = 0
${appendSql}
${appendSql}
GROUP BY DATE_FORMAT(tvd.created_date,'%H')
) temp
GROUP BY DATE_FORMAT(temp.created_date,'%H')
</when>
</when>
<otherwise>
<otherwise>
DATE_FORMAT(tvd.created_date,'%Y-%m-%d') as activeDate
DATE_FORMAT(temp.created_date,'%Y-%m-%d') as activeDate
from (
select tvd.id,
tvd.created_date
FROM t_vehicle tv
FROM t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
WHERE tvd.bind_status = 1 and tv.del_flag = 0 and tvd.del_flag = 0
WHERE tvd.bind_status = 1 and tv.del_flag = 0 and tvd.del_flag = 0
${appendSql}
${appendSql}
)temp
GROUP BY DATE_FORMAT(tvd.created_date,'%Y-%m-%d')
GROUP BY DATE_FORMAT(tvd.created_date,'%Y-%m-%d')
</otherwise>
</otherwise>
</choose>
</choose>
...
...
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