1.企业端移植门口门禁和人员定位系统
parent
b319779e4e
commit
b7b228f4b6
|
@ -0,0 +1,187 @@
|
||||||
|
package com.zcloud.controller.door;
|
||||||
|
|
||||||
|
import com.zcloud.controller.base.BaseController;
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.service.door.MkmjRelationService;
|
||||||
|
import com.zcloud.util.DateUtil;
|
||||||
|
import com.zcloud.util.Jurisdiction;
|
||||||
|
import com.zcloud.util.Tools;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/mkmjRelation")
|
||||||
|
public class MkmjRelationController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MkmjRelationService mkmjRelationService;
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/add")
|
||||||
|
@RequiresPermissions("mkmjDoor:add")
|
||||||
|
@ResponseBody
|
||||||
|
public Object add() throws Exception{
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
pd.put("CREATOR", Jurisdiction.getUSER_ID()); // 添加人
|
||||||
|
pd.put("CREATTIME", DateUtil.date2Str(new Date())); // 添加时间
|
||||||
|
pd.put("ISDELETE", "0"); //是否删除
|
||||||
|
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||||
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));//修改时间
|
||||||
|
return mkmjRelationService.save(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/delete")
|
||||||
|
@RequiresPermissions("mkmjDoor:del")
|
||||||
|
@ResponseBody
|
||||||
|
public Object delete() throws Exception{
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
return mkmjRelationService.delete(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/edit")
|
||||||
|
@RequiresPermissions("mkmjDoor:edit")
|
||||||
|
@ResponseBody
|
||||||
|
public Object edit() throws Exception{
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||||
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));//修改时间
|
||||||
|
return mkmjRelationService.edit(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/list")
|
||||||
|
@RequiresPermissions("mkmjDoor:list")
|
||||||
|
@ResponseBody
|
||||||
|
public Object list(Page page) throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||||
|
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
|
page.setPd(pd);
|
||||||
|
List<PageData> varList = mkmjRelationService.list(page); //列出Coursectk列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("page", page);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/listAllForArea")
|
||||||
|
@RequiresPermissions("mkmjDoor:list")
|
||||||
|
@ResponseBody
|
||||||
|
public Object listAllForArea() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
List<PageData> varList = mkmjRelationService.listAllForArea(pd); //列出Coursectk列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**去修改页面获取数据
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/goEdit")
|
||||||
|
@RequiresPermissions("mkmjDoor:edit")
|
||||||
|
@ResponseBody
|
||||||
|
public Object goEdit() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
pd = mkmjRelationService.findById(pd); //根据ID读取
|
||||||
|
map.put("pd", pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**去修改页面获取数据
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/findById")
|
||||||
|
@RequiresPermissions("mkmjDoor:edit")
|
||||||
|
@ResponseBody
|
||||||
|
public Object findById() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
pd = mkmjRelationService.findById(pd); //根据ID读取
|
||||||
|
map.put("pd", pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**定位
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/savePosition")
|
||||||
|
@ResponseBody
|
||||||
|
public Object savePosition() throws Exception{
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
return mkmjRelationService.savePosition(pd); //根据ID读取
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/getInfoList")
|
||||||
|
@RequiresPermissions("mkmjDoor:list")
|
||||||
|
@ResponseBody
|
||||||
|
public Object getInfoList(Page page) throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
page.setPd(pd);
|
||||||
|
List<PageData> varList = new ArrayList<>();
|
||||||
|
varList = mkmjRelationService.getCarAndPeopleInfolistPage(page); //列出人闸机信息列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("page", page);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/getAllCarAndPeopleInfoCountByArea")
|
||||||
|
@ResponseBody
|
||||||
|
public Object getAllCarAndPeopleInfoCountByArea() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = this.getPageData();
|
||||||
|
List<PageData> varList = mkmjRelationService.getAllCarAndPeopleInfoCountByArea(pd); //列出人闸机信息列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,207 @@
|
||||||
|
package com.zcloud.controller.door;
|
||||||
|
|
||||||
|
import com.zcloud.controller.base.BaseController;
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.service.door.PlatformDoorVideoService;
|
||||||
|
import com.zcloud.util.Tools;
|
||||||
|
import com.zcloud.util.hk.HKPostApiUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:平台门禁管理
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/platform/door/video")
|
||||||
|
public class PlatformDoorVideoController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private PlatformDoorVideoService platformDoorVideoService;
|
||||||
|
|
||||||
|
private static final String door_host = "192.168.164.50:443";
|
||||||
|
// 秘钥appkey
|
||||||
|
private static final String door_appKey = "24307012";
|
||||||
|
// 秘钥appSecret
|
||||||
|
private static final String door_appSecret = "SLsUPf6WVR4uzu8NPdqq";
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/add")
|
||||||
|
@ResponseBody
|
||||||
|
public Object add() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
pd.put("PLATFORMDOORVIDEO_ID", this.get32UUID()); //主键
|
||||||
|
platformDoorVideoService.save(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/savePosition")
|
||||||
|
@ResponseBody
|
||||||
|
public Object savePosition() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
if(pd.get("PLATFORMDOORVIDEO_ID") != null){
|
||||||
|
platformDoorVideoService.edit(pd);
|
||||||
|
}else{
|
||||||
|
pd.put("PLATFORMDOORVIDEO_ID", this.get32UUID()); //主键
|
||||||
|
platformDoorVideoService.save(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/getHlsPathById")
|
||||||
|
@ResponseBody
|
||||||
|
public Object getHlsPathById() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
PageData pd =this.getPageData();
|
||||||
|
pd = platformDoorVideoService.findById(pd);
|
||||||
|
map = HKPostApiUtil.camerasPreviewURLs(door_host,door_appKey,door_appSecret,pd.getString("INDEXCODE"),"hls");
|
||||||
|
map.put("pd",pd);
|
||||||
|
map.put("result", "success");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/getHlsPath")
|
||||||
|
@ResponseBody
|
||||||
|
public Object getHlsPath() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
PageData pd =this.getPageData();
|
||||||
|
map = HKPostApiUtil.camerasPreviewURLs(door_host,door_appKey,door_appSecret,pd.getString("INDEXCODE"),"hls");
|
||||||
|
map.put("result", "success");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/getRtspPath")
|
||||||
|
@ResponseBody
|
||||||
|
public Object getRtspPath() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
PageData pd =this.getPageData();
|
||||||
|
map = HKPostApiUtil.camerasPreviewURLs(door_host,door_appKey,door_appSecret,pd.getString("INDEXCODE"),"rtsp");
|
||||||
|
map.put("result", "success");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/platformList")
|
||||||
|
@ResponseBody
|
||||||
|
public Object platformList() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
PageData pd =this.getPageData();
|
||||||
|
map = HKPostApiUtil.cameraSearch(door_host,door_appKey,door_appSecret,pd);
|
||||||
|
map.put("result", "success");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/list")
|
||||||
|
@ResponseBody
|
||||||
|
public Object list(Page page) throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||||
|
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
|
page.setPd(pd);
|
||||||
|
List<PageData> varList = platformDoorVideoService.list(page); //列出Platformvideomanagement列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("page", page);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/listByPosition")
|
||||||
|
@ResponseBody
|
||||||
|
public Object listByPosition(Page page) throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
double LONGITUDE = Double.parseDouble(pd.getString("LONGITUDE"));
|
||||||
|
double LATITUDE = Double.parseDouble(pd.getString("LATITUDE"));
|
||||||
|
pd.put("LONGITUDEONE", String.valueOf(LONGITUDE + 0.05));
|
||||||
|
pd.put("LONGITUDETWO", String.valueOf(LONGITUDE - 0.05));
|
||||||
|
pd.put("LATITUDEONE", String.valueOf(LATITUDE + 0.05));
|
||||||
|
pd.put("LATITUDETWO", String.valueOf(LATITUDE - 0.05));
|
||||||
|
page.setPd(pd);
|
||||||
|
List<PageData> varList = platformDoorVideoService.listByPosition(page); //列出Platformvideomanagement列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("page", page);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/listAll")
|
||||||
|
@ResponseBody
|
||||||
|
public Object listAll() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
List<PageData> varList = new ArrayList<>();
|
||||||
|
varList = platformDoorVideoService.listAll(pd); //列出Platformvideomanagement列表
|
||||||
|
for (PageData data : varList) {
|
||||||
|
data.put("MAP_POINT_NAME", data.getString("NAME"));
|
||||||
|
}
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/delLocation")
|
||||||
|
@ResponseBody
|
||||||
|
public Object delLocation() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
platformDoorVideoService.delLocation(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,10 @@ import com.zcloud.controller.map.testDto.TestDto;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.service.bus.CorpInfoService;
|
import com.zcloud.service.bus.CorpInfoService;
|
||||||
|
import com.zcloud.service.door.MkmjDeviceService;
|
||||||
|
import com.zcloud.service.door.MkmjPathService;
|
||||||
|
import com.zcloud.service.door.MkmjRelationService;
|
||||||
|
import com.zcloud.service.door.PlatformDoorVideoService;
|
||||||
import com.zcloud.service.dw.DwService;
|
import com.zcloud.service.dw.DwService;
|
||||||
import com.zcloud.service.dw.dto.*;
|
import com.zcloud.service.dw.dto.*;
|
||||||
import com.zcloud.service.keyProjects.VideoManagerService;
|
import com.zcloud.service.keyProjects.VideoManagerService;
|
||||||
|
@ -30,6 +34,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +86,14 @@ public class MapController extends BaseController {
|
||||||
private WeatherUtil weatherUtil;
|
private WeatherUtil weatherUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private DwService dwService;
|
private DwService dwService;
|
||||||
|
@Autowired
|
||||||
|
private MkmjRelationService mkmjRelationService;
|
||||||
|
@Autowired
|
||||||
|
private MkmjDeviceService mkmjDeviceService;
|
||||||
|
@Autowired
|
||||||
|
private PlatformDoorVideoService platformDoorVideoService;
|
||||||
|
@Autowired
|
||||||
|
private MkmjPathService mkmjPathService;
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/getCorpInfo")
|
@RequestMapping("/getCorpInfo")
|
||||||
public Object getCorpInfo() throws Exception {
|
public Object getCorpInfo() throws Exception {
|
||||||
|
@ -745,11 +757,24 @@ public class MapController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/getGatesInAndOutListById")
|
@RequestMapping("/getGatesInAndOutListById")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ReturnMap getGatesInAndOutListById(Page page) {
|
public ReturnMap getGatesInAndOutListById(Page page) throws Exception {
|
||||||
ReturnMap returnMap = new ReturnMap();
|
ReturnMap returnMap = new ReturnMap();
|
||||||
PageData pd = this.getPageData();
|
PageData pd = this.getPageData();
|
||||||
|
pd.put("DOOR_ID", pd.get("GATE_AREA_ID"));
|
||||||
page.setPd(pd);
|
page.setPd(pd);
|
||||||
List<PageData> recordAllList = gateMachineService.getPersonRecordListAllByEId(page);
|
List<PageData> recordAllList = Collections.emptyList();
|
||||||
|
if (!Tools.isEmpty(pd.getString("CORPINFO_ID"))) { //各公司的二级口门门禁记录
|
||||||
|
page.setCurrentPage(1);
|
||||||
|
page.setShowCount(10);
|
||||||
|
recordAllList = mkmjPathService.getPeopleInfolistPageByMap(page); //列出人闸机信息列表
|
||||||
|
// 车辆进出记录
|
||||||
|
List<PageData> carRecordAllList = mkmjPathService.getCraInfolistPageByMap(page);
|
||||||
|
returnMap.put("carRecordAllList", carRecordAllList);
|
||||||
|
}else{
|
||||||
|
recordAllList = gateMachineService.getPersonRecordListAllByEId(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
returnMap.put("recordAllList", recordAllList);
|
returnMap.put("recordAllList", recordAllList);
|
||||||
return returnMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
@ -1168,4 +1193,65 @@ public class MapController extends BaseController {
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 闸机位置
|
||||||
|
* @Author: dearLin
|
||||||
|
* @Date: 2023/9/23/023 9:04
|
||||||
|
* @Param:
|
||||||
|
* @Return:
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getDoorCount")
|
||||||
|
@ResponseBody
|
||||||
|
public ReturnMap getDoorCount() throws Exception {
|
||||||
|
ReturnMap returnMap = new ReturnMap();
|
||||||
|
PageData data = new PageData();
|
||||||
|
PageData pageData = this.getPageData();
|
||||||
|
//人闸机
|
||||||
|
pageData.put("DEVICE_TYPE", 0);
|
||||||
|
List<PageData> personMachine = mkmjDeviceService.listAll(pageData);
|
||||||
|
data.put("personMachineCount", personMachine.size());
|
||||||
|
//车闸机
|
||||||
|
pageData.put("DEVICE_TYPE", 1);
|
||||||
|
List<PageData> carMachine = mkmjDeviceService.listAll(pageData);
|
||||||
|
data.put("carMachineCount", carMachine.size());
|
||||||
|
//摄像头数
|
||||||
|
List<PageData> camera = platformDoorVideoService.listAll(pageData);
|
||||||
|
data.put("cameraCount", camera.size());
|
||||||
|
returnMap.put("data", data);
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 闸机位置
|
||||||
|
* @Author: dearLin
|
||||||
|
* @Date: 2023/9/23/023 9:04
|
||||||
|
* @Param:
|
||||||
|
* @Return:
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getDoorRecord")
|
||||||
|
@ResponseBody
|
||||||
|
public ReturnMap getDoorRecord() {
|
||||||
|
ReturnMap returnMap = new ReturnMap();
|
||||||
|
PageData pageData = this.getPageData();
|
||||||
|
List<PageData> dataList = new ArrayList<>();
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String fendDate = format.format(new Date());
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0); // 将时设置为0
|
||||||
|
calendar.set(Calendar.MINUTE, 0); // 将分设置为0
|
||||||
|
calendar.set(Calendar.SECOND, 0); // 将秒设置为0
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0); // 将毫秒设置为0
|
||||||
|
Date currDay = calendar.getTime();
|
||||||
|
String fstartDate = format.format(currDay);
|
||||||
|
if (pageData.get("TYPE").equals("0")) {
|
||||||
|
pageData.put("eventTime", fstartDate);
|
||||||
|
dataList = mkmjRelationService.findPersonRecord(pageData);
|
||||||
|
} else {
|
||||||
|
pageData.put("CROSSTIME", fstartDate);
|
||||||
|
dataList = mkmjRelationService.findCarRecord(pageData);
|
||||||
|
}
|
||||||
|
returnMap.put("varList", dataList);
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.zcloud.mapper.dsno2.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface DoorAreaMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
List<PageData> batchDevicelistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
/**.
|
||||||
|
* 校验名称是否重复 修改时传入数据id
|
||||||
|
* @param pageData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageData findByOnly(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> carAndPersonInOutCount(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> getAllByMap(PageData pageData);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
|
||||||
|
package com.zcloud.mapper.dsno2.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface MkmjDeviceMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> listAllForArea(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
/**.
|
||||||
|
* 校验名称是否重复 修改时传入数据id
|
||||||
|
* @param pageData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageData findByOnly(PageData pageData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位
|
||||||
|
* @param pd
|
||||||
|
*/
|
||||||
|
void savePosition(PageData pd);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.zcloud.mapper.dsno2.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁闸机摄像头
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface MkmjDoorVideoMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位
|
||||||
|
* @param pd
|
||||||
|
*/
|
||||||
|
void savePosition(PageData pd);
|
||||||
|
|
||||||
|
/**.
|
||||||
|
* 校验名称是否重复 修改时传入数据id
|
||||||
|
* @param pageData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageData findByOnly(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> getRelevanceDoor(PageData pd);
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.zcloud.mapper.dsno2.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface MkmjPathMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> getPeopleInfolistPage(Page page);
|
||||||
|
|
||||||
|
List<PageData> getCarInfolistPage(Page page);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
/**.
|
||||||
|
* 校验名称是否重复 修改时传入数据id
|
||||||
|
* @param pageData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageData findByOnly(PageData pageData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位
|
||||||
|
* @param pd
|
||||||
|
*/
|
||||||
|
void savePosition(PageData pd);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.zcloud.mapper.dsno2.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface MkmjRelationMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> listAllForArea(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> getAllCarAndPeopleInfoCountByArea(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> getCarAndPeopleInfolistPage(Page page);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
/**.
|
||||||
|
* 校验名称是否重复 修改时传入数据id
|
||||||
|
* @param pageData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageData findByOnly(PageData pageData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位
|
||||||
|
* @param pd
|
||||||
|
*/
|
||||||
|
void savePosition(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> findPersonRecord(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> findCarRecord(PageData pageData);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.zcloud.mapper.dsno2.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:平台视频管理
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2023-07-21
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface PlatformDoorVideoMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listByPositionlistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**通过indexcode获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findByCode(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
/**清空坐标
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delLocation(PageData pd);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.zcloud.service.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface DoorAreaService {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> listForDevice(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> carAndPersonInOutCount(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
List<PageData> getAllByMap(PageData pageData);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.zcloud.service.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface MkmjDeviceService {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> listAllForArea(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位
|
||||||
|
* @param pd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object savePosition(PageData pd);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.zcloud.service.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface MkmjPathService {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> getPeopleInfolistPage(Page page)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> getCarInfolistPage(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位
|
||||||
|
* @param pd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object savePosition(PageData pd);
|
||||||
|
|
||||||
|
|
||||||
|
List<PageData> getPeopleInfolistPageByMap(Page page)throws Exception;
|
||||||
|
|
||||||
|
List<PageData> getCraInfolistPageByMap(Page page)throws Exception;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.zcloud.service.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface MkmjRelationService {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> listAllForArea(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> getAllCarAndPeopleInfoCountByArea(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
public List<PageData> getCarAndPeopleInfolistPage(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位
|
||||||
|
* @param pd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object savePosition(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> findPersonRecord(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> findCarRecord(PageData pageData);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.zcloud.service.door;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:平台视频管理
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2023-07-21
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface PlatformDoorVideoService {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void save(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void edit(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listByPosition(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**通过indexcode获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findByCode(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||||
|
|
||||||
|
/**清空坐标
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delLocation(PageData pd);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,162 @@
|
||||||
|
package com.zcloud.service.door.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.dsno2.door.DoorAreaMapper;
|
||||||
|
import com.zcloud.mapper.dsno2.door.MkmjPathMapper;
|
||||||
|
import com.zcloud.service.door.DoorAreaService;
|
||||||
|
import com.zcloud.util.UuidUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional //开启事物
|
||||||
|
public class DoorAreaServiceImpl implements DoorAreaService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DoorAreaMapper doorAreaMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MkmjPathMapper mkmjAreaGateMapper;
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
//保存校验名称不重复
|
||||||
|
PageData pageData = doorAreaMapper.findByOnly(pd);
|
||||||
|
//查询不到重复数据 开始走业务
|
||||||
|
if(ObjectUtils.isEmpty(pageData)){
|
||||||
|
pd.put("AREA_ID", UuidUtil.get32UUID());
|
||||||
|
}else {
|
||||||
|
map.put("result", "fail");
|
||||||
|
map.put("msg", "名称已存在,请修改后重新提交");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
doorAreaMapper.save(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "保存成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
//校验区域下是否存在口门,存在则不让删除
|
||||||
|
List<PageData> gateList = mkmjAreaGateMapper.listAll(pd);
|
||||||
|
if(gateList.size()>0){
|
||||||
|
map.put("result", "fail");
|
||||||
|
map.put("msg", "当前区域还存在闸机,请删除当前区域的所有闸机后进行删除");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
//两个校验都不存在 则可以删除
|
||||||
|
doorAreaMapper.delete(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "删除成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pageData = doorAreaMapper.findByOnly(pd);
|
||||||
|
//查询不到重复数据 开始走业务
|
||||||
|
if(!ObjectUtils.isEmpty(pageData)){
|
||||||
|
map.put("result", "fail");
|
||||||
|
map.put("msg", "名称已存在,请修改后重新提交");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
doorAreaMapper.edit(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "编辑成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception{
|
||||||
|
return doorAreaMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listForDevice(Page page)throws Exception{
|
||||||
|
return doorAreaMapper.batchDevicelistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception{
|
||||||
|
return doorAreaMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception{
|
||||||
|
return doorAreaMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> carAndPersonInOutCount(PageData pd) throws Exception {
|
||||||
|
return doorAreaMapper.carAndPersonInOutCount(pd);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 方法名称:地图显示本公司的口门信息和坐标信息
|
||||||
|
* 方法描述:
|
||||||
|
* 创建人:guoyuepeng
|
||||||
|
* 时间:2024/9/5 14:46
|
||||||
|
* @param pageData
|
||||||
|
* @return java.util.List<com.zcloud.entity.PageData>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PageData> getAllByMap(PageData pageData) {
|
||||||
|
List<PageData> list = doorAreaMapper.getAllByMap(pageData);
|
||||||
|
List<PageData> valueList = new ArrayList<>();
|
||||||
|
for (PageData pd : list){ //整理成通用List
|
||||||
|
PageData valueMap = new PageData();
|
||||||
|
valueMap.put("GATE_AREA_NAME",pd.getString("DOOR_NAME"));
|
||||||
|
valueMap.put("LATITUDE",pd.getString("LATITUDE"));
|
||||||
|
valueMap.put("LONGITUDE",pd.getString("LONGITUDE"));
|
||||||
|
valueMap.put("GATE_NAME",pd.getString("DOOR_NAME"));
|
||||||
|
valueMap.put("MAP_POINT_NAME",pd.getString("DOOR_NAME"));
|
||||||
|
valueMap.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
|
||||||
|
valueMap.put("id",pd.getString("DOOR_ID"));
|
||||||
|
valueList.add(valueMap);
|
||||||
|
}
|
||||||
|
return valueList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,143 @@
|
||||||
|
|
||||||
|
package com.zcloud.service.door.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.dsno2.door.MkmjDeviceMapper;
|
||||||
|
import com.zcloud.service.door.MkmjDeviceService;
|
||||||
|
import com.zcloud.util.UuidUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional //开启事物
|
||||||
|
public class MkmjDeviceServiceImpl implements MkmjDeviceService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MkmjDeviceMapper mkmjDeviceMapper;
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
//保存校验名称不重复
|
||||||
|
PageData pageData = mkmjDeviceMapper.findByOnly(pd);
|
||||||
|
//查询不到重复数据 开始走业务
|
||||||
|
if(ObjectUtils.isEmpty(pageData)){
|
||||||
|
pd.put("DEVICE_ID", UuidUtil.get32UUID());
|
||||||
|
}else {
|
||||||
|
map.put("result", "fail");
|
||||||
|
map.put("msg", "名称已存在,请修改后重新提交");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
mkmjDeviceMapper.save(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "保存成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjDeviceMapper.delete(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "删除成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pageData = mkmjDeviceMapper.findByOnly(pd);
|
||||||
|
//查询不到重复数据 开始走业务
|
||||||
|
if(!ObjectUtils.isEmpty(pageData)){
|
||||||
|
map.put("result", "fail");
|
||||||
|
map.put("msg", "名称已存在,请修改后重新提交");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
mkmjDeviceMapper.edit(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "编辑成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception{
|
||||||
|
return mkmjDeviceMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception{
|
||||||
|
return mkmjDeviceMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAllForArea(PageData pd)throws Exception{
|
||||||
|
return mkmjDeviceMapper.listAllForArea(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception{
|
||||||
|
return mkmjDeviceMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjDeviceMapper.deleteAll(ArrayDATA_IDS);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "删除成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object savePosition(PageData pd) {
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjDeviceMapper.savePosition(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "定位成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,200 @@
|
||||||
|
package com.zcloud.service.door.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.dsno2.door.MkmjPathMapper;
|
||||||
|
import com.zcloud.service.door.MkmjPathService;
|
||||||
|
import com.zcloud.util.UuidUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional //开启事物
|
||||||
|
public class MkmjPathServiceImpl implements MkmjPathService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MkmjPathMapper mkmjPathMapper;
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
//保存校验名称不重复
|
||||||
|
PageData pageData = mkmjPathMapper.findByOnly(pd);
|
||||||
|
//查询不到重复数据 开始走业务
|
||||||
|
if(ObjectUtils.isEmpty(pageData)){
|
||||||
|
pd.put("PATH_ID", UuidUtil.get32UUID());
|
||||||
|
}else {
|
||||||
|
map.put("result", "fail");
|
||||||
|
map.put("msg", "名称已存在,请修改后重新提交");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
mkmjPathMapper.save(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "保存成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjPathMapper.delete(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "删除成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pageData = mkmjPathMapper.findByOnly(pd);
|
||||||
|
//查询不到重复数据 开始走业务
|
||||||
|
if(!ObjectUtils.isEmpty(pageData)){
|
||||||
|
map.put("result", "fail");
|
||||||
|
map.put("msg", "名称已存在,请修改后重新提交");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
mkmjPathMapper.edit(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "编辑成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception{
|
||||||
|
return mkmjPathMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception{
|
||||||
|
return mkmjPathMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> getPeopleInfolistPage(Page page)throws Exception{
|
||||||
|
return mkmjPathMapper.getPeopleInfolistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> getCarInfolistPage(Page page)throws Exception{
|
||||||
|
return mkmjPathMapper.getCarInfolistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception{
|
||||||
|
return mkmjPathMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjPathMapper.deleteAll(ArrayDATA_IDS);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "删除成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object savePosition(PageData pd) {
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjPathMapper.savePosition(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "定位成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 方法名称:地图的记录查询,主要是地图已经写好插件,准备把二级口门门禁的字段写入原来的系统中
|
||||||
|
* 方法描述:
|
||||||
|
* 创建人:guoyuepeng
|
||||||
|
* 时间:2024/9/5 15:18
|
||||||
|
* @param page
|
||||||
|
* @return java.util.List<com.zcloud.entity.PageData>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PageData> getPeopleInfolistPageByMap(Page page) throws Exception {
|
||||||
|
List<PageData> peopleInfolistPage = mkmjPathMapper.getPeopleInfolistPage(page);
|
||||||
|
List<PageData> valueList = new ArrayList<>();
|
||||||
|
for (PageData pageData : peopleInfolistPage){
|
||||||
|
PageData valueMap = new PageData();
|
||||||
|
valueMap.put("CARDTYPE", pageData.getString("NAME"));
|
||||||
|
valueMap.put("USERNAME", pageData.getString("NAME"));
|
||||||
|
valueMap.put("acc_last_update_date", pageData.getString("TIME"));
|
||||||
|
valueMap.put("TIME", pageData.getString("TIME"));
|
||||||
|
valueMap.put("COMING_REASON", pageData.getString("BAYNAME"));
|
||||||
|
valueMap.put("EQUIPMENTNAME", pageData.getString("BAYNAME"));
|
||||||
|
if("出".equals(pageData.getString("STATUS"))){
|
||||||
|
valueMap.put("STATE", "1");
|
||||||
|
}else{
|
||||||
|
valueMap.put("STATE", "0");
|
||||||
|
}
|
||||||
|
valueList.add(valueMap);
|
||||||
|
}
|
||||||
|
return valueList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> getCraInfolistPageByMap(Page page) throws Exception {
|
||||||
|
|
||||||
|
List<PageData> peopleInfolistPage = mkmjPathMapper.getCarInfolistPage(page);
|
||||||
|
List<PageData> valueList = new ArrayList<>();
|
||||||
|
for (PageData pageData : peopleInfolistPage){
|
||||||
|
PageData valueMap = new PageData();
|
||||||
|
valueMap.put("LICENSE_PLATE", pageData.getString("NAME"));
|
||||||
|
valueMap.put("TIME", pageData.getString("TIME"));
|
||||||
|
valueMap.put("COMING_REASON", pageData.getString("BAYNAME"));
|
||||||
|
if("出".equals(pageData.getString("STATUS"))){
|
||||||
|
valueMap.put("STATE", "1");
|
||||||
|
}else{
|
||||||
|
valueMap.put("STATE", "0");
|
||||||
|
}
|
||||||
|
valueList.add(valueMap);
|
||||||
|
}
|
||||||
|
return valueList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
package com.zcloud.service.door.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.dsno2.door.MkmjRelationMapper;
|
||||||
|
import com.zcloud.service.door.MkmjRelationService;
|
||||||
|
import com.zcloud.util.UuidUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:门口门禁区域闸机
|
||||||
|
* 作者:zhaoyu
|
||||||
|
* 时间:2024-01-16
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional //开启事物
|
||||||
|
public class MkmjRelationServiceImpl implements MkmjRelationService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MkmjRelationMapper mkmjRelationMapper;
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object save(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
pd.put("RELATION_ID", UuidUtil.get32UUID());
|
||||||
|
mkmjRelationMapper.save(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "保存成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object delete(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjRelationMapper.delete(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "删除成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object edit(PageData pd)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjRelationMapper.edit(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "编辑成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception{
|
||||||
|
return mkmjRelationMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception{
|
||||||
|
return mkmjRelationMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAllForArea(PageData pd)throws Exception{
|
||||||
|
return mkmjRelationMapper.listAllForArea(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> getAllCarAndPeopleInfoCountByArea(PageData pd)throws Exception{
|
||||||
|
return mkmjRelationMapper.getAllCarAndPeopleInfoCountByArea(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> getCarAndPeopleInfolistPage(Page page)throws Exception{
|
||||||
|
return mkmjRelationMapper.getCarAndPeopleInfolistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception{
|
||||||
|
return mkmjRelationMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjRelationMapper.deleteAll(ArrayDATA_IDS);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "删除成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object savePosition(PageData pd) {
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
mkmjRelationMapper.savePosition(pd);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
map.put("msg", "定位成功");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public List<PageData> findPersonRecord(PageData pageData){
|
||||||
|
return mkmjRelationMapper.findPersonRecord(pageData);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public List<PageData> findCarRecord(PageData pageData){
|
||||||
|
return mkmjRelationMapper.findCarRecord(pageData);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,100 @@
|
||||||
|
package com.zcloud.service.door.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.dsno2.door.PlatformDoorVideoMapper;
|
||||||
|
import com.zcloud.service.door.PlatformDoorVideoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:平台视频管理
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2023-07-21
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional //开启事物
|
||||||
|
public class PlatformDoorVideoServiceImpl implements PlatformDoorVideoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PlatformDoorVideoMapper platformDoorVideoMapper;
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void save(PageData pd)throws Exception{
|
||||||
|
platformDoorVideoMapper.save(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void delete(PageData pd)throws Exception{
|
||||||
|
platformDoorVideoMapper.delete(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void edit(PageData pd)throws Exception{
|
||||||
|
platformDoorVideoMapper.edit(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception{
|
||||||
|
return platformDoorVideoMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listByPosition(Page page)throws Exception{
|
||||||
|
return platformDoorVideoMapper.listByPositionlistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception{
|
||||||
|
return platformDoorVideoMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception{
|
||||||
|
return platformDoorVideoMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageData findByCode(PageData pd)throws Exception{
|
||||||
|
return platformDoorVideoMapper.findByCode(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||||
|
platformDoorVideoMapper.deleteAll(ArrayDATA_IDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delLocation(PageData pd) {
|
||||||
|
platformDoorVideoMapper.delLocation(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -5,9 +5,12 @@ import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.mapper.datasource.map.GateAreaMapper;
|
import com.zcloud.mapper.datasource.map.GateAreaMapper;
|
||||||
import com.zcloud.mapper.datasource.map.GateMachineMapper;
|
import com.zcloud.mapper.datasource.map.GateMachineMapper;
|
||||||
import com.zcloud.mapper.datasource.map.GateVideoMapper;
|
import com.zcloud.mapper.datasource.map.GateVideoMapper;
|
||||||
|
import com.zcloud.mapper.dsno2.door.MkmjDoorVideoMapper;
|
||||||
|
import com.zcloud.service.door.DoorAreaService;
|
||||||
import com.zcloud.service.keyProjects.VideoManagerService;
|
import com.zcloud.service.keyProjects.VideoManagerService;
|
||||||
import com.zcloud.service.map.GateMachineService;
|
import com.zcloud.service.map.GateMachineService;
|
||||||
import com.zcloud.util.InitPageDataUtil;
|
import com.zcloud.util.InitPageDataUtil;
|
||||||
|
import com.zcloud.util.Tools;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@ -34,8 +37,10 @@ public class GateMachineServiceImpl implements GateMachineService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private InitPageDataUtil initPageDataUtil;
|
private InitPageDataUtil initPageDataUtil;
|
||||||
|
@Resource
|
||||||
|
private MkmjDoorVideoMapper mkmjDoorVideoMapper;
|
||||||
|
@Resource
|
||||||
|
private DoorAreaService doorAreaService;
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<PageData> getDatalistpage(Page page) {
|
public ArrayList<PageData> getDatalistpage(Page page) {
|
||||||
return gateMachineMapper.getDatalistPage(page);
|
return gateMachineMapper.getDatalistPage(page);
|
||||||
|
@ -82,6 +87,8 @@ public class GateMachineServiceImpl implements GateMachineService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PageData> getGatePosition(PageData pageData) {
|
public List<PageData> getGatePosition(PageData pageData) {
|
||||||
|
|
||||||
|
if (pageData.getString("CORPINFO_ID").equals("035958e685cf4850bc40151c5e0617a6")) { //一公司的口门门禁系统
|
||||||
// todo 需求变更,现在闸机变成了区域
|
// todo 需求变更,现在闸机变成了区域
|
||||||
if (pageData.getString("TYPE").equals("PERSON")) {
|
if (pageData.getString("TYPE").equals("PERSON")) {
|
||||||
pageData.put("GATE_AREA_TYPE", 0);
|
pageData.put("GATE_AREA_TYPE", 0);
|
||||||
|
@ -98,6 +105,23 @@ public class GateMachineServiceImpl implements GateMachineService {
|
||||||
}
|
}
|
||||||
|
|
||||||
return gateAreaMapper.getGatePosition(pageData);
|
return gateAreaMapper.getGatePosition(pageData);
|
||||||
|
} else if (!Tools.isEmpty(pageData.getString("CORPINFO_ID"))) { //如果有企业信息,就是要显示二级口门门禁系统信息
|
||||||
|
if (pageData.getString("TYPE").equals("CAMERA")) {
|
||||||
|
return mkmjDoorVideoMapper.listAll(pageData);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pageData.getString("TYPE").equals("PERSON_MACHINE")) {
|
||||||
|
pageData.put("DOOR_TYPE", "0");
|
||||||
|
// 人闸机定位
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pageData.getString("TYPE").equals("CAR_MACHINE")) {
|
||||||
|
// 车闸机定位
|
||||||
|
pageData.put("DOOR_TYPE", 1);
|
||||||
|
}
|
||||||
|
return doorAreaService.getAllByMap(pageData);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,268 @@
|
||||||
|
package com.zcloud.util.hk;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hikvision.artemis.sdk.Client;
|
||||||
|
import com.hikvision.artemis.sdk.Request;
|
||||||
|
import com.hikvision.artemis.sdk.Response;
|
||||||
|
import com.hikvision.artemis.sdk.constant.Constants;
|
||||||
|
import com.hikvision.artemis.sdk.enums.Method;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fangjiakai
|
||||||
|
* @date 2023/09/12 10:16
|
||||||
|
*/
|
||||||
|
public class HKPostApiUtil {
|
||||||
|
/**
|
||||||
|
* 能力开放平台的网站路径
|
||||||
|
* TODO 路径不用修改,就是/artemis
|
||||||
|
*/
|
||||||
|
private static final String ARTEMIS_PATH = "/artemis";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用海康接口
|
||||||
|
* 调用POST请求类型(application/json)接口*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> publicHkInterface(String host, String appKey, String appSecret, JSONObject jsonBody, String url) {
|
||||||
|
final String getCamsApi = ARTEMIS_PATH + url;
|
||||||
|
Map<String, String> path = new HashMap<String, String>(2);
|
||||||
|
path.put("https://", getCamsApi);
|
||||||
|
// post请求application/json类型参数
|
||||||
|
String result = doPostStringArtemis(host, appKey, appSecret, path, jsonBody.toJSONString(), null, null, "application/json", null);
|
||||||
|
JSONObject parseObject = JSONArray.parseObject(result);
|
||||||
|
return parseObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取监控点预览取流URL
|
||||||
|
*
|
||||||
|
* @param id 设备编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> camerasPreviewURLs(String host, String appKey, String appSecret, String id, String type) {
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("cameraIndexCode", id);
|
||||||
|
// jsonBody.put("netZoneCode", "1");
|
||||||
|
jsonBody.put("transmode", 1);
|
||||||
|
jsonBody.put("streamType", 0);
|
||||||
|
jsonBody.put("protocol", type);
|
||||||
|
// jsonBody.put("expireTime", -1);
|
||||||
|
jsonBody.put("expand", "transcode=1&streamform=rtp");
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody, "/api/video/v2/cameras/previewURLs");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有区域数
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> getAllArea(String host, String appKey, String appSecret) {
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("parentIndexCode", "root000000");
|
||||||
|
jsonBody.put("resourceType", "camera");
|
||||||
|
jsonBody.put("pageNo", 1);
|
||||||
|
jsonBody.put("pageSize", 100);
|
||||||
|
jsonBody.put("cascadeFlag", 0);
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody, "/api/resource/v2/regions/subRegions");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取区域内摄像头数
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> getAreaCamera(String host, String appKey, String appSecret, String indexCode) {
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("regionIndexCode", indexCode);
|
||||||
|
jsonBody.put("resourceType", "camera");
|
||||||
|
jsonBody.put("pageNo", 1);
|
||||||
|
jsonBody.put("pageSize", 100);
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody, "/api/irds/v2/resource/subResources");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API名称:
|
||||||
|
* 查询监控点列表v2
|
||||||
|
* 分组:
|
||||||
|
* 视频资源接口
|
||||||
|
* 提供方名称:
|
||||||
|
* 资源目录服务
|
||||||
|
* qps:
|
||||||
|
* 描述:根据条件查询目录下有权限的监控点列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> cameraSearch(String host, String appKey, String appSecret, PageData pd) {
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("pageNo", pd.get("pageNo"));
|
||||||
|
jsonBody.put("pageSize", pd.get("pageSize"));
|
||||||
|
if (pd.get("name") != null && !"".equals(pd.getString("name")))
|
||||||
|
jsonBody.put("name", pd.get("name"));
|
||||||
|
jsonBody.put("orderBy", "name");
|
||||||
|
jsonBody.put("orderType", "desc");
|
||||||
|
jsonBody.put("resourceType", "camera");
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody, "/api/resource/v2/camera/search");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订阅事件
|
||||||
|
*
|
||||||
|
* @param ids 事件编号 131588
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> subscribeEvent(String host, String appKey, String appSecret, String[] ids) {
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("eventTypes", ids);
|
||||||
|
jsonBody.put("eventDest", "1");
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody, "/api/eventService/v1/eventSubscriptionByEventTypes");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API名称:
|
||||||
|
* 闸机信息获取v2
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> getCarDoorList(String host, String appKey, String appSecret, PageData pd) {
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody, "/api/resource/v1/park/parkList");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API名称:
|
||||||
|
* 闸机信息获取v2
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> getCarDoorInfo(String host, String appKey, String appSecret, String parkIndexCodes) {
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("parkIndexCodes", parkIndexCodes);
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody, "/api/resource/v1/entrance/entranceList");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String,Object> getCarPathByDoor(String host, String appKey, String appSecret,String parkIndexCodes){
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("parkIndexCodes",parkIndexCodes);
|
||||||
|
Map<String,Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody,"/api/resource/v1/entrance/entranceList");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String,Object> getCarDevice(String host, String appKey, String appSecret,String entranceIndexCodes){
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("entranceIndexCodes",entranceIndexCodes);
|
||||||
|
Map<String,Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody,"/api/resource/v1/roadway/roadwayList");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API名称:
|
||||||
|
* 查询门禁设备列表v2
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String,Object> acsDeviceSearch(String host, String appKey, String appSecret,PageData pd){
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("pageNo", pd.get("pageNo"));
|
||||||
|
jsonBody.put("pageSize", pd.get("pageSize"));
|
||||||
|
if(pd.get("name")!=null && !"".equals(pd.getString("name")))
|
||||||
|
jsonBody.put("name", pd.get("name"));
|
||||||
|
jsonBody.put("orderBy", "name");
|
||||||
|
jsonBody.put("orderType", "desc");
|
||||||
|
Map<String,Object> returnMap=publicHkInterface(host, appKey, appSecret,jsonBody,"/api/resource/v2/acsDevice/search");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API名称:
|
||||||
|
* 闸机信息获取v2
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String,Object> getGateMachineInfo(String host, String appKey, String appSecret, PageData pd){
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("pageNo", pd.get("pageNo"));
|
||||||
|
jsonBody.put("pageSize", pd.get("pageSize"));
|
||||||
|
Map<String,Object> returnMap = publicHkInterface(host, appKey, appSecret, jsonBody,"/api/resource/v2/door/search");
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
public static String doPostStringArtemis(String host, String appKey, String appSecret, Map<String, String> path, String body, Map<String, String> querys, String accept, String contentType, Map<String, String> header) {
|
||||||
|
String httpSchema = (String) path.keySet().toArray()[0];
|
||||||
|
if (httpSchema != null && !StringUtils.isEmpty(httpSchema)) {
|
||||||
|
String responseStr = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Map<String, String> headers = new HashMap();
|
||||||
|
if (StringUtils.isNotBlank(accept)) {
|
||||||
|
headers.put("Accept", accept);
|
||||||
|
} else {
|
||||||
|
headers.put("Accept", "*/*");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(contentType)) {
|
||||||
|
headers.put("Content-Type", contentType);
|
||||||
|
} else {
|
||||||
|
headers.put("Content-Type", "application/text;charset=UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (header != null) {
|
||||||
|
headers.putAll(header);
|
||||||
|
}
|
||||||
|
|
||||||
|
Request request = new Request(Method.POST_STRING, httpSchema + host, (String) path.get(httpSchema), appKey, appSecret, Constants.DEFAULT_TIMEOUT);
|
||||||
|
request.setHeaders(headers);
|
||||||
|
request.setQuerys(querys);
|
||||||
|
request.setStringBody(body);
|
||||||
|
Response response = Client.execute(request);
|
||||||
|
responseStr = getResponseResult(response);
|
||||||
|
} catch (Exception var11) {
|
||||||
|
var11.printStackTrace();
|
||||||
|
}
|
||||||
|
return responseStr;
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("http和https参数错误httpSchema: " + httpSchema);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getResponseResult(Response response) {
|
||||||
|
String responseStr = null;
|
||||||
|
int statusCode = response.getStatusCode();
|
||||||
|
if (!String.valueOf(statusCode).startsWith("2") && !String.valueOf(statusCode).startsWith("3")) {
|
||||||
|
String msg = response.getErrorMessage();
|
||||||
|
responseStr = response.getBody();
|
||||||
|
System.out.println("the Artemis Request is Failed,statusCode:" + statusCode + " errorMsg:" + msg);
|
||||||
|
} else {
|
||||||
|
responseStr = response.getBody();
|
||||||
|
System.out.println("the Artemis Request is Success,statusCode:" + statusCode + " SuccessMsg:" + response.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
return responseStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String door_host = "192.168.164.50:443";
|
||||||
|
String door_appKey = "24307012";
|
||||||
|
String door_appSecret = "SLsUPf6WVR4uzu8NPdqq";
|
||||||
|
JSONObject jsonBody = new JSONObject();
|
||||||
|
jsonBody.put("pageNo", 1);
|
||||||
|
jsonBody.put("pageSize", 10);
|
||||||
|
// jsonBody.put("orderBy", "name");
|
||||||
|
// jsonBody.put("orderType", "desc");
|
||||||
|
// jsonBody.put("resourceType", "region");
|
||||||
|
// jsonBody.put("parkIndexCodes","34849cb85867447cbd2f0682aac4379a");
|
||||||
|
Map<String, Object> returnMap = publicHkInterface(door_host, door_appKey, door_appSecret, jsonBody, "/api/resource/v2/door/search");
|
||||||
|
System.out.println(returnMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,228 @@
|
||||||
|
<?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.zcloud.mapper.dsno2.door.DoorAreaMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
MKMJ_AREA
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.AREA_ID,
|
||||||
|
f.DEVICE_IDS,
|
||||||
|
f.AREA_NAME,
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.CREATOR,
|
||||||
|
f.CREATTIME,
|
||||||
|
f.OPERATOR,
|
||||||
|
f.OPERATTIME,
|
||||||
|
f.ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
AREA_ID,
|
||||||
|
DEVICE_IDS,
|
||||||
|
AREA_NAME,
|
||||||
|
CORPINFO_ID,
|
||||||
|
CREATOR,
|
||||||
|
CREATTIME,
|
||||||
|
OPERATOR,
|
||||||
|
OPERATTIME,
|
||||||
|
ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{AREA_ID},
|
||||||
|
#{DEVICE_IDS},
|
||||||
|
#{AREA_NAME},
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{CREATOR},
|
||||||
|
#{CREATTIME},
|
||||||
|
#{OPERATOR},
|
||||||
|
#{OPERATTIME},
|
||||||
|
#{ISDELETE}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
AREA_ID = #{AREA_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
AREA_ID=AREA_ID
|
||||||
|
<if test="AREA_NAME != null and AREA_NAME != ''"><!-- 关键词检索 -->
|
||||||
|
,AREA_NAME=#{AREA_NAME}
|
||||||
|
</if>
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
|
||||||
|
,CORPINFO_ID=#{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
<if test="CREATOR != null and CREATOR != ''"><!-- 关键词检索 -->
|
||||||
|
,CREATOR=#{CREATOR}
|
||||||
|
</if>
|
||||||
|
<if test="CREATTIME != null and CREATTIME != ''"><!-- 关键词检索 -->
|
||||||
|
,CREATTIME=#{CREATTIME}
|
||||||
|
</if>
|
||||||
|
<if test="OPERATOR != null and OPERATOR != ''"><!-- 关键词检索 -->
|
||||||
|
,OPERATOR=#{OPERATOR}
|
||||||
|
</if>
|
||||||
|
<if test="OPERATTIME != null and OPERATTIME != ''"><!-- 关键词检索 -->
|
||||||
|
,OPERATTIME=#{OPERATTIME}
|
||||||
|
</if>
|
||||||
|
<if test="ISDELETE != null and ISDELETE != ''"><!-- 关键词检索 -->
|
||||||
|
,ISDELETE=#{ISDELETE}
|
||||||
|
</if>
|
||||||
|
<if test="DEVICE_IDS != null and DEVICE_IDS != ''"><!-- 关键词检索 -->
|
||||||
|
,DEVICE_IDS=#{DEVICE_IDS}
|
||||||
|
</if>
|
||||||
|
where
|
||||||
|
AREA_ID=#{AREA_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.AREA_ID=#{AREA_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>,
|
||||||
|
COUNT( DISTINCT r.RELATION_ID ) DEVICE_COUNT
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
LEFT JOIN mkmj_relation r ON r.AREA_ID = f.AREA_ID AND r.ISDELETE = '0'
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
f.AREA_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
f.AREA_ID
|
||||||
|
ORDER BY
|
||||||
|
f.CREATTIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="batchDevicelistPage" parameterType="page" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
d.*,
|
||||||
|
f.RELATION_ID,
|
||||||
|
f.TYPE,
|
||||||
|
de.DEVICE_NAME DOCK_DEVICE_NAME,
|
||||||
|
de.DOOR_NAME DOCK_DOOR_NAME,
|
||||||
|
de.PATH_NAME DOCK_PATH_NAME
|
||||||
|
FROM
|
||||||
|
mkmj_relation f
|
||||||
|
LEFT JOIN mkmj_device d ON d.DEVICE_ID = f.DEVICE_ID
|
||||||
|
LEFT JOIN mkmj_dock_device de ON de.DOCK_DEVICE_ID = d.DOCK_DEVICE_ID
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.AREA_ID = #{pd.AREA_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
AREA_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 校验名称是否重复 -->
|
||||||
|
<select id="findByOnly" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.AREA_NAME = #{AREA_NAME}
|
||||||
|
<if test="AREA_ID!='' and AREA_ID != null">
|
||||||
|
and f.AREA_ID != #{AREA_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 校验名称是否重复 -->
|
||||||
|
<select id="carAndPersonInOutCount" parameterType="pd" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
f.AREA_ID AREA_ID,
|
||||||
|
f.AREA_NAME AREA_NAME,
|
||||||
|
COUNT( CASE WHEN c.entrystatusStr = '进港' THEN c.car_log_id END ) CARINCOUNT,
|
||||||
|
COUNT( CASE WHEN c.entrystatusStr = '出港' THEN c.car_log_id END ) CAROUTCOUNT,
|
||||||
|
COUNT( CASE WHEN p.entrystatusStr = '进入' THEN p.person_log_id END ) PERSONINCOUNT,
|
||||||
|
COUNT( CASE WHEN p.entrystatusStr = '离开' THEN p.person_log_id END ) PERSONOUTCOUNT
|
||||||
|
FROM
|
||||||
|
mkmj_area f
|
||||||
|
LEFT JOIN mkmj_door d ON FIND_IN_SET(d.DOOR_ID,f.DEVICE_IDS)
|
||||||
|
LEFT JOIN dj_car_log c ON c.accId = d.SOURCE_ID AND DATE(c.chtime) = CURDATE()
|
||||||
|
LEFT JOIN dj_person_log p ON p.accId = d.SOURCE_ID AND DATE(p.chtime) = CURDATE()
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
GROUP BY f.AREA_ID
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 校验名称是否重复 -->
|
||||||
|
<select id="getAllByMap" parameterType="pd" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
f.*
|
||||||
|
FROM
|
||||||
|
mkmj_door f
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
||||||
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
<if test="DOOR_TYPE != null and DOOR_TYPE != ''">
|
||||||
|
and f.DOOR_TYPE = #{DOOR_TYPE}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,217 @@
|
||||||
|
<?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.zcloud.mapper.dsno2.door.MkmjDeviceMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
MKMJ_DEVICE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.DEVICE_ID,
|
||||||
|
f.DOCK_DEVICE_ID,
|
||||||
|
f.DOOR_ID,
|
||||||
|
f.PATH_ID,
|
||||||
|
f.DEVICE_NAME,
|
||||||
|
f.DEVICE_TYPE,
|
||||||
|
f.STATUS,
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.CREATOR,
|
||||||
|
f.CREATTIME,
|
||||||
|
f.OPERATOR,
|
||||||
|
f.OPERATTIME,
|
||||||
|
f.ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
DEVICE_ID,
|
||||||
|
DOCK_DEVICE_ID,
|
||||||
|
DOOR_ID,
|
||||||
|
PATH_ID,
|
||||||
|
DEVICE_NAME,
|
||||||
|
DEVICE_TYPE,
|
||||||
|
STATUS,
|
||||||
|
CORPINFO_ID,
|
||||||
|
CREATOR,
|
||||||
|
CREATTIME,
|
||||||
|
OPERATOR,
|
||||||
|
OPERATTIME,
|
||||||
|
ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{DEVICE_ID},
|
||||||
|
#{DOCK_DEVICE_ID},
|
||||||
|
#{DOOR_ID},
|
||||||
|
#{PATH_ID},
|
||||||
|
#{DEVICE_NAME},
|
||||||
|
#{DEVICE_TYPE},
|
||||||
|
#{STATUS},
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{CREATOR},
|
||||||
|
#{CREATTIME},
|
||||||
|
#{OPERATOR},
|
||||||
|
#{OPERATTIME},
|
||||||
|
#{ISDELETE}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
DEVICE_ID = #{DEVICE_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
DOCK_DEVICE_ID = #{DOCK_DEVICE_ID},
|
||||||
|
DOOR_ID = #{DOOR_ID},
|
||||||
|
PATH_ID = #{PATH_ID},
|
||||||
|
DEVICE_NAME = #{DEVICE_NAME},
|
||||||
|
DEVICE_TYPE = #{DEVICE_TYPE},
|
||||||
|
STATUS = #{STATUS},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
|
CREATOR = #{CREATOR},
|
||||||
|
CREATTIME = #{CREATTIME},
|
||||||
|
OPERATOR = #{OPERATOR},
|
||||||
|
OPERATTIME = #{OPERATTIME},
|
||||||
|
ISDELETE = #{ISDELETE}
|
||||||
|
where
|
||||||
|
DEVICE_ID=#{DEVICE_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>,
|
||||||
|
d.DEVICE_NAME DOCK_DEVICE_NAME,
|
||||||
|
d.DOOR_NAME DOCK_DOOR_NAME,
|
||||||
|
d.PATH_NAME DOCK_PATH_NAME,
|
||||||
|
r.TYPE
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
LEFT JOIN mkmj_dock_device d ON f.DOCK_DEVICE_ID = d.DOCK_DEVICE_ID
|
||||||
|
LEFT JOIN mkmj_relation r ON r.DEVICE_ID = f.DEVICE_ID
|
||||||
|
where
|
||||||
|
f.DEVICE_ID=#{DEVICE_ID}
|
||||||
|
GROUP BY DEVICE_ID
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>,
|
||||||
|
d.DEVICE_NAME DOCK_DEVICE_NAME,
|
||||||
|
d.DOOR_NAME DOCK_DOOR_NAME,
|
||||||
|
d.PATH_NAME DOCK_PATH_NAME,
|
||||||
|
d.DEVICE_TYPE DOCK_DEVICE_TYPE
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
LEFT JOIN mkmj_dock_device d ON f.DOCK_DEVICE_ID = d.DOCK_DEVICE_ID
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
f.DEVICE_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="pd.PATH_ID != null and pd.PATH_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and f.PATH_ID=#{pd.PATH_ID}
|
||||||
|
</if>
|
||||||
|
ORDER BY f.CREATTIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
LEFT JOIN mkmj_dock_device d ON f.DOCK_DEVICE_ID = d.DOCK_DEVICE_ID
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="PATH_ID!='' and PATH_ID != null">
|
||||||
|
and f.PATH_ID = #{PATH_ID}
|
||||||
|
</if>
|
||||||
|
<if test="DEVICE_TYPE!='' and DEVICE_TYPE != null">
|
||||||
|
and d.DEVICE_TYPE = #{DEVICE_TYPE}
|
||||||
|
</if>
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAllForArea" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
DEVICE_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 校验名称是否重复 -->
|
||||||
|
<select id="findByOnly" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.DEVICE_NAME = #{DEVICE_NAME}
|
||||||
|
<if test="DEVICE_ID!='' and DEVICE_ID != null">
|
||||||
|
and f.DEVICE_ID != #{DEVICE_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 定位 -->
|
||||||
|
<update id="savePosition" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
LATITUDE = #{LATITUDE},
|
||||||
|
LONGITUDE = #{LONGITUDE}
|
||||||
|
where
|
||||||
|
DEVICE_ID = #{DEVICE_ID}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,202 @@
|
||||||
|
<?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.zcloud.mapper.dsno2.door.MkmjDoorVideoMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
MKMJ_DOOR_VIDEO
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.DOOR_VIDEO_ID,
|
||||||
|
f.DOOR_ID,
|
||||||
|
f.PLATFORMVIDEOMANAGEMENT_ID,
|
||||||
|
f.LONGITUDE,
|
||||||
|
f.LATITUDE,
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.CREATOR,
|
||||||
|
f.CREATTIME,
|
||||||
|
f.OPERATOR,
|
||||||
|
f.OPERATTIME,
|
||||||
|
f.ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
DOOR_VIDEO_ID,
|
||||||
|
DOOR_ID,
|
||||||
|
PLATFORMVIDEOMANAGEMENT_ID,
|
||||||
|
LONGITUDE,
|
||||||
|
LATITUDE,
|
||||||
|
CORPINFO_ID,
|
||||||
|
CREATOR,
|
||||||
|
CREATTIME,
|
||||||
|
OPERATOR,
|
||||||
|
OPERATTIME,
|
||||||
|
ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{DOOR_VIDEO_ID},
|
||||||
|
#{DOOR_ID},
|
||||||
|
#{PLATFORMVIDEOMANAGEMENT_ID},
|
||||||
|
#{LONGITUDE},
|
||||||
|
#{LATITUDE},
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{CREATOR},
|
||||||
|
#{CREATTIME},
|
||||||
|
#{OPERATOR},
|
||||||
|
#{OPERATTIME},
|
||||||
|
#{ISDELETE}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
DOOR_VIDEO_ID = #{DOOR_VIDEO_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
DOOR_VIDEO_ID= DOOR_VIDEO_ID,
|
||||||
|
DOOR_ID=#{DOOR_ID},
|
||||||
|
PLATFORMVIDEOMANAGEMENT_ID=#{PLATFORMVIDEOMANAGEMENT_ID},
|
||||||
|
LONGITUDE=#{LONGITUDE},
|
||||||
|
LATITUDE=#{LATITUDE},
|
||||||
|
CORPINFO_ID=#{CORPINFO_ID},
|
||||||
|
CREATOR=#{CREATOR},
|
||||||
|
CREATTIME=#{CREATTIME},
|
||||||
|
OPERATOR=#{OPERATOR},
|
||||||
|
OPERATTIME=#{OPERATTIME},
|
||||||
|
ISDELETE=#{ISDELETE}
|
||||||
|
where
|
||||||
|
DOOR_VIDEO_ID=#{DOOR_VIDEO_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.DOOR_VIDEO_ID=#{DOOR_VIDEO_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>,
|
||||||
|
r.NAME,
|
||||||
|
r.INDEXCODE
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
LEFT JOIN bus_platform_door_video r on r.PLATFORMDOORVIDEO_ID = f.PLATFORMVIDEOMANAGEMENT_ID
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
r.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
<!-- 根据需求自己加检索条件
|
||||||
|
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
or
|
||||||
|
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
-->
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="pd.DOOR_ID != null and pd.DOOR_ID != ''">
|
||||||
|
AND f.DOOR_ID = #{pd.DOOR_ID}
|
||||||
|
</if>
|
||||||
|
ORDER BY f.CREATTIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>,
|
||||||
|
r.NAME,
|
||||||
|
r.INDEXCODE,
|
||||||
|
'DOOR_VIDEO' VIDEO_TYPE
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
LEFT JOIN bus_platform_door_video r on r.PLATFORMDOORVIDEO_ID = f.PLATFORMVIDEOMANAGEMENT_ID
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
||||||
|
AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
DOOR_VIDEO_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 定位 -->
|
||||||
|
<update id="savePosition" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
LATITUDE = #{LATITUDE},
|
||||||
|
LONGITUDE = #{LONGITUDE}
|
||||||
|
where
|
||||||
|
DOOR_VIDEO_ID = #{DOOR_VIDEO_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 校验名称是否重复 -->
|
||||||
|
<select id="findByOnly" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.PLATFORMVIDEOMANAGEMENT_ID = #{PLATFORMVIDEOMANAGEMENT_ID}
|
||||||
|
AND f.DOOR_ID = #{DOOR_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="getRelevanceDoor" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
f.DOOR_NAME,
|
||||||
|
f.STATUS,
|
||||||
|
v.DOOR_VIDEO_ID
|
||||||
|
from mkmj_door f
|
||||||
|
left join mkmj_door_video v on v.DOOR_ID = f.DOOR_ID
|
||||||
|
where v.ISDELETE = '0'
|
||||||
|
and v.PLATFORMVIDEOMANAGEMENT_ID = #{VIDEO_ID}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,244 @@
|
||||||
|
<?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.zcloud.mapper.dsno2.door.MkmjPathMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
MKMJ_PATH
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.PATH_ID,
|
||||||
|
f.DOOR_ID,
|
||||||
|
f.PATH_NAME,
|
||||||
|
f.PATH_TYPE,
|
||||||
|
f.STATUS,
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.CREATOR,
|
||||||
|
f.CREATTIME,
|
||||||
|
f.OPERATOR,
|
||||||
|
f.OPERATTIME,
|
||||||
|
f.ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
PATH_ID,
|
||||||
|
DOOR_ID,
|
||||||
|
PATH_NAME,
|
||||||
|
PATH_TYPE,
|
||||||
|
STATUS,
|
||||||
|
CORPINFO_ID,
|
||||||
|
CREATOR,
|
||||||
|
CREATTIME,
|
||||||
|
OPERATOR,
|
||||||
|
OPERATTIME,
|
||||||
|
ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{PATH_ID},
|
||||||
|
#{DOOR_ID},
|
||||||
|
#{PATH_NAME},
|
||||||
|
#{PATH_TYPE},
|
||||||
|
#{STATUS},
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{CREATOR},
|
||||||
|
#{CREATTIME},
|
||||||
|
#{OPERATOR},
|
||||||
|
#{OPERATTIME},
|
||||||
|
#{ISDELETE}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
PATH_ID = #{PATH_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
DOOR_ID = #{DOOR_ID},
|
||||||
|
PATH_NAME = #{PATH_NAME},
|
||||||
|
PATH_TYPE = #{PATH_TYPE},
|
||||||
|
STATUS = #{STATUS},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
|
CREATOR = #{CREATOR},
|
||||||
|
CREATTIME = #{CREATTIME},
|
||||||
|
OPERATOR = #{OPERATOR},
|
||||||
|
OPERATTIME = #{OPERATTIME},
|
||||||
|
ISDELETE = #{ISDELETE}
|
||||||
|
where
|
||||||
|
PATH_ID=#{PATH_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.PATH_ID=#{PATH_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>,
|
||||||
|
COUNT(DISTINCT d.DEVICE_ID) DEVICECOUNT
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
LEFT JOIN mkmj_device d ON d.PATH_ID = f.PATH_ID
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
f.PATH_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="pd.DOOR_ID != null and pd.DOOR_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and f.DOOR_ID = #{pd.DOOR_ID}
|
||||||
|
</if>
|
||||||
|
GROUP BY f.PATH_ID
|
||||||
|
ORDER BY f.CREATTIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
MKMJ_AREA f
|
||||||
|
LEFT JOIN
|
||||||
|
MKMJ_RELATION r ON r.AREA_ID = f.AREA_ID
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0' and r.ISDELETE = '0'
|
||||||
|
<if test="AREA_ID!='' and AREA_ID != null">
|
||||||
|
and f.AREA_ID = #{AREA_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(人闸机记录) -->
|
||||||
|
<select id="getPeopleInfolistPage" parameterType="page" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
p.personName NAME,
|
||||||
|
( CASE WHEN p.devName LIKE CONCAT( CONCAT( '%', '入' ), '%' ) THEN '进' WHEN p.devName LIKE CONCAT( CONCAT( '%', '出' ), '%' ) THEN '出' END ) STATUS,
|
||||||
|
p.eventTime TIME,
|
||||||
|
p.readerDevName BAYNAME,
|
||||||
|
p.devName DOORNAME
|
||||||
|
FROM
|
||||||
|
mkmj_door f
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
GROUP_CONCAT( d.DEVICE_NAME SEPARATOR ',' ) devNames,
|
||||||
|
f.DOOR_ID
|
||||||
|
FROM
|
||||||
|
mkmj_device f
|
||||||
|
LEFT JOIN mkmj_dock_device d ON f.DOCK_DEVICE_ID = d.DOCK_DEVICE_ID
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
GROUP BY
|
||||||
|
f.DOOR_ID) d ON d.DOOR_ID = f.DOOR_ID
|
||||||
|
LEFT JOIN mk_gate_person_machine_info p ON FIND_IN_SET(p.devName,d.devNames)
|
||||||
|
WHERE p.ISDELETE = '0' AND f.DOOR_ID = #{pd.DOOR_ID}
|
||||||
|
GROUP BY p.MACHINE_INFO_ID
|
||||||
|
ORDER BY p.eventTime desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(车闸机记录) -->
|
||||||
|
<select id="getCarInfolistPage" parameterType="page" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
c.PLATENO NAME,
|
||||||
|
( CASE WHEN c.ROADWAYNAME LIKE CONCAT( CONCAT( '%', '入' ), '%' ) THEN '进' WHEN c.ROADWAYNAME LIKE CONCAT( CONCAT( '%', '出' ), '%' ) THEN '出' END ) STATUS,
|
||||||
|
DATE_FORMAT(c.CROSSTIME, '%Y-%m-%d %H:%i:%s') TIME,
|
||||||
|
c.ENTRANCENAME BAYNAME,
|
||||||
|
c.ROADWAYNAME DOORNAME
|
||||||
|
FROM
|
||||||
|
mkmj_door f
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
GROUP_CONCAT( d.DEVICE_NAME SEPARATOR ',' ) devNames,
|
||||||
|
f.DOOR_ID
|
||||||
|
FROM
|
||||||
|
mkmj_device f
|
||||||
|
LEFT JOIN mkmj_dock_device d ON f.DOCK_DEVICE_ID = d.DOCK_DEVICE_ID
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
GROUP BY
|
||||||
|
f.DOOR_ID
|
||||||
|
) d ON d.DOOR_ID = f.DOOR_ID
|
||||||
|
LEFT JOIN mk_gate_car_machine_info c ON FIND_IN_SET( c.ROADWAYNAME, d.devNames )
|
||||||
|
WHERE
|
||||||
|
c.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.DOOR_ID = #{pd.DOOR_ID}
|
||||||
|
GROUP BY
|
||||||
|
c.CAR_MACHINE_INFO_ID
|
||||||
|
ORDER BY
|
||||||
|
TIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
PATH_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 校验名称是否重复 -->
|
||||||
|
<select id="findByOnly" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND f.PATH_NAME = #{PATH_NAME}
|
||||||
|
<if test="PATH_ID!='' and PATH_ID != null">
|
||||||
|
and f.PATH_ID != #{PATH_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 定位 -->
|
||||||
|
<update id="savePosition" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
LATITUDE = #{LATITUDE},
|
||||||
|
LONGITUDE = #{LONGITUDE}
|
||||||
|
where
|
||||||
|
PATH_ID = #{PATH_ID}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,325 @@
|
||||||
|
<?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.zcloud.mapper.dsno2.door.MkmjRelationMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
MKMJ_RELATION
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.RELATION_ID,
|
||||||
|
f.AREA_ID,
|
||||||
|
f.DEVICE_ID,
|
||||||
|
f.TYPE,
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.CREATOR,
|
||||||
|
f.CREATTIME,
|
||||||
|
f.OPERATOR,
|
||||||
|
f.OPERATTIME,
|
||||||
|
f.ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
RELATION_ID,
|
||||||
|
AREA_ID,
|
||||||
|
DEVICE_ID,
|
||||||
|
TYPE,
|
||||||
|
CORPINFO_ID,
|
||||||
|
CREATOR,
|
||||||
|
CREATTIME,
|
||||||
|
OPERATOR,
|
||||||
|
OPERATTIME,
|
||||||
|
ISDELETE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{RELATION_ID},
|
||||||
|
#{AREA_ID},
|
||||||
|
#{DEVICE_ID},
|
||||||
|
#{TYPE},
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{CREATOR},
|
||||||
|
#{CREATTIME},
|
||||||
|
#{OPERATOR},
|
||||||
|
#{OPERATTIME},
|
||||||
|
#{ISDELETE}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
RELATION_ID = #{RELATION_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
RELATION_ID = RELATION_ID,
|
||||||
|
AREA_ID = #{AREA_ID},
|
||||||
|
DEVICE_ID = #{DEVICE_ID},
|
||||||
|
TYPE = #{TYPE},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
|
CREATOR = #{CREATOR},
|
||||||
|
CREATTIME = #{CREATTIME},
|
||||||
|
OPERATOR = #{OPERATOR},
|
||||||
|
OPERATTIME = #{OPERATTIME},
|
||||||
|
ISDELETE = #{ISDELETE}
|
||||||
|
where
|
||||||
|
RELATION_ID=#{RELATION_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.RELATION_ID=#{RELATION_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.AREA_ID != null and pd.AREA_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and f.AREA_ID=#{AREA_ID}
|
||||||
|
</if>
|
||||||
|
ORDER BY f.CREATTIME DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="AREA_ID!='' and AREA_ID != null">
|
||||||
|
and f.AREA_ID = #{AREA_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAllForArea" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="getCarAndPeopleInfolistPage" parameterType="page" resultType="pd">
|
||||||
|
SELECT * FROM (
|
||||||
|
SELECT
|
||||||
|
i.personName NAME,
|
||||||
|
(CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END) STATUS,
|
||||||
|
DATE_FORMAT(i.eventTime,'%Y-%m-%d %H:%i:%s') TIME,
|
||||||
|
i.readerDevName BAYNAME,
|
||||||
|
i.devName DOORNAME,
|
||||||
|
'person' AS TYPE
|
||||||
|
FROM
|
||||||
|
mkmj_area f
|
||||||
|
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID AND d.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID AND de.ISDELETE = '0'
|
||||||
|
LEFT JOIN mk_gate_person_machine_info i ON i.devName = de.DEVICE_NAME AND i.ISDELETE = '0'
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.AREA_ID = #{pd.AREA_ID}
|
||||||
|
AND
|
||||||
|
i.MACHINE_INFO_ID IS NOT NULL
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
i.personName LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
GROUP BY i.MACHINE_INFO_ID UNION ALL
|
||||||
|
SELECT
|
||||||
|
i.PLATENO NAME,
|
||||||
|
(CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END) STATUS,
|
||||||
|
DATE_FORMAT(i.CROSSTIME,'%Y-%m-%d %H:%i:%s') TIME,
|
||||||
|
ENTRANCENAME BAYNAME,
|
||||||
|
ROADWAYNAME DOORNAME,
|
||||||
|
'car' AS TYPE
|
||||||
|
FROM
|
||||||
|
mkmj_area f
|
||||||
|
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID AND d.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID AND de.ISDELETE = '0'
|
||||||
|
LEFT JOIN mk_gate_car_machine_info i ON i.ROADWAYNAME = de.DEVICE_NAME AND i.ISDELETE = '0'
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.AREA_ID = #{pd.AREA_ID}
|
||||||
|
AND
|
||||||
|
i.CAR_MACHINE_INFO_ID IS NOT NULL
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
i.PLATENO LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
GROUP BY i.CAR_MACHINE_INFO_ID
|
||||||
|
) info
|
||||||
|
ORDER BY DATE_FORMAT(TIME,'%Y-%m-%d %H:%i:%s') DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="getAllCarAndPeopleInfoCountByArea" parameterType="pd" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
AREA_ID,
|
||||||
|
AREA_NAME,
|
||||||
|
count( CASE WHEN TYPE = 'person' AND STATUS = '入口' AND NAME IS NOT NULL THEN '1' END ) INPERSONCOUNT,
|
||||||
|
count( CASE WHEN TYPE = 'person' AND STATUS = '出口' AND NAME IS NOT NULL THEN '1' END ) OUTPERSONCOUNT,
|
||||||
|
count( CASE WHEN TYPE = 'car' AND STATUS = '入口' AND NAME IS NOT NULL THEN '1' END ) INCARCOUNT,
|
||||||
|
count( CASE WHEN TYPE = 'car' AND STATUS = '出口' AND NAME IS NOT NULL THEN '1' END ) OUTCARCOUNT,
|
||||||
|
TYPE
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
f.AREA_ID,
|
||||||
|
f.AREA_NAME,
|
||||||
|
i.personName NAME,
|
||||||
|
( CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END ) STATUS,
|
||||||
|
DATE_FORMAT( i.eventTime, '%Y-%m-%d %H:%i:%s' ) TIME,
|
||||||
|
i.readerDevName BAYNAME,
|
||||||
|
i.devName DOORNAME,
|
||||||
|
'person' AS TYPE
|
||||||
|
FROM
|
||||||
|
mkmj_area f
|
||||||
|
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID
|
||||||
|
AND r.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID
|
||||||
|
AND d.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID
|
||||||
|
AND de.ISDELETE = '0'
|
||||||
|
LEFT JOIN mk_gate_person_machine_info i ON i.devName = de.DEVICE_NAME
|
||||||
|
AND i.ISDELETE = '0' AND i.eventTime > DATE_FORMAT( NOW( ), '%Y-%m-%d' )
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.AREA_ID,
|
||||||
|
i.MACHINE_INFO_ID UNION ALL
|
||||||
|
SELECT
|
||||||
|
f.AREA_ID,
|
||||||
|
f.AREA_NAME,
|
||||||
|
i.PLATENO NAME,
|
||||||
|
( CASE WHEN r.TYPE = '0' THEN '入口' ELSE '出口' END ) STATUS,
|
||||||
|
DATE_FORMAT( i.CROSSTIME, '%Y-%m-%d %H:%i:%s' ) TIME,
|
||||||
|
ENTRANCENAME BAYNAME,
|
||||||
|
ROADWAYNAME DOORNAME,
|
||||||
|
'car' AS TYPE
|
||||||
|
FROM
|
||||||
|
mkmj_area f
|
||||||
|
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID
|
||||||
|
AND r.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID
|
||||||
|
AND d.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID
|
||||||
|
AND de.ISDELETE = '0'
|
||||||
|
LEFT JOIN mk_gate_car_machine_info i ON i.ROADWAYNAME = de.DEVICE_NAME
|
||||||
|
AND i.ISDELETE = '0' AND i.CROSSTIME > DATE_FORMAT( NOW( ), '%Y-%m-%d' )
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
GROUP BY
|
||||||
|
f.AREA_ID,
|
||||||
|
i.CAR_MACHINE_INFO_ID
|
||||||
|
) info
|
||||||
|
GROUP BY
|
||||||
|
AREA_ID,
|
||||||
|
TYPE
|
||||||
|
ORDER BY
|
||||||
|
AREA_NAME, TYPE
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
DEVICE_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="findPersonRecord" parameterType="pd" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
i.personName NAME,
|
||||||
|
(CASE WHEN r.TYPE = '0' THEN '入' ELSE '出' END) STATUS,
|
||||||
|
DATE_FORMAT(i.eventTime,'%Y-%m-%d %H:%i:%s') TIME,
|
||||||
|
i.readerDevName BAYNAME,
|
||||||
|
i.devName DOORNAME
|
||||||
|
FROM
|
||||||
|
mkmj_area f
|
||||||
|
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID AND d.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID AND de.ISDELETE = '0'
|
||||||
|
LEFT JOIN mk_gate_person_machine_info i ON i.devName = de.DEVICE_NAME AND i.ISDELETE = '0'
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
AND
|
||||||
|
i.MACHINE_INFO_ID IS NOT NULL
|
||||||
|
ORDER BY DATE_FORMAT(i.eventTime,'%Y-%m-%d %H:%i:%s') DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findCarRecord" parameterType="pd" resultType="pd">
|
||||||
|
SELECT
|
||||||
|
ifnull(i.PLATENO,i.CARDNO) NAME,
|
||||||
|
(CASE WHEN r.TYPE = '0' THEN '入' ELSE '出' END) STATUS,
|
||||||
|
DATE_FORMAT(i.CROSSTIME,'%Y-%m-%d %H:%i:%s') TIME,
|
||||||
|
ENTRANCENAME BAYNAME,
|
||||||
|
ROADWAYNAME DOORNAME
|
||||||
|
FROM
|
||||||
|
mkmj_area f
|
||||||
|
LEFT JOIN mkmj_relation r ON f.AREA_ID = r.AREA_ID AND r.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_device d ON r.DEVICE_ID = d.DEVICE_ID AND d.ISDELETE = '0'
|
||||||
|
LEFT JOIN mkmj_dock_device de ON d.DOCK_DEVICE_ID = de.DOCK_DEVICE_ID AND de.ISDELETE = '0'
|
||||||
|
LEFT JOIN mk_gate_car_machine_info i ON i.ROADWAYNAME = de.DEVICE_NAME AND i.ISDELETE = '0'
|
||||||
|
WHERE
|
||||||
|
f.ISDELETE = '0'
|
||||||
|
AND
|
||||||
|
f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
ORDER BY DATE_FORMAT(TIME,'%Y-%m-%d %H:%i:%s') DESC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,236 @@
|
||||||
|
<?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.zcloud.mapper.dsno2.door.PlatformDoorVideoMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
BUS_PLATFORM_DOOR_VIDEO
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.CORPINFO_ID,
|
||||||
|
f.INDEXCODE,
|
||||||
|
f.REGIONINDEXCODE,
|
||||||
|
f.EXTERNALINDEXCODE,
|
||||||
|
f.NAME,
|
||||||
|
f.LONGITUDE,
|
||||||
|
f.LATITUDE,
|
||||||
|
f.CAMERATYPE,
|
||||||
|
f.CASCADECODE,
|
||||||
|
f.DECODETAG,
|
||||||
|
f.RESOURCETYPE,
|
||||||
|
f.CREATETIME,
|
||||||
|
f.UPDATETIME,
|
||||||
|
f.SORT,
|
||||||
|
f.DISORDER,
|
||||||
|
f.RECORDLOCATION,
|
||||||
|
f.CASCADETYPE,
|
||||||
|
f.REGIONNAME,
|
||||||
|
f.REGIONPATH,
|
||||||
|
f.REGIONPATHNAME,
|
||||||
|
f.PLATFORMDOORVIDEO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
CORPINFO_ID,
|
||||||
|
INDEXCODE,
|
||||||
|
REGIONINDEXCODE,
|
||||||
|
EXTERNALINDEXCODE,
|
||||||
|
NAME,
|
||||||
|
LONGITUDE,
|
||||||
|
LATITUDE,
|
||||||
|
CAMERATYPE,
|
||||||
|
CASCADECODE,
|
||||||
|
DECODETAG,
|
||||||
|
RESOURCETYPE,
|
||||||
|
CREATETIME,
|
||||||
|
UPDATETIME,
|
||||||
|
SORT,
|
||||||
|
DISORDER,
|
||||||
|
RECORDLOCATION,
|
||||||
|
CASCADETYPE,
|
||||||
|
REGIONNAME,
|
||||||
|
REGIONPATH,
|
||||||
|
REGIONPATHNAME,
|
||||||
|
PLATFORMDOORVIDEO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{CORPINFO_ID},
|
||||||
|
#{INDEXCODE},
|
||||||
|
#{REGIONINDEXCODE},
|
||||||
|
#{EXTERNALINDEXCODE},
|
||||||
|
#{NAME},
|
||||||
|
#{LONGITUDE},
|
||||||
|
#{LATITUDE},
|
||||||
|
#{CAMERATYPE},
|
||||||
|
#{CASCADECODE},
|
||||||
|
#{DECODETAG},
|
||||||
|
#{RESOURCETYPE},
|
||||||
|
#{CREATETIME},
|
||||||
|
#{UPDATETIME},
|
||||||
|
#{SORT},
|
||||||
|
#{DISORDER},
|
||||||
|
#{RECORDLOCATION},
|
||||||
|
#{CASCADETYPE},
|
||||||
|
#{REGIONNAME},
|
||||||
|
#{REGIONPATH},
|
||||||
|
#{REGIONPATHNAME},
|
||||||
|
#{PLATFORMDOORVIDEO_ID}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
PLATFORMDOORVIDEO_ID = #{PLATFORMDOORVIDEO_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
|
INDEXCODE = #{INDEXCODE},
|
||||||
|
REGIONINDEXCODE = #{REGIONINDEXCODE},
|
||||||
|
EXTERNALINDEXCODE = #{EXTERNALINDEXCODE},
|
||||||
|
NAME = #{NAME},
|
||||||
|
LONGITUDE = #{LONGITUDE},
|
||||||
|
LATITUDE = #{LATITUDE},
|
||||||
|
CAMERATYPE = #{CAMERATYPE},
|
||||||
|
CASCADECODE = #{CASCADECODE},
|
||||||
|
DECODETAG = #{DECODETAG},
|
||||||
|
RESOURCETYPE = #{RESOURCETYPE},
|
||||||
|
CREATETIME = #{CREATETIME},
|
||||||
|
UPDATETIME = #{UPDATETIME},
|
||||||
|
SORT = #{SORT},
|
||||||
|
DISORDER = #{DISORDER},
|
||||||
|
RECORDLOCATION = #{RECORDLOCATION},
|
||||||
|
CASCADETYPE = #{CASCADETYPE},
|
||||||
|
REGIONNAME = #{REGIONNAME},
|
||||||
|
REGIONPATH = #{REGIONPATH},
|
||||||
|
REGIONPATHNAME = #{REGIONPATHNAME},
|
||||||
|
PLATFORMDOORVIDEO_ID = PLATFORMDOORVIDEO_ID
|
||||||
|
where
|
||||||
|
PLATFORMDOORVIDEO_ID = #{PLATFORMDOORVIDEO_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.PLATFORMDOORVIDEO_ID = #{PLATFORMDOORVIDEO_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findByCode" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.INDEXCODE = #{INDEXCODE}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where 1=1
|
||||||
|
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="listByPositionlistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where 1=1
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="pd.LONGITUDE != null and pd.LONGITUDE != ''"><!-- 关键词检索 -->
|
||||||
|
and CONVERT(#{pd.LONGITUDEONE}, DECIMAL ( 9, 5 )) > CONVERT(f.LONGITUDE, DECIMAL ( 9, 5 ))
|
||||||
|
and CONVERT(f.LONGITUDE, DECIMAL ( 9, 5 )) > CONVERT(#{pd.LONGITUDETWO}, DECIMAL ( 9, 5 ))
|
||||||
|
and CONVERT(#{pd.LATITUDEONE}, DECIMAL ( 9, 5 )) > CONVERT(f.LATITUDE, DECIMAL ( 9, 5 ))
|
||||||
|
and CONVERT(f.LATITUDE, DECIMAL ( 9, 5 )) > CONVERT(#{pd.LATITUDETWO}, DECIMAL ( 9, 5 ))
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>,PLATFORMDOORVIDEO_ID as id
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where 1=1
|
||||||
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
PLATFORMDOORVIDEO_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 清空坐标 -->
|
||||||
|
<update id="delLocation" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
LONGITUDE = null,
|
||||||
|
LATITUDE = null,
|
||||||
|
CORPINFO_ID = null
|
||||||
|
where
|
||||||
|
PLATFORMDOORVIDEO_ID = #{PLATFORMDOORVIDEO_ID}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue