提交电子围栏
parent
7e40d6fe51
commit
055f254699
@ -0,0 +1,41 @@
|
|||||||
|
package com.nmgs.controller;
|
||||||
|
|
||||||
|
import com.nmgs.entity.zdyh.FenceInfo;
|
||||||
|
import com.nmgs.service.FenceInfoService;
|
||||||
|
import com.nmgs.service.ZdyhFatigueVehicleService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("ZDYHFenceInfo")
|
||||||
|
public class ZDYHFenceInfoController {
|
||||||
|
|
||||||
|
public FenceInfoService fenceInfoService;
|
||||||
|
@Autowired
|
||||||
|
public void setZdyhFatigueVehicleService(FenceInfoService fenceInfoService) {
|
||||||
|
this.fenceInfoService = fenceInfoService;
|
||||||
|
}
|
||||||
|
@PostMapping(value = "/getTotalList")
|
||||||
|
public Object getTotalList(@RequestBody Map<String,Object> req){
|
||||||
|
return fenceInfoService.getTotalList(req);
|
||||||
|
}
|
||||||
|
@PostMapping(value = "/getList")
|
||||||
|
public Object getList(@RequestBody Map<String,Object> req){
|
||||||
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
List<FenceInfo> list = fenceInfoService.getList(req);
|
||||||
|
resultMap.put("datalist",list);
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
@PostMapping(value = "/getTotal")
|
||||||
|
public Object getTotal(@RequestBody Map<String,Object> req){
|
||||||
|
List<FenceInfo> list = fenceInfoService.getTotal(req);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nmgs.mapper.zdyh.FenceInfoMapper">
|
||||||
|
|
||||||
|
<select id="getTotalList" parameterType="java.util.Map" resultType="com.nmgs.entity.zdyh.FenceInfo">
|
||||||
|
<bind name="equipmentname" value="'%' + params.equipmentname + '%'" />
|
||||||
|
SELECT
|
||||||
|
t.equipmentid,
|
||||||
|
max(t.equipmentname) as equipmentname,
|
||||||
|
sum(t.monitormileage) as monitormileage
|
||||||
|
FROM
|
||||||
|
zdyh_fence_info t
|
||||||
|
<where>
|
||||||
|
<if test="params.equipmentname!= null and params.equipmentname!= ''">
|
||||||
|
AND t.equipmentname like #{equipmentname}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group by t.equipmentid
|
||||||
|
</select>
|
||||||
|
<select id="getTotal" parameterType="java.util.Map" resultType="com.nmgs.entity.zdyh.FenceInfo">
|
||||||
|
SELECT
|
||||||
|
count(1) as totalCount,
|
||||||
|
sum(t.monitormileage) as monitormileage
|
||||||
|
FROM
|
||||||
|
zdyh_fence_info t
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getList" parameterType="java.util.Map" resultType="com.nmgs.entity.zdyh.FenceInfo">
|
||||||
|
SELECT
|
||||||
|
t.fenceid,
|
||||||
|
t.equipmentid,
|
||||||
|
t.equipmentname,
|
||||||
|
t.departmentno,
|
||||||
|
t.departmentname,
|
||||||
|
t.pilenumber,
|
||||||
|
t.lng,
|
||||||
|
t.lat,
|
||||||
|
t.highwayspeedlimit,
|
||||||
|
t.lowspeedlimit,
|
||||||
|
t.ispark,
|
||||||
|
t.monitormileage,
|
||||||
|
t.beginLeftLat,
|
||||||
|
t.beginLeftLng,
|
||||||
|
t.beginRightLat,
|
||||||
|
t.beginRightLng,
|
||||||
|
t.endLeftLat,
|
||||||
|
t.endLeftLng,
|
||||||
|
t.endRightLat,
|
||||||
|
t.endRightLon,
|
||||||
|
t.updatetime
|
||||||
|
FROM
|
||||||
|
zdyh_fence_info t
|
||||||
|
<where>
|
||||||
|
<if test="params.fenceid!= null and params.fenceid!= ''">
|
||||||
|
AND t.fenceid=#{params.fenceid}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by t.fenceid desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.nmgs.service;
|
||||||
|
|
||||||
|
import com.nmgs.entity.zdyh.FenceInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface FenceInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备编号分组查询汇总
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<FenceInfo> getTotalList(Map<String,Object> params);
|
||||||
|
/**
|
||||||
|
* 查询电子围栏总数以及总公里数
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<FenceInfo> getTotal(Map<String,Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<FenceInfo> getList(Map<String,Object> params);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.nmgs.service.impl;
|
||||||
|
|
||||||
|
import com.nmgs.entity.zdyh.FenceInfo;
|
||||||
|
import com.nmgs.mapper.zdyh.FenceInfoMapper;
|
||||||
|
import com.nmgs.service.FenceInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
@Service
|
||||||
|
public class FenceInfoServiceImpl implements FenceInfoService {
|
||||||
|
public FenceInfoMapper fenceInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
public void setFenceInfoMapper(FenceInfoMapper fenceInfoMapper) {
|
||||||
|
this.fenceInfoMapper = fenceInfoMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FenceInfo> getTotalList(Map<String, Object> params) {
|
||||||
|
return fenceInfoMapper.getTotalList(params);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public List<FenceInfo> getTotal(Map<String, Object> params) {
|
||||||
|
return fenceInfoMapper.getTotal(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FenceInfo> getList(Map<String, Object> params) {
|
||||||
|
return fenceInfoMapper.getList(params);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue