Browse Source

参数设置新增排序,添加标签修改

wangyangyang 4 years ago
parent
commit
f9f987d710

+ 126 - 0
sms_water/src/main/java/com/huaxu/controller/MonitorInfoController.java

@@ -0,0 +1,126 @@
+package com.huaxu.controller;
+
+import com.huaxu.entity.DeviceParmEntity;
+import com.huaxu.entity.SceneTypeEntity;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.LoginUser;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.service.DeviceParmService;
+import com.huaxu.util.UserUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.ui.ModelMap;
+
+import java.util.*;
+
+import org.springframework.web.bind.annotation.*;
+import com.huaxu.entity.MonitorInfoEntity;
+import com.huaxu.service.MonitorInfoService;
+
+/**
+ * 标签信息页面控制器
+ * @author WYY
+ * @date 2020-12-02 09:29
+ */
+@RestController
+@RequestMapping("/monitorinfo")
+@Api(tags = "标签信息")
+public class MonitorInfoController {
+
+    @Autowired
+    private MonitorInfoService monitorInfoService;
+    @Autowired
+    private DeviceParmService deviceParmService;
+
+    @ApiOperation(value = "按场景ID查询所有标签信息")
+    @RequestMapping(value = "/findBySceneId",method = RequestMethod.GET)
+    @ResponseBody
+    public AjaxMessage<List<MonitorInfoEntity>> list(
+            @ApiParam(value = "场景ID", required = true) @RequestParam Long id,
+            @ApiParam(value = "图片类型(0鸟瞰图 1工艺图)", required = false) @RequestParam(required = false) Integer imageType,
+            @ApiParam(value = "设备ID", required = false) @RequestParam(required = false) Long deviceId
+            ) {
+        MonitorInfoEntity monitorInfoEntity = new MonitorInfoEntity();
+        monitorInfoEntity.setSceneId(id);
+        if (imageType != null) {
+            monitorInfoEntity.setImageType(imageType);
+        }
+        if (deviceId != null) {
+            monitorInfoEntity.setDeviceId(deviceId);
+        }
+        List<MonitorInfoEntity> page = monitorInfoService.findList(monitorInfoEntity);
+        return new AjaxMessage<>(ResultStatus.OK, page);
+    }
+
+    @RequestMapping(value="getDeviceParmByDeviceId" , method = RequestMethod.GET)
+    @ApiOperation(value = "查询单个设备参数信息(标签设置)")
+    public AjaxMessage<List<DeviceParmEntity>> getByDeviceId(@ApiParam(value = "设备id") @RequestParam Integer id){
+        return new AjaxMessage<>(ResultStatus.OK, deviceParmService.selectByDeviceIdForGis(id));
+    }
+    /**
+     * 新增
+     */
+    @ApiOperation(value = "单个新增")
+    @RequestMapping(value = "/add", method = RequestMethod.POST)
+    @ResponseBody
+    public AjaxMessage<Integer> addMonitorInfo(@ApiParam(value = "标签信息", required = true) @RequestBody MonitorInfoEntity monitorInfo) {
+        //校验参数
+        int result = monitorInfoService.addMonitorInfo(monitorInfo) ? 1 : 0;
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+    /**
+     * 批量新增
+     */
+    @RequestMapping(value = "/batchAdd", method = RequestMethod.POST)
+    @ResponseBody
+    @ApiOperation(value = "批量新增或修改(按设备)")
+    public AjaxMessage<Integer> addMonitorInfo(@ApiParam(value = "标签信息", required = true) @RequestBody ArrayList<MonitorInfoEntity> monitorInfos) {
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        for (MonitorInfoEntity item : monitorInfos) {
+            item.setTenantId(currentUser.getTenantId());
+            item.setStatus(1);
+            item.setDateCreate(new Date());
+            item.setDateUpdate(new Date());
+            item.setCreateBy(currentUser.getName());
+            item.setUpdateBy(currentUser.getName());
+        }
+        int result = monitorInfoService.saveOrUpdateBatch(monitorInfos) ? 1 : 0;
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 修改
+     */
+    @ApiOperation(value = "按ID查询标签")
+    @RequestMapping(value = "/selectById", method = RequestMethod.GET)
+    public AjaxMessage<MonitorInfoEntity> selectById(@ApiParam(value = "ID", required = true) @RequestParam Long id) {
+        MonitorInfoEntity monitorInfo = monitorInfoService.findMonitorInfoById(id);
+        return new AjaxMessage<>(ResultStatus.OK, monitorInfo);
+    }
+
+    /**
+     * 修改保存标签信息
+     */
+    @ApiOperation(value = "单个编辑")
+    @RequestMapping(value = "/edit", method = RequestMethod.POST)
+    @ResponseBody
+    public  AjaxMessage<Integer> editMonitorInfo(@ApiParam(value = "标签信息", required = true) @RequestBody MonitorInfoEntity monitorInfo) {
+        int result = monitorInfoService.updateMonitorInfoById(monitorInfo) ? 1 : 0;
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 删除
+     */
+    @ApiOperation(value = "批量删除")
+    @RequestMapping(value = "/deleteByIds", method = RequestMethod.POST)
+    @ResponseBody
+    public AjaxMessage<Integer> del(@ApiParam(value = "场景类型ID", required = true) @RequestBody Long[] ids) {
+        int result = monitorInfoService.delMonitorInfoByIds(ids) ? 1 : 0;
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+}

+ 2 - 0
sms_water/src/main/java/com/huaxu/controller/SceneTypeController.java

@@ -103,6 +103,8 @@ public class SceneTypeController {
         for (SceneTypeEntity item : sceneTypes) {
             item.setTenantId(currentUser.getTenantId());
             item.setStatus(1);
+            item.setDateCreate(new Date());
+            item.setDateUpdate(new Date());
             item.setCreateBy(currentUser.getName());
             item.setUpdateBy(currentUser.getName());
         }

+ 2 - 0
sms_water/src/main/java/com/huaxu/dao/DeviceParmMapper.java

@@ -67,4 +67,6 @@ public interface DeviceParmMapper  {
     IPage<DeviceParmEntity> selectPage(IPage<DeviceParmEntity> page, DeviceParmEntity deviceParmEntity);
 
     List<DeviceParmEntity> selectByDeviceId(Integer id);
+
+    List<DeviceParmEntity> selectByDeviceIdForGis(Integer id);
 }

+ 34 - 0
sms_water/src/main/java/com/huaxu/dao/MonitorInfoMapper.java

@@ -0,0 +1,34 @@
+package com.huaxu.dao;
+
+import com.huaxu.entity.MonitorInfoEntity;
+import java.io.Serializable;
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+/**
+ *
+ * sms_monitor_infoDAO接口
+ * @author: WYY
+ * @date 2020-12-02 09:29
+ */
+@Mapper
+public interface MonitorInfoMapper extends BaseMapper<MonitorInfoEntity> {
+
+	/**
+     * 自定义分页查询
+     * @param  page 
+     * @param  monitorInfoEntity 实体类
+     */
+     Page<MonitorInfoEntity> findPage(IPage<MonitorInfoEntity> page,
+                                       @Param("monitorInfo") MonitorInfoEntity monitorInfoEntity);
+
+     MonitorInfoEntity findMonitorInfoById(Serializable id);
+
+
+     List<MonitorInfoEntity> findList(MonitorInfoEntity monitorInfoEntity);
+
+     /**删除相关方法  使用mybatis-plus集成的 **/
+}

+ 2 - 1
sms_water/src/main/java/com/huaxu/entity/DeviceParmEntity.java

@@ -42,7 +42,8 @@ public class DeviceParmEntity implements Serializable {
     @ApiModelProperty("是否工艺图参数")
     private Boolean isArtwork;
 
-
+    @ApiModelProperty("排序")
+    private Integer seq;
     @ApiModelProperty(value = "备注")
     private String remark;
     @ApiModelProperty(value = "数据删除标识")

+ 102 - 0
sms_water/src/main/java/com/huaxu/entity/MonitorInfoEntity.java

@@ -0,0 +1,102 @@
+package com.huaxu.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * sms_monitor_info
+ * @author: WYY
+ * @date 2020-12-02 09:29
+ */
+@Data
+@TableName("sms_monitor_info")
+public class MonitorInfoEntity{
+
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */ 
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    /** 租户标识 */
+    @ApiModelProperty(value = "租户标识")
+    @JsonIgnore
+    private String tenantId;
+
+    /** 场景信息 */
+    @ApiModelProperty(value = "场景信息")
+    private Long sceneId;
+
+    /** 设备信息 */
+    @ApiModelProperty(value = "设备信息")
+    private Long deviceId;
+
+    /** 设备属性 */
+    @ApiModelProperty(value = "设备属性")
+    private Long attributeId;
+
+    /** 标签名称 */
+    @ApiModelProperty(value = "标签名称(名称或场景ID)")
+    private String monitorName;
+
+    /** 图片类型 */
+    @ApiModelProperty(value = "图片类型(0鸟瞰图1工艺图)")
+    private Integer imageType;
+
+    /** 标签类型 */
+    @ApiModelProperty(value = "标签类型(0标签 1普通标记 2跳转标记)")
+    private Long monitorType;
+
+    /** 标签值 */
+    @ApiModelProperty(value = "标签值(注:标签的实时数据不用保存)")
+    @TableField(exist = false)
+    private String monitorValue;
+
+    /** 位置左 */
+    @ApiModelProperty(value = "位置左")
+    private Double pointLeft;
+
+    /** 位置上 */
+    @ApiModelProperty(value = "位置上")
+    private Double pointTop;
+
+    /** 坐标X */
+    @ApiModelProperty(value = "坐标X")
+    private Double pointX;
+
+    /** 坐标Y */
+    @ApiModelProperty(value = "坐标Y")
+    private Double pointY;
+
+    /** 排序 */
+    @ApiModelProperty(value = "排序")
+    private Long seq;
+
+    @ApiModelProperty(value = "数据删除标识")
+    @TableLogic
+    @JsonIgnore
+    private Integer status;
+
+    @JsonIgnore
+    private Date dateCreate;
+
+    @ApiModelProperty(value = "创建人")
+    @JsonIgnore
+    private String createBy;
+
+    @JsonIgnore
+    private Date dateUpdate;
+
+    @ApiModelProperty(value = "更新人")
+    @JsonIgnore
+    private String updateBy;
+
+}

+ 6 - 0
sms_water/src/main/java/com/huaxu/service/DeviceParmService.java

@@ -22,6 +22,12 @@ public interface DeviceParmService {
      * @return
      */
     List<DeviceParmEntity> selectByDeviceId(Integer id);
+    /**
+     * 查询单个设备参数信息针对工艺图
+     * @return
+     */
+    List<DeviceParmEntity> selectByDeviceIdForGis(Integer id);
+
     /**
      * 添加设备参数
      * @return

+ 99 - 0
sms_water/src/main/java/com/huaxu/service/MonitorInfoService.java

@@ -0,0 +1,99 @@
+package com.huaxu.service;
+
+
+import com.huaxu.dao.MonitorInfoMapper;
+import com.huaxu.entity.MonitorInfoEntity;
+import com.huaxu.model.LoginUser;
+import com.huaxu.util.UserUtil;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+import javax.annotation.Resource;
+
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.List;
+import java.util.Arrays;
+
+/**
+ * 标签信息Service接口
+ *
+ * @author: WYY
+ * @date 2020-12-02 09:29
+ */
+@Service
+public class MonitorInfoService extends ServiceImpl<MonitorInfoMapper, MonitorInfoEntity> {
+
+    @Resource
+    private MonitorInfoMapper monitorInfoMapper;
+
+    /**
+     * 查列表
+     */
+    public List<MonitorInfoEntity> findList(MonitorInfoEntity monitorInfoEntity) {
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        monitorInfoEntity.setTenantId(currentUser.getTenantId());
+        return monitorInfoMapper.findList(monitorInfoEntity);
+    }
+
+    /**
+     * 批量删除
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public boolean delMonitorInfoByIds(Long[] ids) {
+        return this.removeByIds(Arrays.asList(ids));
+    }
+
+    /**
+     * 单个删除
+     */
+    public boolean delMonitorInfoById(Long id) {
+        return this.removeById(id);
+    }
+
+    /**
+     * 保存
+     */
+    public boolean addMonitorInfo(MonitorInfoEntity monitorInfo) {
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        if(currentUser!=null) {
+            monitorInfo.setTenantId(currentUser.getTenantId());
+            monitorInfo.setCreateBy(currentUser.getName());
+            monitorInfo.setUpdateBy(currentUser.getName());
+        }
+        monitorInfo.setStatus(1);
+        monitorInfo.setDateCreate(new Date());
+        monitorInfo.setDateUpdate(new Date());
+        if (this.save(monitorInfo)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 修改根居ID
+     */
+    public boolean updateMonitorInfoById(MonitorInfoEntity monitorInfo) {
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        if(currentUser!=null) {
+            monitorInfo.setTenantId(currentUser.getTenantId());
+            monitorInfo.setUpdateBy(currentUser.getName());
+        }
+        monitorInfo.setDateUpdate(new Date());
+        if (this.updateById(monitorInfo)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 根居ID获取对象
+     */
+    public MonitorInfoEntity findMonitorInfoById(Long id) {
+        return monitorInfoMapper.findMonitorInfoById(id);
+    }
+}

+ 10 - 0
sms_water/src/main/java/com/huaxu/service/impl/DeviceParmServiceImpl.java

@@ -39,6 +39,16 @@ public class DeviceParmServiceImpl  implements DeviceParmService  {
         return deviceParmEntities;
     }
 
+    @Override
+    public List<DeviceParmEntity> selectByDeviceIdForGis(Integer id) {
+        List<DeviceParmEntity> deviceParmEntities = deviceParmMapper.selectByDeviceIdForGis(id);
+        for (DeviceParmEntity item : deviceParmEntities) {
+            item.setDeviceId(id);
+        }
+        return deviceParmEntities;
+    }
+
+
     @Override
     public Integer insert(DeviceParmEntity deviceParmEntity) {
         LoginUser loginUser = UserUtil.getCurrentUser();

+ 76 - 46
sms_water/src/main/resources/mapper/DeviceParmMapper.xml

@@ -13,6 +13,7 @@
             ,p.IS_MAP as "isMap"
             ,p.IS_ALARM as "isAlarm"
             ,p.IS_ARTWORK as "isArtwork"
+            ,p.SEQ as "seq"
             ,p.REMARK as "remark"
             ,p.STATUS as "status"
             ,p.DATE_CREATE as "dateCreate"
@@ -37,6 +38,7 @@
                     ,p.IS_MAP as "isMap"
                     ,p.IS_ALARM as "isAlarm"
                     ,p.IS_ARTWORK as "isArtwork"
+                    ,p.SEQ as "seq"
                     ,p.REMARK as "remark"
                     ,p.STATUS as "status"
                     ,p.DATE_CREATE as "dateCreate"
@@ -49,6 +51,30 @@
         left join sms_device_parm p on p.DEVICE_ID=a.id and p.ATTRIBUTE_ID=b.ID and p.`STATUS`=1
         where a.id=#{id}
     </select>
+    <select id="selectByDeviceIdForGis" resultType="com.huaxu.entity.DeviceParmEntity">
+        select      p.ID as "id"
+                    ,p.TENANT_ID as "tenantId"
+                    ,p.DEVICE_ID as "deviceId"
+                    ,b.id  as "attributeId"
+                    ,p.IS_SUSPENSION as "isSuspension"
+                    ,p.IS_REPORT as "isReport"
+                    ,p.IS_CHART as "isChart"
+                    ,p.IS_MAP as "isMap"
+                    ,p.IS_ALARM as "isAlarm"
+                    ,p.IS_ARTWORK as "isArtwork"
+                    ,p.SEQ as "seq"
+                    ,p.REMARK as "remark"
+                    ,p.STATUS as "status"
+                    ,p.DATE_CREATE as "dateCreate"
+                    ,p.CREATE_BY as "createBy"
+                    ,p.DATE_UPDATE as "dateUpdate"
+                    ,p.UPDATE_BY as "updateBy"
+                    ,b.`NAME` as "attributeName"
+        from sms_device  a
+        left join sms_device_attribute b on a.DEVICE_TYPE_ID=b.DEVICE_TYPE_ID and b.`STATUS`=1
+        left join sms_device_parm p on p.DEVICE_ID=a.id and p.ATTRIBUTE_ID=b.ID and p.`STATUS`=1
+        where a.id=#{id} and p.IS_ARTWORK=1  order by p.seq asc
+    </select>
 
     <select id="selectById" resultType="com.huaxu.entity.DeviceParmEntity">
         select
@@ -65,7 +91,7 @@
         <include refid="Base_Column_List"/>
         from sms_device_parm p
         <include refid="deviceParmJoins"/>
-        where  p.status = 1
+        where p.status = 1
         <if test="id != null">
             and p.ID = #{id}
         </if>
@@ -80,65 +106,69 @@
 
     <!-- 新增所有列 -->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
-        INSERT INTO sms_device_parm (TENANT_ID ,DEVICE_ID ,ATTRIBUTE_ID ,IS_SUSPENSION ,IS_REPORT ,IS_CHART ,IS_MAP ,IS_ALARM ,IS_ARTWORK ,REMARK ,STATUS ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY )
-        VALUES(#{tenantId},#{deviceId},#{attributeId},#{isSuspension},#{isReport},#{isChart},#{isMap},#{isAlarm},#{isArtwork},#{remark},#{status},#{dateCreate},#{createBy},#{dateUpdate},#{updateBy})
+        INSERT INTO sms_device_parm (TENANT_ID ,DEVICE_ID ,ATTRIBUTE_ID ,IS_SUSPENSION ,IS_REPORT ,IS_CHART ,IS_MAP ,IS_ALARM ,IS_ARTWORK ,REMARK ,SEQ,STATUS ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY )
+        VALUES(#{tenantId},#{deviceId},#{attributeId},#{isSuspension},#{isReport},#{isChart},#{isMap},#{isAlarm},#{isArtwork},#{remark},#{seq},#{status},#{dateCreate},#{createBy},#{dateUpdate},#{updateBy})
    </insert>
 
     <!-- 批量新增 -->
     <insert id="batchInsert">
-        INSERT INTO sms_device_parm (TENANT_ID ,DEVICE_ID ,ATTRIBUTE_ID ,IS_SUSPENSION ,IS_REPORT ,IS_CHART ,IS_MAP ,IS_ALARM ,IS_ARTWORK ,REMARK ,STATUS ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY )
+        INSERT INTO sms_device_parm (TENANT_ID ,DEVICE_ID ,ATTRIBUTE_ID ,IS_SUSPENSION ,IS_REPORT ,IS_CHART ,IS_MAP
+        ,IS_ALARM ,IS_ARTWORK ,REMARK ,SEQ,STATUS ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY )
         values
         <foreach collection="deviceParms" item="item" index="index" separator=",">
-            (#{item.tenantId},#{item.deviceId},#{item.attributeId},#{item.isSuspension},#{item.isReport},#{item.isChart},#{item.isMap},#{item.isAlarm},#{item.isArtwork},#{item.remark},#{item.status},#{item.dateCreate},#{item.createBy},#{item.dateUpdate},#{item.updateBy})
+            (#{item.tenantId},#{item.deviceId},#{item.attributeId},#{item.isSuspension},#{item.isReport},#{item.isChart},#{item.isMap},#{item.isAlarm},#{item.isArtwork},#{item.remark},#{seq},#{item.status},#{item.dateCreate},#{item.createBy},#{item.dateUpdate},#{item.updateBy})
         </foreach>
     </insert>
 
     <!-- 通过主键修改数据 -->
     <update id="update">
-        UPDATE  sms_device_parm
+        UPDATE sms_device_parm
         <set>
-        <if test="tenantId != null and tenantId != '' ">
-            TENANT_ID  = #{tenantId},
-        </if>
-        <if test="deviceId != null ">
-            DEVICE_ID  = #{deviceId},
-        </if>
-        <if test="attributeId != null ">
-            ATTRIBUTE_ID  = #{attributeId},
-        </if>
-        <if test="isSuspension != null ">
-            IS_SUSPENSION  = #{isSuspension},
-        </if>
-        <if test="isReport != null ">
-            IS_REPORT  = #{isReport},
-        </if>
-        <if test="isChart != null ">
-            IS_CHART  = #{isChart},
-        </if>
-        <if test="isMap != null ">
-            IS_MAP  = #{isMap},
-        </if>
-        <if test="isAlarm != null ">
-            IS_ALARM  = #{isAlarm},
-        </if>
-        <if test="isArtwork != null ">
-            IS_ARTWORK  = #{isArtwork},
-        </if>
-        <if test="remark != null and remark != '' ">
-            REMARK  = #{remark},
-        </if>
-        <if test="status != null ">
-            STATUS  = #{status},
-        </if>
-        <if test="dateUpdate != null ">
-            DATE_UPDATE  = #{dateUpdate},
-        </if>
-        <if test="updateBy != null and updateBy != ''">
-            UPDATE_BY  = #{updateBy}
-        </if>
+            <if test="tenantId != null and tenantId != '' ">
+                TENANT_ID = #{tenantId},
+            </if>
+            <if test="deviceId != null ">
+                DEVICE_ID = #{deviceId},
+            </if>
+            <if test="attributeId != null ">
+                ATTRIBUTE_ID = #{attributeId},
+            </if>
+            <if test="isSuspension != null ">
+                IS_SUSPENSION = #{isSuspension},
+            </if>
+            <if test="isReport != null ">
+                IS_REPORT = #{isReport},
+            </if>
+            <if test="isChart != null ">
+                IS_CHART = #{isChart},
+            </if>
+            <if test="isMap != null ">
+                IS_MAP = #{isMap},
+            </if>
+            <if test="isAlarm != null ">
+                IS_ALARM = #{isAlarm},
+            </if>
+            <if test="isArtwork != null ">
+                IS_ARTWORK = #{isArtwork},
+            </if>
+            <if test="remark != null and remark != '' ">
+                REMARK = #{remark},
+            </if>
+            <if test="seq != null and seq != '' ">
+                SEQ = #{seq},
+            </if>
+            <if test="status != null ">
+                STATUS = #{status},
+            </if>
+            <if test="dateUpdate != null ">
+                DATE_UPDATE = #{dateUpdate},
+            </if>
+            <if test="updateBy != null and updateBy != ''">
+                UPDATE_BY = #{updateBy}
+            </if>
         </set>
         WHERE
-             ID  = #{id};
+        ID = #{id};
     </update>
 
     <!--通过主键删除-->

+ 89 - 0
sms_water/src/main/resources/mapper/MonitorInfoMapper.xml

@@ -0,0 +1,89 @@
+<?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.huaxu.dao.MonitorInfoMapper">
+    <resultMap type="MonitorInfoEntity" id="MonitorInfoResult">
+        <result property="id" column="id"/>
+        <result property="tenantId" column="tenant_id"/>
+        <result property="sceneId" column="scene_id"/>
+        <result property="deviceId" column="device_id"/>
+        <result property="attributeId" column="attribute_id"/>
+        <result property="monitorName" column="monitor_name"/>
+        <result property="imageType" column="image_type"/>
+        <result property="monitorType" column="monitor_type"/>
+        <result property="pointLeft" column="point_left"/>
+        <result property="pointTop" column="point_top"/>
+        <result property="pointX" column="point_x"/>
+        <result property="pointY" column="point_y"/>
+        <result property="seq" column="seq"/>
+        <result property="status" column="status"/>
+        <result property="dateCreate" column="date_create"/>
+        <result property="createBy" column="create_by"/>
+        <result property="dateUpdate" column="date_update"/>
+        <result property="updateBy" column="update_by"/>
+    </resultMap>
+    <!--  实体栏位  -->
+    <sql id="monitorInfoColumns">
+         a.id as "id" ,
+         a.tenant_id as "tenantId" ,
+         a.scene_id as "sceneId" ,
+         a.device_id as "deviceId" ,
+         a.attribute_id as "attributeId" ,
+         a.monitor_name as "monitorName" ,
+         a.image_type as "imageType" ,
+         a.monitor_type as "monitorType" ,
+         a.point_left as "pointLeft" ,
+         a.point_top as "pointTop" ,
+         a.point_x as "pointX" ,
+         a.point_y as "pointY" ,
+         a.seq as "seq" ,
+         a.status as "status" ,
+         a.date_create as "dateCreate" ,
+         a.create_by as "createBy" ,
+         a.date_update as "dateUpdate" ,
+         a.update_by as "updateBy" 
+     </sql>
+    <!--  根据主键获取实体   -->
+    <select id="findMonitorInfoById" resultType="com.huaxu.entity.MonitorInfoEntity">
+        SELECT
+        <include refid="monitorInfoColumns"/>
+        FROM sms_monitor_info a
+        WHERE a.id = #{id}
+    </select>
+
+    <!--  根据获取实体List   -->
+    <select id="findList" resultType="com.huaxu.entity.MonitorInfoEntity">
+        SELECT
+        <include refid="monitorInfoColumns"/>
+        FROM sms_monitor_info a
+        <where>
+            a.status=1
+            <if test="tenantId != null  and tenantId != ''">and a.tenant_id = #{tenantId}</if>
+            <if test="sceneId != null ">and a.scene_id = #{sceneId}</if>
+            <if test="deviceId != null ">and a.device_id = #{deviceId}</if>
+            <if test="attributeId != null ">and a.attribute_id = #{attributeId}</if>
+            <if test="imageType != null ">and a.image_type = #{imageType}</if>
+            <if test="monitorType != null ">and a.monitor_type = #{monitorType}</if>
+        </where>
+    </select>
+
+    <!--  根据获取实体 page   -->
+    <select id="findPage" resultType="com.huaxu.entity.MonitorInfoEntity">
+        SELECT
+        <include refid="monitorInfoColumns"/>
+        FROM sms_monitor_info a
+
+        <where>
+            a.status=1
+            <if test="monitorInfo.tenantId != null  and monitorInfo.tenantId != ''">and a.tenant_id =
+                #{monitorInfo.tenantId}
+            </if>
+            <if test="monitorInfo.sceneId != null ">and a.scene_id = #{monitorInfo.sceneId}</if>
+            <if test="monitorInfo.deviceId != null ">and a.device_id = #{monitorInfo.deviceId}</if>
+            <if test="monitorInfo.attributeId != null ">and a.attribute_id = #{monitorInfo.attributeId}</if>
+            <if test="monitorInfo.imageType != null ">and a.image_type = #{monitorInfo.imageType}</if>
+            <if test="monitorInfo.monitorType != null ">and a.monitor_type = #{monitorInfo.monitorType}</if>
+        </where>
+    </select>
+</mapper>