Commit 7cf9d282 by levphon

Merge remote-tracking branch 'origin/master'

2 parents 3f0005fb 1dc7bdf0
......@@ -111,7 +111,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
*
* @return
*/
@DataPerm(showSql = true)
@DataPerm(permTable = "temp", showSql = true)
Map<String, Long> getVehicleBindNumWithAuth();
/**
......
......@@ -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.param.OfflineSearch;
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.GpsLocation;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.glsx.plat.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
......@@ -39,6 +42,10 @@ public class OfflineService {
* @return
*/
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();
if (StringUtils.isNotEmpty(deviceTypeAndSource)) {
offlineSearch.setDeviceType(Integer.parseInt(deviceTypeAndSource.split("-")[0]));
......
......@@ -19,8 +19,8 @@
</resultMap>
<resultMap id="activeNumberMap" type="HashMap">
<result property="allActiveNumber" column="allActiveNumber"/>
<result property="activeNumForToday" column="activeNumForToday"/>
<result property="allActiveNumber" jdbcType="INTEGER" column="allActiveNumber"/>
<result property="activeNumForToday" jdbcType="VARCHAR" column="activeNumForToday"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -78,9 +78,8 @@
<select id="getActiveNumberWithAuth" resultMap="activeNumberMap">
select count(tvd.id) as allActiveNumber,
count(case when TO_DAYS(tvd.created_date) = TO_DAYS(NOW()) then 1 end) as activeNumForToday
from t_vehicle_device tvd
left join t_vehicle tv
on tv.id = tvd.vehicle_id
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
where tvd.bind_status = 1
and tvd.del_flag = 0
and tv.del_flag = 0;
......
......@@ -91,8 +91,8 @@
</resultMap>
<resultMap id="bindNumberMap" type="hashmap">
<result property="allBindNumber" column="allBindNumber"/>
<result property="bindNumForToday" column="bindNumForToday"/>
<result property="allBindNumber" jdbcType="INTEGER" column="allBindNumber"/>
<result property="bindNumForToday" jdbcType="VARCHAR" column="bindNumForToday"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -474,7 +474,8 @@
select count(temp.id) as allBindNumber,
count(case when TO_DAYS(temp.created_date) = TO_DAYS(NOW()) then 1 end) as bindNumForToday
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
left join t_vehicle_device tvd
on tv.id = tvd.vehicle_id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!