liusuyi
2024-05-08 c17dc5484bde25d032bf58d114a4f1598a301f31
增加用户预览位置接口
已添加6个文件
622 ■■■■■ 文件已修改
ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCameraUserPostionController.java 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/domain/ArdCameraUserPostion.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCameraUserPostionMapper.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/service/IArdCameraUserPostionService.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCameraUserPostionServiceImpl.java 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/device/ArdCameraUserPostionMapper.xml 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCameraUserPostionController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,123 @@
package com.ruoyi.device.camera.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ruoyi.common.annotation.Anonymous;
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.camera.domain.ArdCameraUserPostion;
import com.ruoyi.device.camera.service.IArdCameraUserPostionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * ç”¨æˆ·é¢„览位置Controller
 *
 * @author åˆ˜è‹ä¹‰
 * @date 2024-05-08
 */
@Api(tags = "用户预览位置")
@RestController
@RequestMapping("/camera/postion")
public class ArdCameraUserPostionController extends BaseController
{
    @Autowired
    private IArdCameraUserPostionService ardCameraUserPostionService;
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览位置列表
     */
    @PreAuthorize("@ss.hasPermi('camera:postion:list')")
    @GetMapping("/list")
    public TableDataInfo list(ArdCameraUserPostion ardCameraUserPostion)
    {
        startPage();
        List<ArdCameraUserPostion> list = ardCameraUserPostionService.selectArdCameraUserPostionList(ardCameraUserPostion);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºç”¨æˆ·é¢„览位置列表
     */
    @PreAuthorize("@ss.hasPermi('camera:postion:export')")
    @Log(title = "用户预览位置", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ArdCameraUserPostion ardCameraUserPostion)
    {
        List<ArdCameraUserPostion> list = ardCameraUserPostionService.selectArdCameraUserPostionList(ardCameraUserPostion);
        ExcelUtil<ArdCameraUserPostion> util = new ExcelUtil<ArdCameraUserPostion>(ArdCameraUserPostion.class);
        util.exportExcel(response, list, "用户预览位置数据");
    }
    /**
     * èŽ·å–ç”¨æˆ·é¢„è§ˆä½ç½®è¯¦ç»†ä¿¡æ¯
     */
    @PreAuthorize("@ss.hasPermi('camera:postion:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(ardCameraUserPostionService.selectArdCameraUserPostionById(id));
    }
    /**
     * èŽ·å–ç”¨æˆ·é¢„è§ˆç›¸æœºè¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取用户预览相机详细信息")
    //@PreAuthorize("@ss.hasPermi('camera:postion:query')")
    @GetMapping(value = "/getCameraInfo/{position}")
    public AjaxResult getCameraInfo(@PathVariable("position") String position)
    {
        return success(ardCameraUserPostionService.selectArdCameraUserPostionByPosition(position));
    }
    /**
     * æ–°å¢žç”¨æˆ·é¢„览位置
     */
    @ApiOperation("新增用户预览位置")
    @ApiOperationSupport(includeParameters = {"ardCameraUserPostion.cameraId", "ardCameraUserPostion.chanNo","ardCameraUserPostion.position"})
    //@PreAuthorize("@ss.hasPermi('camera:postion:add')")
    @Log(title = "用户预览位置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ArdCameraUserPostion ardCameraUserPostion)
    {
        return toAjax(ardCameraUserPostionService.insertArdCameraUserPostion(ardCameraUserPostion));
    }
    /**
     * ä¿®æ”¹ç”¨æˆ·é¢„览位置
     */
    @PreAuthorize("@ss.hasPermi('camera:postion:edit')")
    @Log(title = "用户预览位置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ArdCameraUserPostion ardCameraUserPostion)
    {
        return toAjax(ardCameraUserPostionService.updateArdCameraUserPostion(ardCameraUserPostion));
    }
    /**
     * åˆ é™¤ç”¨æˆ·é¢„览位置
     */
    @PreAuthorize("@ss.hasPermi('camera:postion:remove')")
    @Log(title = "用户预览位置", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(ardCameraUserPostionService.deleteArdCameraUserPostionByIds(ids));
    }
}
ard-work/src/main/java/com/ruoyi/device/camera/domain/ArdCameraUserPostion.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.ruoyi.device.camera.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_user_postion
 *
 * @author åˆ˜è‹ä¹‰
 * @date 2024-05-08
 */
public class ArdCameraUserPostion extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ä¸»é”® */
    private String id;
    /** ç›¸æœºID */
    @Excel(name = "相机ID")
    private String cameraId;
    /** é€šé“号 */
    @Excel(name = "通道号")
    private Integer chanNo;
    /** ç”¨æˆ·ID */
    @Excel(name = "用户ID")
    private String userId;
    /** ä½ç½®æ ‡è¯† */
    @Excel(name = "位置标识")
    private String position;
    /** ä½ç½®æ ‡è¯† */
    private ArdCameras ardCameras;
    public ArdCameras getArdCameras() {
        return ardCameras;
    }
    public void setArdCameras(ArdCameras ardCameras) {
        this.ardCameras = ardCameras;
    }
    public void setId(String id)
    {
        this.id = id;
    }
    public String getId()
    {
        return id;
    }
    public void setCameraId(String cameraId)
    {
        this.cameraId = cameraId;
    }
    public String getCameraId()
    {
        return cameraId;
    }
    public void setChanNo(Integer chanNo)
    {
        this.chanNo = chanNo;
    }
    public Integer getChanNo()
    {
        return chanNo;
    }
    public void setUserId(String userId)
    {
        this.userId = userId;
    }
    public String getUserId()
    {
        return userId;
    }
    public void setPosition(String position)
    {
        this.position = position;
    }
    public String getPosition()
    {
        return position;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("cameraId", getCameraId())
            .append("chanNo", getChanNo())
            .append("userId", getUserId())
            .append("position", getPosition())
            .toString();
    }
}
ard-work/src/main/java/com/ruoyi/device/camera/mapper/ArdCameraUserPostionMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package com.ruoyi.device.camera.mapper;
import java.util.List;
import com.ruoyi.device.camera.domain.ArdCameraUserPostion;
import com.ruoyi.device.camera.domain.ArdCameras;
/**
 * ç”¨æˆ·é¢„览位置Mapper接口
 *
 * @author åˆ˜è‹ä¹‰
 * @date 2024-05-08
 */
public interface ArdCameraUserPostionMapper
{
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览位置
     *
     * @param id ç”¨æˆ·é¢„览位置主键
     * @return ç”¨æˆ·é¢„览位置
     */
    public ArdCameraUserPostion selectArdCameraUserPostionById(String id);
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览相机信息
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置主键
     * @return ç”¨æˆ·é¢„览位置
     */
    public ArdCameras selectArdCameraUserPostionByPosition(ArdCameraUserPostion ardCameraUserPostion);
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览位置列表
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç”¨æˆ·é¢„览位置集合
     */
    public List<ArdCameraUserPostion> selectArdCameraUserPostionList(ArdCameraUserPostion ardCameraUserPostion);
    /**
     * æ–°å¢žç”¨æˆ·é¢„览位置
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç»“æžœ
     */
    public int insertArdCameraUserPostion(ArdCameraUserPostion ardCameraUserPostion);
    /**
     * ä¿®æ”¹ç”¨æˆ·é¢„览位置
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç»“æžœ
     */
    public int updateArdCameraUserPostion(ArdCameraUserPostion ardCameraUserPostion);
    /**
     * åˆ é™¤ç”¨æˆ·é¢„览位置
     *
     * @param id ç”¨æˆ·é¢„览位置主键
     * @return ç»“æžœ
     */
    public int deleteArdCameraUserPostionById(String id);
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·é¢„览位置
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteArdCameraUserPostionByIds(String[] ids);
}
ard-work/src/main/java/com/ruoyi/device/camera/service/IArdCameraUserPostionService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
package com.ruoyi.device.camera.service;
import java.util.List;
import com.ruoyi.device.camera.domain.ArdCameraUserPostion;
import com.ruoyi.device.camera.domain.ArdCameras;
/**
 * ç”¨æˆ·é¢„览位置Service接口
 *
 * @author åˆ˜è‹ä¹‰
 * @date 2024-05-08
 */
public interface IArdCameraUserPostionService
{
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览位置
     *
     * @param id ç”¨æˆ·é¢„览位置主键
     * @return ç”¨æˆ·é¢„览位置
     */
    public ArdCameraUserPostion selectArdCameraUserPostionById(String id);
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览相机信息
     *
     * @param position ç”¨æˆ·é¢„览位置
     * @return ç”¨æˆ·é¢„览位置
     */
    public ArdCameras selectArdCameraUserPostionByPosition(String position);
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览位置列表
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç”¨æˆ·é¢„览位置集合
     */
    public List<ArdCameraUserPostion> selectArdCameraUserPostionList(ArdCameraUserPostion ardCameraUserPostion);
    /**
     * æ–°å¢žç”¨æˆ·é¢„览位置
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç»“æžœ
     */
    public int insertArdCameraUserPostion(ArdCameraUserPostion ardCameraUserPostion);
    /**
     * ä¿®æ”¹ç”¨æˆ·é¢„览位置
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç»“æžœ
     */
    public int updateArdCameraUserPostion(ArdCameraUserPostion ardCameraUserPostion);
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·é¢„览位置
     *
     * @param ids éœ€è¦åˆ é™¤çš„用户预览位置主键集合
     * @return ç»“æžœ
     */
    public int deleteArdCameraUserPostionByIds(String[] ids);
    /**
     * åˆ é™¤ç”¨æˆ·é¢„览位置信息
     *
     * @param id ç”¨æˆ·é¢„览位置主键
     * @return ç»“æžœ
     */
    public int deleteArdCameraUserPostionById(String id);
}
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCameraUserPostionServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,110 @@
package com.ruoyi.device.camera.service.impl;
import java.util.List;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.device.camera.domain.ArdCameras;
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.camera.mapper.ArdCameraUserPostionMapper;
import com.ruoyi.device.camera.domain.ArdCameraUserPostion;
import com.ruoyi.device.camera.service.IArdCameraUserPostionService;
/**
 * ç”¨æˆ·é¢„览位置Service业务层处理
 *
 * @author åˆ˜è‹ä¹‰
 * @date 2024-05-08
 */
@Service
public class ArdCameraUserPostionServiceImpl implements IArdCameraUserPostionService {
    @Autowired
    private ArdCameraUserPostionMapper ardCameraUserPostionMapper;
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览位置
     *
     * @param id ç”¨æˆ·é¢„览位置主键
     * @return ç”¨æˆ·é¢„览位置
     */
    @Override
    public ArdCameraUserPostion selectArdCameraUserPostionById(String id) {
        return ardCameraUserPostionMapper.selectArdCameraUserPostionById(id);
    }
    @Override
    public ArdCameras selectArdCameraUserPostionByPosition(String position) {
        ArdCameraUserPostion ardCameraUserPostion = new ArdCameraUserPostion();
        ardCameraUserPostion.setUserId(SecurityUtils.getUserId());
        ardCameraUserPostion.setPosition(position);
        ArdCameras ardCameras = ardCameraUserPostionMapper.selectArdCameraUserPostionByPosition(ardCameraUserPostion);
        return ardCameras;
    }
    /**
     * æŸ¥è¯¢ç”¨æˆ·é¢„览位置列表
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç”¨æˆ·é¢„览位置
     */
    @Override
    public List<ArdCameraUserPostion> selectArdCameraUserPostionList(ArdCameraUserPostion ardCameraUserPostion) {
        return ardCameraUserPostionMapper.selectArdCameraUserPostionList(ardCameraUserPostion);
    }
    /**
     * æ–°å¢žç”¨æˆ·é¢„览位置
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç»“æžœ
     */
    @Override
    public int insertArdCameraUserPostion(ArdCameraUserPostion ardCameraUserPostion) {
        ardCameraUserPostion.setUserId(SecurityUtils.getUserId());
        List<ArdCameraUserPostion> ardCameraUserPostions = ardCameraUserPostionMapper.selectArdCameraUserPostionList(ardCameraUserPostion);
        if (ardCameraUserPostions.size() > 0) {
            return ardCameraUserPostionMapper.updateArdCameraUserPostion(ardCameraUserPostion);
        } else {
            ardCameraUserPostion.setId(IdUtils.simpleUUID());
            return ardCameraUserPostionMapper.insertArdCameraUserPostion(ardCameraUserPostion);
        }
    }
    /**
     * ä¿®æ”¹ç”¨æˆ·é¢„览位置
     *
     * @param ardCameraUserPostion ç”¨æˆ·é¢„览位置
     * @return ç»“æžœ
     */
    @Override
    public int updateArdCameraUserPostion(ArdCameraUserPostion ardCameraUserPostion) {
        return ardCameraUserPostionMapper.updateArdCameraUserPostion(ardCameraUserPostion);
    }
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·é¢„览位置
     *
     * @param ids éœ€è¦åˆ é™¤çš„用户预览位置主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteArdCameraUserPostionByIds(String[] ids) {
        return ardCameraUserPostionMapper.deleteArdCameraUserPostionByIds(ids);
    }
    /**
     * åˆ é™¤ç”¨æˆ·é¢„览位置信息
     *
     * @param id ç”¨æˆ·é¢„览位置主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteArdCameraUserPostionById(String id) {
        return ardCameraUserPostionMapper.deleteArdCameraUserPostionById(id);
    }
}
ard-work/src/main/resources/mapper/device/ArdCameraUserPostionMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,148 @@
<?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.camera.mapper.ArdCameraUserPostionMapper">
    <resultMap type="ArdCameras" id="ArdCamerasResult">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="ip" column="ip"/>
        <result property="port" column="port"/>
        <result property="rtspPort" column="rtsp_port"/>
        <result property="username" column="username"/>
        <result property="password" column="password"/>
        <result property="gdtype" column="gdtype"/>
        <result property="factory" column="factory"/>
        <result property="chanNum" column="channel"/>
        <result property="longitude" column="longitude"/>
        <result property="latitude" column="latitude"/>
        <result property="altitude" column="altitude"/>
        <result property="userId" column="user_id"/>
        <result property="deptId" column="dept_id"/>
        <result property="camHeading" column="cam_heading"/>
        <result property="camPitch" column="cam_pitch"/>
        <result property="camRoll" column="cam_roll"/>
        <result property="camNear" column="cam_near"/>
        <result property="camFar" column="cam_far"/>
        <result property="camAspectratio" column="cam_aspectratio"/>
        <result property="camDepth" column="cam_depth"/>
        <result property="camFov" column="cam_fov"/>
        <result property="loginId" column="login_id"/>
        <result property="operatorId" column="operator_id"/>
        <result property="operatorExpired" column="operator_expired"/>
        <result property="camMaxVisibleDistance" column="cam_max_visible_distance"/>
        <result property="camAlarmGuideEnable" column="cam_alarm_guide_enable"/>
        <result property="state" column="state"/>
        <result property="towerId" column="tower_id"/>
        <collection property="channelList" ofType="ArdChannel">
            <result property="id" column="c_id"/>
            <result property="name" column="c_name"/>
            <result property="chanNo" column="c_chan_no"/>
            <result property="deviceId" column="c_device_id"/>
        </collection>
    </resultMap>
    <resultMap type="ArdCameraUserPostion" id="ArdCameraUserPostionResult">
        <result property="id"    column="id"    />
        <result property="cameraId"    column="camera_id"    />
        <result property="chanNo"    column="chan_no"    />
        <result property="userId"    column="user_id"    />
        <result property="position"    column="position"    />
    </resultMap>
    <sql id="selectArdCameraUserPostionVo">
        select id, camera_id, chan_no, user_id, position from ard_camera_user_postion
    </sql>
    <select id="selectArdCameraUserPostionList" parameterType="ArdCameraUserPostion" resultMap="ArdCameraUserPostionResult">
        <include refid="selectArdCameraUserPostionVo"/>
        <where>
            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
            <if test="position != null  and position != ''"> and position = #{position}</if>
        </where>
    </select>
    <select id="selectArdCameraUserPostionByPosition" parameterType="ArdCameraUserPostion" resultMap="ArdCamerasResult">
        SELECT c.id,
               c.name,
               c.ip,
               c.port,
               c.rtsp_port,
               c.username,
               c.password,
               c.gdtype,
               c.factory,
               c.channel,
               c.longitude,
               c.latitude,
               c.altitude,
               c.user_id,
               c.dept_id,
               c.login_id,
               c.cam_heading,
               c.cam_pitch,
               c.cam_roll,
               c.cam_near,
               c.cam_far,
               c.cam_aspectratio,
               c.cam_depth,
               c.cam_fov,
               c.operator_id,
               c.operator_expired,
               c.cam_max_visible_distance,
               c.cam_alarm_guide_enable,
               c.state,
               c.tower_id,
               aaa.id as c_id,
               aaa.device_id as c_device_id,
               aaa.name as c_name,
               aaa.chan_no as c_chan_no
               FROM ard_camera_user_postion p
            LEFT JOIN ard_cameras c ON c.id = p.camera_id
            LEFT JOIN ard_channel aaa on c.id = aaa.device_id
        where p.user_id = #{userId} and p.position = #{position}
    </select>
    <select id="selectArdCameraUserPostionById" parameterType="String" resultMap="ArdCameraUserPostionResult">
        <include refid="selectArdCameraUserPostionVo"/>
        where id = #{id}
    </select>
    <insert id="insertArdCameraUserPostion" parameterType="ArdCameraUserPostion">
        insert into ard_camera_user_postion
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="cameraId != null">camera_id,</if>
            <if test="chanNo != null">chan_no,</if>
            <if test="userId != null">user_id,</if>
            <if test="position != null">position,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="cameraId != null">#{cameraId},</if>
            <if test="chanNo != null">#{chanNo},</if>
            <if test="userId != null">#{userId},</if>
            <if test="position != null">#{position},</if>
         </trim>
    </insert>
    <update id="updateArdCameraUserPostion" parameterType="ArdCameraUserPostion">
        update ard_camera_user_postion
        <trim prefix="SET" suffixOverrides=",">
            <if test="cameraId != null">camera_id = #{cameraId},</if>
            <if test="chanNo != null">chan_no = #{chanNo},</if>
            <if test="userId != null">user_id = #{userId},</if>
            <if test="position != null">position = #{position},</if>
        </trim>
        where position = #{position} and user_id = #{userId}
    </update>
    <delete id="deleteArdCameraUserPostionById" parameterType="String">
        delete from ard_camera_user_postion where id = #{id}
    </delete>
    <delete id="deleteArdCameraUserPostionByIds" parameterType="String">
        delete from ard_camera_user_postion where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>