Browse Source

设备信息

lin 4 years ago
parent
commit
a32e954afe

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/DeviceCommandMapper.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.core.dao;
+
+import com.zcxk.rmcp.core.entity.DeviceCommand;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-20 16:16
+ */
+@Mapper
+public interface DeviceCommandMapper {
+    int insertSelective(DeviceCommand record);
+
+    int updateByPrimaryKeySelective(DeviceCommand record);
+}

+ 126 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/DeviceCommand.java

@@ -0,0 +1,126 @@
+package com.zcxk.rmcp.core.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.LocalDateTime;
+import lombok.Data;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-20 16:16
+ */
+@ApiModel(value="com-zcxk-rmcp-core-entity-DeviceCommand")
+@Data
+public class DeviceCommand {
+    @ApiModelProperty(value="")
+    private Integer id;
+
+    /**
+    * 站点id
+    */
+    @ApiModelProperty(value="站点id")
+    private String tenantId;
+
+    /**
+    * 设备id
+    */
+    @ApiModelProperty(value="设备id")
+    private Long deviceId;
+
+    /**
+    * 指令类型
+    */
+    @ApiModelProperty(value="指令类型")
+    private Integer commandType;
+
+    /**
+    * 指令状态
+    */
+    @ApiModelProperty(value="指令状态")
+    private Integer commandStatus;
+
+    /**
+    * 操作类型
+    */
+    @ApiModelProperty(value="操作类型")
+    private Integer operationType;
+
+    /**
+    * 备注
+    */
+    @ApiModelProperty(value="备注")
+    private String remark;
+
+    /**
+    * 指令id
+    */
+    @ApiModelProperty(value="指令id")
+    private String commandId;
+
+    /**
+    * 下发时间
+    */
+    @ApiModelProperty(value="下发时间")
+    private LocalDateTime issueDate;
+
+    /**
+    * 完成时间
+    */
+    @ApiModelProperty(value="完成时间")
+    private LocalDateTime finishDate;
+
+    /**
+    * 参数
+    */
+    @ApiModelProperty(value="参数")
+    private String params;
+
+    /**
+    * 平台
+    */
+    @ApiModelProperty(value="平台")
+    private Integer platform;
+
+    /**
+    * 关联id
+    */
+    @ApiModelProperty(value="关联id")
+    private String relationId;
+
+    /**
+    * 推送状态 0未推送 1已推送
+    */
+    @ApiModelProperty(value="推送状态 0未推送 1已推送")
+    private Integer pushStatus;
+
+    /**
+    * 状态
+    */
+    @ApiModelProperty(value="状态")
+    private Integer status;
+
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty(value="创建时间")
+    private LocalDateTime createDate;
+
+    /**
+    * 更新时间
+    */
+    @ApiModelProperty(value="更新时间")
+    private LocalDateTime updateDate;
+
+    /**
+    * 创建人
+    */
+    @ApiModelProperty(value="创建人")
+    private String createBy;
+
+    /**
+    * 更新人
+    */
+    @ApiModelProperty(value="更新人")
+    private String updateBy;
+}

+ 210 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/DeviceCommandMapper.xml

@@ -0,0 +1,210 @@
+<?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.zcxk.rmcp.core.dao.DeviceCommandMapper">
+  <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.DeviceCommand">
+    <!--@mbg.generated-->
+    <!--@Table rmcp_device_command-->
+    <id column="id" property="id" />
+    <result column="tenant_id" property="tenantId" />
+    <result column="device_id" property="deviceId" />
+    <result column="command_type" property="commandType" />
+    <result column="command_status" property="commandStatus" />
+    <result column="operation_type" property="operationType" />
+    <result column="remark" property="remark" />
+    <result column="command_id" property="commandId" />
+    <result column="issue_date" property="issueDate" />
+    <result column="finish_date" property="finishDate" />
+    <result column="params" property="params" />
+    <result column="platform" property="platform" />
+    <result column="relation_id" property="relationId" />
+    <result column="push_status" property="pushStatus" />
+    <result column="status" property="status" />
+    <result column="create_date" property="createDate" />
+    <result column="update_date" property="updateDate" />
+    <result column="create_by" property="createBy" />
+    <result column="update_by" property="updateBy" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, tenant_id, device_id, command_type, command_status, operation_type, remark, command_id, 
+    issue_date, finish_date, params, platform, relation_id, push_status, `status`, create_date, 
+    update_date, create_by, update_by
+  </sql>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.rmcp.core.entity.DeviceCommand" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_device_command
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="tenantId != null">
+        tenant_id,
+      </if>
+      <if test="deviceId != null">
+        device_id,
+      </if>
+      <if test="commandType != null">
+        command_type,
+      </if>
+      <if test="commandStatus != null">
+        command_status,
+      </if>
+      <if test="operationType != null">
+        operation_type,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="commandId != null">
+        command_id,
+      </if>
+      <if test="issueDate != null">
+        issue_date,
+      </if>
+      <if test="finishDate != null">
+        finish_date,
+      </if>
+      <if test="params != null">
+        params,
+      </if>
+      <if test="platform != null">
+        platform,
+      </if>
+      <if test="relationId != null">
+        relation_id,
+      </if>
+      <if test="pushStatus != null">
+        push_status,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createDate != null">
+        create_date,
+      </if>
+      <if test="updateDate != null">
+        update_date,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="tenantId != null">
+        #{tenantId},
+      </if>
+      <if test="deviceId != null">
+        #{deviceId},
+      </if>
+      <if test="commandType != null">
+        #{commandType},
+      </if>
+      <if test="commandStatus != null">
+        #{commandStatus},
+      </if>
+      <if test="operationType != null">
+        #{operationType},
+      </if>
+      <if test="remark != null">
+        #{remark},
+      </if>
+      <if test="commandId != null">
+        #{commandId},
+      </if>
+      <if test="issueDate != null">
+        #{issueDate},
+      </if>
+      <if test="finishDate != null">
+        #{finishDate},
+      </if>
+      <if test="params != null">
+        #{params},
+      </if>
+      <if test="platform != null">
+        #{platform},
+      </if>
+      <if test="relationId != null">
+        #{relationId},
+      </if>
+      <if test="pushStatus != null">
+        #{pushStatus},
+      </if>
+      <if test="status != null">
+        #{status},
+      </if>
+      <if test="createDate != null">
+        #{createDate},
+      </if>
+      <if test="updateDate != null">
+        #{updateDate},
+      </if>
+      <if test="createBy != null">
+        #{createBy},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.DeviceCommand">
+    <!--@mbg.generated-->
+    update rmcp_device_command
+    <set>
+      <if test="tenantId != null">
+        tenant_id = #{tenantId},
+      </if>
+      <if test="deviceId != null">
+        device_id = #{deviceId},
+      </if>
+      <if test="commandType != null">
+        command_type = #{commandType},
+      </if>
+      <if test="commandStatus != null">
+        command_status = #{commandStatus},
+      </if>
+      <if test="operationType != null">
+        operation_type = #{operationType},
+      </if>
+      <if test="remark != null">
+        remark = #{remark},
+      </if>
+      <if test="commandId != null">
+        command_id = #{commandId},
+      </if>
+      <if test="issueDate != null">
+        issue_date = #{issueDate},
+      </if>
+      <if test="finishDate != null">
+        finish_date = #{finishDate},
+      </if>
+      <if test="params != null">
+        params = #{params},
+      </if>
+      <if test="platform != null">
+        platform = #{platform},
+      </if>
+      <if test="relationId != null">
+        relation_id = #{relationId},
+      </if>
+      <if test="pushStatus != null">
+        push_status = #{pushStatus},
+      </if>
+      <if test="status != null">
+        `status` = #{status},
+      </if>
+      <if test="createDate != null">
+        create_date = #{createDate},
+      </if>
+      <if test="updateDate != null">
+        update_date = #{updateDate},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy},
+      </if>
+    </set>
+    where id = #{id}
+  </update>
+</mapper>

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/DeviceCommandService.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.web.service;
+
+import com.zcxk.rmcp.core.entity.DeviceCommand;
+    /**
+ * 
+ * @author linqingwei
+ * @date 2021-07-20 16:16
+ */
+public interface DeviceCommandService{
+
+
+    int insertSelective(DeviceCommand record);
+
+    int updateByPrimaryKeySelective(DeviceCommand record);
+
+}

+ 30 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/DeviceCommandServiceImpl.java

@@ -0,0 +1,30 @@
+package com.zcxk.rmcp.web.service.impl;
+
+import com.zcxk.rmcp.web.service.DeviceCommandService;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import com.zcxk.rmcp.core.dao.DeviceCommandMapper;
+import com.zcxk.rmcp.core.entity.DeviceCommand;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-20 16:16
+ */
+@Service
+public class DeviceCommandServiceImpl implements DeviceCommandService {
+
+    @Resource
+    private DeviceCommandMapper deviceCommandMapper;
+
+    @Override
+    public int insertSelective(DeviceCommand record) {
+        return deviceCommandMapper.insertSelective(record);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(DeviceCommand record) {
+        return deviceCommandMapper.updateByPrimaryKeySelective(record);
+    }
+
+}