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 7cf9d282
authored
Dec 28, 2021
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
3f0005fb
1dc7bdf0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
9 deletions
src/main/java/cn/com/glsx/admin/modules/mapper/VehicleMapper.java
src/main/java/cn/com/glsx/admin/modules/service/OfflineService.java
src/main/resources/mapper/VehicleDeviceMapper.xml
src/main/resources/mapper/VehicleMapper.xml
src/main/java/cn/com/glsx/admin/modules/mapper/VehicleMapper.java
View file @
7cf9d28
...
@@ -111,7 +111,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
...
@@ -111,7 +111,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
*
*
* @return
* @return
*/
*/
@DataPerm
(
showSql
=
true
)
@DataPerm
(
permTable
=
"temp"
,
showSql
=
true
)
Map
<
String
,
Long
>
getVehicleBindNumWithAuth
();
Map
<
String
,
Long
>
getVehicleBindNumWithAuth
();
/**
/**
...
...
src/main/java/cn/com/glsx/admin/modules/service/OfflineService.java
View file @
7cf9d28
...
@@ -5,15 +5,18 @@ import cn.com.glsx.admin.modules.mapper.VehicleMapper;
...
@@ -5,15 +5,18 @@ import cn.com.glsx.admin.modules.mapper.VehicleMapper;
import
cn.com.glsx.admin.modules.model.export.OfflineExport
;
import
cn.com.glsx.admin.modules.model.export.OfflineExport
;
import
cn.com.glsx.admin.modules.model.param.OfflineSearch
;
import
cn.com.glsx.admin.modules.model.param.OfflineSearch
;
import
cn.com.glsx.admin.modules.remote.RemoteGpsBsService
;
import
cn.com.glsx.admin.modules.remote.RemoteGpsBsService
;
import
cn.com.glsx.admin.modules.utils.DateUtil
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsBsData
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsBsData
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsLocation
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsLocation
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.plat.common.utils.StringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -39,6 +42,10 @@ public class OfflineService {
...
@@ -39,6 +42,10 @@ public class OfflineService {
* @return
* @return
*/
*/
public
List
<
OfflineExport
>
findOfflineList
(
OfflineSearch
offlineSearch
)
{
public
List
<
OfflineExport
>
findOfflineList
(
OfflineSearch
offlineSearch
)
{
// 如果没有设置查询开始时间,则默认查询开始时间为从查询开始时间往前推移3天
if
(
StringUtils
.
isNullOrEmpty
(
offlineSearch
.
getOfflineStartTime
()))
{
offlineSearch
.
setOfflineStartTime
(
DateUtil
.
formatDate
(
DateUtils
.
addHours
(
new
Date
(),
-
72
)));
}
String
deviceTypeAndSource
=
offlineSearch
.
getDeviceTypeAndSource
();
String
deviceTypeAndSource
=
offlineSearch
.
getDeviceTypeAndSource
();
if
(
StringUtils
.
isNotEmpty
(
deviceTypeAndSource
))
{
if
(
StringUtils
.
isNotEmpty
(
deviceTypeAndSource
))
{
offlineSearch
.
setDeviceType
(
Integer
.
parseInt
(
deviceTypeAndSource
.
split
(
"-"
)[
0
]));
offlineSearch
.
setDeviceType
(
Integer
.
parseInt
(
deviceTypeAndSource
.
split
(
"-"
)[
0
]));
...
...
src/main/resources/mapper/VehicleDeviceMapper.xml
View file @
7cf9d28
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
</resultMap>
</resultMap>
<resultMap
id=
"activeNumberMap"
type=
"HashMap"
>
<resultMap
id=
"activeNumberMap"
type=
"HashMap"
>
<result
property=
"allActiveNumber"
column=
"allActiveNumber"
/>
<result
property=
"allActiveNumber"
jdbcType=
"INTEGER"
column=
"allActiveNumber"
/>
<result
property=
"activeNumForToday"
column=
"activeNumForToday"
/>
<result
property=
"activeNumForToday"
jdbcType=
"VARCHAR"
column=
"activeNumForToday"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
...
@@ -78,9 +78,8 @@
...
@@ -78,9 +78,8 @@
<select
id=
"getActiveNumberWithAuth"
resultMap=
"activeNumberMap"
>
<select
id=
"getActiveNumberWithAuth"
resultMap=
"activeNumberMap"
>
select count(tvd.id) as allActiveNumber,
select count(tvd.id) as allActiveNumber,
count(case when TO_DAYS(tvd.created_date) = TO_DAYS(NOW()) then 1 end) as activeNumForToday
count(case when TO_DAYS(tvd.created_date) = TO_DAYS(NOW()) then 1 end) as activeNumForToday
from t_vehicle_device tvd
from t_vehicle tv
left join t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
on tv.id = tvd.vehicle_id
where tvd.bind_status = 1
where tvd.bind_status = 1
and tvd.del_flag = 0
and tvd.del_flag = 0
and tv.del_flag = 0;
and tv.del_flag = 0;
...
...
src/main/resources/mapper/VehicleMapper.xml
View file @
7cf9d28
...
@@ -91,8 +91,8 @@
...
@@ -91,8 +91,8 @@
</resultMap>
</resultMap>
<resultMap
id=
"bindNumberMap"
type=
"hashmap"
>
<resultMap
id=
"bindNumberMap"
type=
"hashmap"
>
<result
property=
"allBindNumber"
column=
"allBindNumber"
/>
<result
property=
"allBindNumber"
jdbcType=
"INTEGER"
column=
"allBindNumber"
/>
<result
property=
"bindNumForToday"
column=
"bindNumForToday"
/>
<result
property=
"bindNumForToday"
jdbcType=
"VARCHAR"
column=
"bindNumForToday"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
...
@@ -474,7 +474,8 @@
...
@@ -474,7 +474,8 @@
select count(temp.id) as allBindNumber,
select count(temp.id) as allBindNumber,
count(case when TO_DAYS(temp.created_date) = TO_DAYS(NOW()) then 1 end) as bindNumForToday
count(case when TO_DAYS(temp.created_date) = TO_DAYS(NOW()) then 1 end) as bindNumForToday
from (select tv.id,
from (select tv.id,
max(tvd.created_date) as created_date
max(tvd.created_date) as created_date,
tv.created_by
from t_vehicle tv
from t_vehicle tv
left join t_vehicle_device tvd
left join t_vehicle_device tvd
on tv.id = tvd.vehicle_id
on tv.id = tvd.vehicle_id
...
...
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