From 7786c1a71400a8e1635d2d6c94161a0474c4bb67 Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期六, 28 十月 2023 09:06:49 +0800 Subject: [PATCH] 手动引导增加禁引可视域判断 --- ard-work/src/main/java/com/ruoyi/device/noguidezone/domain/ArdCameraNoGuideZone.java | 125 ++++++++++++ ard-work/src/main/java/com/ruoyi/device/noguidezone/service/IArdCameraNoGuideZoneService.java | 61 ++++++ ard-work/src/main/java/com/ruoyi/device/noguidezone/mapper/ArdCameraNoGuideZoneMapper.java | 61 ++++++ ard-work/src/main/java/com/ruoyi/device/noguidezone/controller/ArdCameraNoGuideZoneController.java | 113 +++++++++++ ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java | 38 +++ ard-work/src/main/java/com/ruoyi/device/noguidezone/service/impl/ArdCameraNoGuideZoneServiceImpl.java | 98 +++++++++ ard-work/src/main/resources/mapper/device/ArdCameraNoGuideZoneMapper.xml | 99 +++++++++ 7 files changed, 594 insertions(+), 1 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java b/ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java index b19b27c..e3904b4 100644 --- a/ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java +++ b/ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java @@ -11,11 +11,18 @@ import com.ruoyi.device.camera.domain.CameraCmd; import com.ruoyi.device.camera.service.IArdCamerasService; import com.ruoyi.device.camera.service.ICameraSdkService; +import com.ruoyi.device.noguidezone.domain.ArdCameraNoGuideZone; +import com.ruoyi.device.noguidezone.service.IArdCameraNoGuideZoneService; +import com.ruoyi.utils.gis.GisUtil; +import com.ruoyi.utils.gis.Point; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; + import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -36,7 +43,8 @@ private ICameraSdkService cameraSdkService; @Resource private IArdCamerasService ardCamerasService; - + @Autowired + private IArdCameraNoGuideZoneService ardCameraNoGuideZoneService; @RequestMapping("/preview") private String preview() { @@ -137,6 +145,7 @@ Map<String, Object> ptzMap = cameraSdkService.getPtz(cmd); return AjaxResult.success("鑾峰彇ptz", ptzMap); } + @ApiOperation("鑾峰彇PTZ鑼冨洿") @PostMapping("/getPTZScope") @Log(title = "鑾峰彇PTZ鑼冨洿", businessType = BusinessType.CONTROL) @@ -165,6 +174,33 @@ public @ResponseBody AjaxResult setTargetPosition(@RequestBody CameraCmd cmd) { cmd.setOperator(SecurityUtils.getUserId()); + //鎷︽埅鎵嬪姩寮曞 + ArdCameraNoGuideZone ardCameraNoGuideZone = new ArdCameraNoGuideZone(); + ardCameraNoGuideZone.setCameraId(cmd.getCameraId()); + //鑾峰彇褰撳墠鐩告満鐨勭寮曞彲瑙嗗煙鍒楄〃 + List<ArdCameraNoGuideZone> ardCameraNoGuideZones = ardCameraNoGuideZoneService.selectArdCameraNoGuideZoneList(ardCameraNoGuideZone); + if (ardCameraNoGuideZones.size() > 0) { + //鑾峰彇鍒板綋鍓嶇浉鏈虹殑鍧愭爣闆嗗悎 + List<Point> pointList = new ArrayList<>(); + for(ArdCameraNoGuideZone zone:ardCameraNoGuideZones) { + String[] parts = zone.getPoi().split(","); + for (int i = 0; i < parts.length; i += 3) { + Point point = new Point(); + point.setLongitude(Double.valueOf(parts[i])); + point.setLatitude(Double.valueOf(parts[i + 1])); + pointList.add(point); + } + } + double lon = cmd.getTargetPosition()[0]; + double lat = cmd.getTargetPosition()[1]; + Point targetPoint = new Point(lon, lat); + //鍒ゆ柇寮曞鐩爣鏄惁鍦ㄥ潗鏍囬泦鍚堢粍鎴愮殑澶氳竟褰㈠唴 + boolean inPolygon = GisUtil.isInPolygon(targetPoint, pointList); + if(inPolygon) + { + return AjaxResult.error("寮曞鍧愭爣浣嶄簬绂佸紩鍙鍩熷唴"); + } + } return toAjax(cameraSdkService.guideTargetPosition(cmd)); } diff --git a/ard-work/src/main/java/com/ruoyi/device/noguidezone/controller/ArdCameraNoGuideZoneController.java b/ard-work/src/main/java/com/ruoyi/device/noguidezone/controller/ArdCameraNoGuideZoneController.java new file mode 100644 index 0000000..d19e78d --- /dev/null +++ b/ard-work/src/main/java/com/ruoyi/device/noguidezone/controller/ArdCameraNoGuideZoneController.java @@ -0,0 +1,113 @@ +package com.ruoyi.device.noguidezone.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.device.noguidezone.domain.ArdCameraNoGuideZone; +import com.ruoyi.device.noguidezone.service.IArdCameraNoGuideZoneService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 绂佸紩鍙鍩烠ontroller + * + * @author ard + * @date 2023-10-27 + */ +@Api(tags = "绂佸紩鍙鍩熺鐞嗘帴鍙�") +@RestController +@RequestMapping("/device/noguidezone") +public class ArdCameraNoGuideZoneController extends BaseController +{ + @Autowired + private IArdCameraNoGuideZoneService ardCameraNoGuideZoneService; + + /** + * 鏌ヨ绂佸紩鍙鍩熷垪琛� + */ + @ApiOperation("鏌ヨ绂佸紩鍙鍩熷垪琛�") + @PreAuthorize("@ss.hasPermi('device:noguidezone:list')") + @GetMapping("/list") + public TableDataInfo list(ArdCameraNoGuideZone ardCameraNoGuideZone) + { + startPage(); + List<ArdCameraNoGuideZone> list = ardCameraNoGuideZoneService.selectArdCameraNoGuideZoneList(ardCameraNoGuideZone); + return getDataTable(list); + } + + /** + * 瀵煎嚭绂佸紩鍙鍩熷垪琛� + */ + @PreAuthorize("@ss.hasPermi('device:noguidezone:export')") + @Log(title = "绂佸紩鍙鍩�", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ArdCameraNoGuideZone ardCameraNoGuideZone) + { + List<ArdCameraNoGuideZone> list = ardCameraNoGuideZoneService.selectArdCameraNoGuideZoneList(ardCameraNoGuideZone); + ExcelUtil<ArdCameraNoGuideZone> util = new ExcelUtil<ArdCameraNoGuideZone>(ArdCameraNoGuideZone.class); + util.exportExcel(response, list, "绂佸紩鍙鍩熸暟鎹�"); + } + + /** + * 鑾峰彇绂佸紩鍙鍩熻缁嗕俊鎭� + */ + @ApiOperation("鑾峰彇绂佸紩鍙鍩熻缁嗕俊鎭�") + @PreAuthorize("@ss.hasPermi('device:noguidezone:query')") + @GetMapping(value = "/{name}") + public AjaxResult getInfo(@PathVariable("name") String name) + { + return success(ardCameraNoGuideZoneService.selectArdCameraNoGuideZoneByName(name)); + } + + /** + * 鏂板绂佸紩鍙鍩� + */ + @ApiOperation("鏂板绂佸紩鍙鍩�") + @PreAuthorize("@ss.hasPermi('device:noguidezone:add')") + @Log(title = "绂佸紩鍙鍩�", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ArdCameraNoGuideZone ardCameraNoGuideZone) + { + return toAjax(ardCameraNoGuideZoneService.insertArdCameraNoGuideZone(ardCameraNoGuideZone)); + } + + /** + * 淇敼绂佸紩鍙鍩� + */ + @ApiOperation("淇敼绂佸紩鍙鍩�") + @PreAuthorize("@ss.hasPermi('device:noguidezone:edit')") + @Log(title = "绂佸紩鍙鍩�", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ArdCameraNoGuideZone ardCameraNoGuideZone) + { + return toAjax(ardCameraNoGuideZoneService.updateArdCameraNoGuideZone(ardCameraNoGuideZone)); + } + + /** + * 鍒犻櫎绂佸紩鍙鍩� + */ + @ApiOperation("鍒犻櫎绂佸紩鍙鍩�") + @PreAuthorize("@ss.hasPermi('device:noguidezone:remove')") + @Log(title = "绂佸紩鍙鍩�", businessType = BusinessType.DELETE) + @DeleteMapping("/{names}") + public AjaxResult remove(@PathVariable String[] names) + { + return toAjax(ardCameraNoGuideZoneService.deleteArdCameraNoGuideZoneByNames(names)); + } +} diff --git a/ard-work/src/main/java/com/ruoyi/device/noguidezone/domain/ArdCameraNoGuideZone.java b/ard-work/src/main/java/com/ruoyi/device/noguidezone/domain/ArdCameraNoGuideZone.java new file mode 100644 index 0000000..1c85b51 --- /dev/null +++ b/ard-work/src/main/java/com/ruoyi/device/noguidezone/domain/ArdCameraNoGuideZone.java @@ -0,0 +1,125 @@ +package com.ruoyi.device.noguidezone.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 绂佸紩鍙鍩熷璞� ard_camera_no_guide_zone + * + * @author ard + * @date 2023-10-27 + */ +public class ArdCameraNoGuideZone extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 鍚嶇О */ + @Excel(name = "鍚嶇О") + private String name; + + /** 鑼冨洿 */ + @Excel(name = "鑼冨洿") + private String poi; + + /** 鐩告満ID */ + @Excel(name = "鐩告満ID") + private String cameraId; + + /** 鏄惁鍚敤 */ + @Excel(name = "鏄惁鍚敤") + private String enabled; + + /** 閮ㄩ棬ID */ + @Excel(name = "閮ㄩ棬ID") + private Long deptId; + + /** 鐢ㄦ埛ID */ + @Excel(name = "鐢ㄦ埛ID") + private String userId; + + /** id */ + private String id; + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setPoi(String poi) + { + this.poi = poi; + } + + public String getPoi() + { + return poi; + } + public void setCameraId(String cameraId) + { + this.cameraId = cameraId; + } + + public String getCameraId() + { + return cameraId; + } + public void setEnabled(String enabled) + { + this.enabled = enabled; + } + + public String getEnabled() + { + return enabled; + } + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + public void setUserId(String userId) + { + this.userId = userId; + } + + public String getUserId() + { + return userId; + } + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("name", getName()) + .append("poi", getPoi()) + .append("cameraId", getCameraId()) + .append("enabled", getEnabled()) + .append("deptId", getDeptId()) + .append("userId", getUserId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("id", getId()) + .toString(); + } +} diff --git a/ard-work/src/main/java/com/ruoyi/device/noguidezone/mapper/ArdCameraNoGuideZoneMapper.java b/ard-work/src/main/java/com/ruoyi/device/noguidezone/mapper/ArdCameraNoGuideZoneMapper.java new file mode 100644 index 0000000..5e0fe53 --- /dev/null +++ b/ard-work/src/main/java/com/ruoyi/device/noguidezone/mapper/ArdCameraNoGuideZoneMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.device.noguidezone.mapper; + +import java.util.List; +import com.ruoyi.device.noguidezone.domain.ArdCameraNoGuideZone; + +/** + * 绂佸紩鍙鍩烳apper鎺ュ彛 + * + * @author ard + * @date 2023-10-27 + */ +public interface ArdCameraNoGuideZoneMapper +{ + /** + * 鏌ヨ绂佸紩鍙鍩� + * + * @param name 绂佸紩鍙鍩熶富閿� + * @return 绂佸紩鍙鍩� + */ + public ArdCameraNoGuideZone selectArdCameraNoGuideZoneByName(String name); + + /** + * 鏌ヨ绂佸紩鍙鍩熷垪琛� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 绂佸紩鍙鍩熼泦鍚� + */ + public List<ArdCameraNoGuideZone> selectArdCameraNoGuideZoneList(ArdCameraNoGuideZone ardCameraNoGuideZone); + + /** + * 鏂板绂佸紩鍙鍩� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 缁撴灉 + */ + public int insertArdCameraNoGuideZone(ArdCameraNoGuideZone ardCameraNoGuideZone); + + /** + * 淇敼绂佸紩鍙鍩� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 缁撴灉 + */ + public int updateArdCameraNoGuideZone(ArdCameraNoGuideZone ardCameraNoGuideZone); + + /** + * 鍒犻櫎绂佸紩鍙鍩� + * + * @param name 绂佸紩鍙鍩熶富閿� + * @return 缁撴灉 + */ + public int deleteArdCameraNoGuideZoneByName(String name); + + /** + * 鎵归噺鍒犻櫎绂佸紩鍙鍩� + * + * @param names 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteArdCameraNoGuideZoneByNames(String[] names); +} diff --git a/ard-work/src/main/java/com/ruoyi/device/noguidezone/service/IArdCameraNoGuideZoneService.java b/ard-work/src/main/java/com/ruoyi/device/noguidezone/service/IArdCameraNoGuideZoneService.java new file mode 100644 index 0000000..6ec3b33 --- /dev/null +++ b/ard-work/src/main/java/com/ruoyi/device/noguidezone/service/IArdCameraNoGuideZoneService.java @@ -0,0 +1,61 @@ +package com.ruoyi.device.noguidezone.service; + +import java.util.List; +import com.ruoyi.device.noguidezone.domain.ArdCameraNoGuideZone; + +/** + * 绂佸紩鍙鍩烻ervice鎺ュ彛 + * + * @author ard + * @date 2023-10-27 + */ +public interface IArdCameraNoGuideZoneService +{ + /** + * 鏌ヨ绂佸紩鍙鍩� + * + * @param name 绂佸紩鍙鍩熶富閿� + * @return 绂佸紩鍙鍩� + */ + public ArdCameraNoGuideZone selectArdCameraNoGuideZoneByName(String name); + + /** + * 鏌ヨ绂佸紩鍙鍩熷垪琛� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 绂佸紩鍙鍩熼泦鍚� + */ + public List<ArdCameraNoGuideZone> selectArdCameraNoGuideZoneList(ArdCameraNoGuideZone ardCameraNoGuideZone); + + /** + * 鏂板绂佸紩鍙鍩� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 缁撴灉 + */ + public int insertArdCameraNoGuideZone(ArdCameraNoGuideZone ardCameraNoGuideZone); + + /** + * 淇敼绂佸紩鍙鍩� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 缁撴灉 + */ + public int updateArdCameraNoGuideZone(ArdCameraNoGuideZone ardCameraNoGuideZone); + + /** + * 鎵归噺鍒犻櫎绂佸紩鍙鍩� + * + * @param names 闇�瑕佸垹闄ょ殑绂佸紩鍙鍩熶富閿泦鍚� + * @return 缁撴灉 + */ + public int deleteArdCameraNoGuideZoneByNames(String[] names); + + /** + * 鍒犻櫎绂佸紩鍙鍩熶俊鎭� + * + * @param name 绂佸紩鍙鍩熶富閿� + * @return 缁撴灉 + */ + public int deleteArdCameraNoGuideZoneByName(String name); +} diff --git a/ard-work/src/main/java/com/ruoyi/device/noguidezone/service/impl/ArdCameraNoGuideZoneServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/noguidezone/service/impl/ArdCameraNoGuideZoneServiceImpl.java new file mode 100644 index 0000000..621b003 --- /dev/null +++ b/ard-work/src/main/java/com/ruoyi/device/noguidezone/service/impl/ArdCameraNoGuideZoneServiceImpl.java @@ -0,0 +1,98 @@ +package com.ruoyi.device.noguidezone.service.impl; + +import java.util.List; + import com.ruoyi.common.utils.DateUtils; + +import com.ruoyi.common.utils.uuid.IdUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.device.noguidezone.mapper.ArdCameraNoGuideZoneMapper; +import com.ruoyi.device.noguidezone.domain.ArdCameraNoGuideZone; +import com.ruoyi.device.noguidezone.service.IArdCameraNoGuideZoneService; + +/** + * 绂佸紩鍙鍩烻ervice涓氬姟灞傚鐞� + * + * @author ard + * @date 2023-10-27 + */ +@Service +public class ArdCameraNoGuideZoneServiceImpl implements IArdCameraNoGuideZoneService { + @Autowired + private ArdCameraNoGuideZoneMapper ardCameraNoGuideZoneMapper; + + /** + * 鏌ヨ绂佸紩鍙鍩� + * + * @param name 绂佸紩鍙鍩熶富閿� + * @return 绂佸紩鍙鍩� + */ + @Override + public ArdCameraNoGuideZone selectArdCameraNoGuideZoneByName(String name) { + return ardCameraNoGuideZoneMapper.selectArdCameraNoGuideZoneByName(name); + } + + /** + * 鏌ヨ绂佸紩鍙鍩熷垪琛� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 绂佸紩鍙鍩� + */ + @Override + public List<ArdCameraNoGuideZone> selectArdCameraNoGuideZoneList(ArdCameraNoGuideZone ardCameraNoGuideZone) { + return ardCameraNoGuideZoneMapper.selectArdCameraNoGuideZoneList(ardCameraNoGuideZone); + } + + /** + * 鏂板绂佸紩鍙鍩� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 缁撴灉 + */ + @Override + public int insertArdCameraNoGuideZone(ArdCameraNoGuideZone ardCameraNoGuideZone) { + ardCameraNoGuideZone.setUserId(SecurityUtils.getUserId()); + ardCameraNoGuideZone.setCreateBy(SecurityUtils.getUsername()); + ardCameraNoGuideZone.setCreateTime(DateUtils.getNowDate()); + ardCameraNoGuideZone.setId(IdUtils.simpleUUID()); + return ardCameraNoGuideZoneMapper.insertArdCameraNoGuideZone(ardCameraNoGuideZone); + } + + /** + * 淇敼绂佸紩鍙鍩� + * + * @param ardCameraNoGuideZone 绂佸紩鍙鍩� + * @return 缁撴灉 + */ + @Override + public int updateArdCameraNoGuideZone(ArdCameraNoGuideZone ardCameraNoGuideZone) { + ardCameraNoGuideZone.setUpdateBy(SecurityUtils.getUsername()); + ardCameraNoGuideZone.setUpdateTime(DateUtils.getNowDate()); + return ardCameraNoGuideZoneMapper.updateArdCameraNoGuideZone(ardCameraNoGuideZone); + } + + /** + * 鎵归噺鍒犻櫎绂佸紩鍙鍩� + * + * @param names 闇�瑕佸垹闄ょ殑绂佸紩鍙鍩熶富閿� + * @return 缁撴灉 + */ + @Override + public int deleteArdCameraNoGuideZoneByNames(String[] names) { + return ardCameraNoGuideZoneMapper.deleteArdCameraNoGuideZoneByNames(names); + } + + /** + * 鍒犻櫎绂佸紩鍙鍩熶俊鎭� + * + * @param name 绂佸紩鍙鍩熶富閿� + * @return 缁撴灉 + */ + @Override + public int deleteArdCameraNoGuideZoneByName(String name) { + return ardCameraNoGuideZoneMapper.deleteArdCameraNoGuideZoneByName(name); + } +} diff --git a/ard-work/src/main/resources/mapper/device/ArdCameraNoGuideZoneMapper.xml b/ard-work/src/main/resources/mapper/device/ArdCameraNoGuideZoneMapper.xml new file mode 100644 index 0000000..84718c3 --- /dev/null +++ b/ard-work/src/main/resources/mapper/device/ArdCameraNoGuideZoneMapper.xml @@ -0,0 +1,99 @@ +<?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.ruoyi.device.noguidezone.mapper.ArdCameraNoGuideZoneMapper"> + + <resultMap type="ArdCameraNoGuideZone" id="ArdCameraNoGuideZoneResult"> + <result property="name" column="name" /> + <result property="poi" column="poi" /> + <result property="cameraId" column="camera_id" /> + <result property="enabled" column="enabled" /> + <result property="deptId" column="dept_id" /> + <result property="userId" column="user_id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="id" column="id" /> + </resultMap> + + <sql id="selectArdCameraNoGuideZoneVo"> + select name, poi, camera_id, enabled, dept_id, user_id, create_by, create_time, update_by, update_time, id from ard_camera_no_guide_zone + </sql> + + <select id="selectArdCameraNoGuideZoneList" parameterType="ArdCameraNoGuideZone" resultMap="ArdCameraNoGuideZoneResult"> + <include refid="selectArdCameraNoGuideZoneVo"/> + <where> + <if test="name != null and name != ''"> and name like '%'||#{name}||'%'</if> + <if test="poi != null and poi != ''"> and poi = #{poi}</if> + <if test="cameraId != null and cameraId != ''"> and camera_id = #{cameraId}</if> + <if test="enabled != null and enabled != ''"> and enabled = #{enabled}</if> + <if test="deptId != null "> and dept_id = #{deptId}</if> + <if test="userId != null and userId != ''"> and user_id = #{userId}</if> + </where> + </select> + + <select id="selectArdCameraNoGuideZoneByName" parameterType="String" resultMap="ArdCameraNoGuideZoneResult"> + <include refid="selectArdCameraNoGuideZoneVo"/> + where name = #{name} + </select> + + <insert id="insertArdCameraNoGuideZone" parameterType="ArdCameraNoGuideZone"> + insert into ard_camera_no_guide_zone + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="name != null">name,</if> + <if test="poi != null">poi,</if> + <if test="cameraId != null">camera_id,</if> + <if test="enabled != null">enabled,</if> + <if test="deptId != null">dept_id,</if> + <if test="userId != null">user_id,</if> + <if test="createBy != null">create_by,</if> + <if test="createTime != null">create_time,</if> + <if test="updateBy != null">update_by,</if> + <if test="updateTime != null">update_time,</if> + <if test="id != null">id,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="name != null">#{name},</if> + <if test="poi != null">#{poi},</if> + <if test="cameraId != null">#{cameraId},</if> + <if test="enabled != null">#{enabled},</if> + <if test="deptId != null">#{deptId},</if> + <if test="userId != null">#{userId},</if> + <if test="createBy != null">#{createBy},</if> + <if test="createTime != null">#{createTime},</if> + <if test="updateBy != null">#{updateBy},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="id != null">#{id},</if> + </trim> + </insert> + + <update id="updateArdCameraNoGuideZone" parameterType="ArdCameraNoGuideZone"> + update ard_camera_no_guide_zone + <trim prefix="SET" suffixOverrides=","> + <if test="poi != null">poi = #{poi},</if> + <if test="cameraId != null">camera_id = #{cameraId},</if> + <if test="enabled != null">enabled = #{enabled},</if> + <if test="deptId != null">dept_id = #{deptId},</if> + <if test="userId != null">user_id = #{userId},</if> + <if test="createBy != null">create_by = #{createBy},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="updateBy != null">update_by = #{updateBy},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="id != null">id = #{id},</if> + </trim> + where name = #{name} + </update> + + <delete id="deleteArdCameraNoGuideZoneByName" parameterType="String"> + delete from ard_camera_no_guide_zone where name = #{name} + </delete> + + <delete id="deleteArdCameraNoGuideZoneByNames" parameterType="String"> + delete from ard_camera_no_guide_zone where name in + <foreach item="name" collection="array" open="(" separator="," close=")"> + #{name} + </foreach> + </delete> +</mapper> \ No newline at end of file -- Gitblit v1.9.3