提交 188e3ef2 编写于 作者: xiaonannet's avatar xiaonannet

表字段调整,mqtt规则引擎转发jsonBUG处理

上级 7eba3dd6
......@@ -123,19 +123,19 @@ smqtt:
- ruleName: ROCKET_MQ # 过滤器名称
chain: # 规则链(支持多个)
- ruleType: ROCKET_MQ # 过滤器类型
script: '{"topic":"${topic}","msg":"${msg}","qos":${qos}}'
script: '{"topic":"${topic}","msg":${msg},"qos":${qos}}'
- ruleName: KAFKA # 过滤器名称
chain: # 规则链(支持多个)
- ruleType: KAFKA # 过滤器类型
script: '{"topic":"${topic}","msg":"${msg}","qos":${qos}}'
script: '{"topic":"${topic}","msg":${msg},"qos":${qos}}'
# - ruleName: HTTP # 过滤器名称
# chain: # 规则链(支持多个)
# - ruleType: HTTP
# script: '{"topic":"${topic}","msg":"${msg.test}","qos":${qos}}'
# script: '{"topic":"${topic}","msg":${msg.test},"qos":${qos}}'
# - ruleName: MQTT # 过滤器名称
# chain: # 规则链(支持多个)
# - ruleType: MQTT # 过滤器类型
# script: '{"topic":"${topic}","msg":"${msg}","qos":${qos}}'
# script: '{"topic":"${topic}","msg":${msg},"qos":${qos}}'
# - ruleName: DATA_BASE # 过滤器名称
# chain: # 规则链
# - ruleType: DATA_BASE # 过滤器类型
......@@ -143,7 +143,7 @@ smqtt:
# - ruleName: RABBIT_MQ # 过滤器名称
# chain: # 规则链
# - ruleType: RABBIT_MQ # 过滤器类型
# script: '{"topic":"${topic}","msg":"${msg}","qos":${qos}}'
# script: '{"topic":"${topic}","msg":${msg},"qos":${qos}}'
sources: # 配置数据源sources
- source: ROCKET_MQ # rocketmq配置
sourceName: rocket_mq
......
......@@ -8,13 +8,13 @@ import lombok.Data;
/**
* @Description: 设备动作数据
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @CreateDate: 2021/12/26$ 13:20$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateDate: 2021/12/26$ 13:20$
* @UpdateRemark: 修改内容
* @Version: 1.0
......
......@@ -8,13 +8,13 @@ import lombok.Data;
/**
* @Description: 设备消息
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @CreateDate: 2021/12/26$ 13:20$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateDate: 2021/12/26$ 13:20$
* @UpdateRemark: 修改内容
* @Version: 1.0
......
......@@ -13,7 +13,7 @@ import java.util.List;
* @date 2021-12-23
*/
@Data
public class Product {
public class ProductModel {
private static final long serialVersionUID = 1L;
private String productName;
private Integer productType;
......
......@@ -32,8 +32,8 @@ public class DeviceActionMessageConsumer implements RocketMQListener {
@Override
public void onMessage(Object message) {
assert message!=null;
System.out.println("Link消费消息"+message);
JSONObject thinglinksMessage = JSONObject.parseObject((String) message);
System.out.println("Link消费设备消息"+message);
JSONObject thinglinksMessage = JSONObject.parseObject(String.valueOf(message));
/**
* TODO 设备上下线处理
* $event/close 设备断开事件
......@@ -41,11 +41,11 @@ public class DeviceActionMessageConsumer implements RocketMQListener {
* ${topic} 其他为业务数据自行处理
*/
if("$event/connect".equals(thinglinksMessage.get("topic"))){
deviceActionService.connectEvent(thinglinksMessage.get("msg").toString());
deviceActionService.connectEvent(String.valueOf(thinglinksMessage.get("msg").toString()));
}else if("$event/close".equals(thinglinksMessage.get("topic"))){
deviceActionService.closeEvent(thinglinksMessage.get("msg").toString());
deviceActionService.closeEvent(String.valueOf(thinglinksMessage.get("msg")));
}else {
deviceDatasService.insertBaseDatas(thinglinksMessage.get("msg").toString());
deviceDatasService.insertBaseDatas(String.valueOf(thinglinksMessage.get("msg")));
}
}
}
......@@ -6,22 +6,21 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 13:20$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 13:20$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
@Mapper
public interface DeviceActionMapper {
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
......@@ -29,6 +28,7 @@ public interface DeviceActionMapper {
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
......@@ -42,6 +42,7 @@ public interface DeviceActionMapper {
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
......@@ -49,6 +50,7 @@ public interface DeviceActionMapper {
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
......@@ -56,6 +58,7 @@ public interface DeviceActionMapper {
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
......@@ -65,6 +68,7 @@ public interface DeviceActionMapper {
/**
* update record
*
* @param record the updated record
* @return update count
*/
......
......@@ -6,22 +6,21 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 13:20$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 13:20$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
@Mapper
public interface DeviceDatasMapper {
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
......@@ -29,6 +28,7 @@ public interface DeviceDatasMapper {
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
......@@ -42,6 +42,7 @@ public interface DeviceDatasMapper {
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
......@@ -49,6 +50,7 @@ public interface DeviceDatasMapper {
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
......@@ -56,6 +58,7 @@ public interface DeviceDatasMapper {
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
......@@ -65,6 +68,7 @@ public interface DeviceDatasMapper {
/**
* update record
*
* @param record the updated record
* @return update count
*/
......
......@@ -2,20 +2,19 @@ package com.mqttsnet.thinglinks.link.service.device;
import java.util.List;
import com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceAction;
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
public interface DeviceActionService{
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
public interface DeviceActionService {
int deleteByPrimaryKey(Long id);
......@@ -46,14 +45,18 @@ public interface DeviceActionService{
/**
* 设备连接事件
*
* @param thinglinksMessage
*/
void connectEvent(String thinglinksMessage);
/**
* 设备断开事件
*
* @param thinglinksMessage
*/
void closeEvent(String thinglinksMessage);
}
......@@ -2,20 +2,19 @@ package com.mqttsnet.thinglinks.link.service.device;
import java.util.List;
import com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceDatas;
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
public interface DeviceDatasService{
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
public interface DeviceDatasService {
int deleteByPrimaryKey(Long id);
......@@ -46,8 +45,11 @@ public interface DeviceDatasService{
/**
* thinglinks-mqtt基础数据处理
*
* @param thinglinksMessage
*/
void insertBaseDatas(String thinglinksMessage);
}
......@@ -13,21 +13,20 @@ import java.util.Map;
import com.mqttsnet.thinglinks.link.mapper.device.DeviceActionMapper;
import com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceAction;
import com.mqttsnet.thinglinks.link.service.device.DeviceActionService;
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
@Service
public class DeviceActionServiceImpl implements DeviceActionService{
public class DeviceActionServiceImpl implements DeviceActionService {
@Resource
private DeviceActionMapper deviceActionMapper;
......@@ -132,10 +131,12 @@ public class DeviceActionServiceImpl implements DeviceActionService{
DeviceAction deviceAction = new DeviceAction();
deviceAction.setDeviceIdentification(String.valueOf(map.get("clientIdentifier")));
deviceAction.setActionType(String.valueOf(map.get("channelStatus")));
deviceAction.setStatus(i!=0?"success":"failure");
deviceAction.setStatus(i != 0 ? "success" : "failure");
deviceAction.setMessage("Device Disconnection");
deviceAction.setCreateTime(LocalDateTimeUtil.now());
deviceActionMapper.insertOrUpdate(deviceAction);
}
}
package com.mqttsnet.thinglinks.link.service.device.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -7,22 +8,21 @@ import java.util.List;
import com.mqttsnet.thinglinks.link.mapper.device.DeviceDatasMapper;
import com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceDatas;
import com.mqttsnet.thinglinks.link.service.device.DeviceDatasService;
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
/**
* @Description: java类作用描述
* @Author: ShiHuan Sun
* @E-mail: 13733918655@163.com
* @Website: http://thinglinks.mqttsnet.com
* @CreateDate: 2021/12/26$ 0:27$
* @UpdateUser: ShiHuan Sun
* @UpdateDate: 2021/12/26$ 0:27$
* @UpdateRemark: 修改内容
* @Version: 1.0
*/
@Service
@Slf4j
public class DeviceDatasServiceImpl implements DeviceDatasService{
public class DeviceDatasServiceImpl implements DeviceDatasService {
@Resource
private DeviceDatasMapper deviceDatasMapper;
......@@ -103,3 +103,5 @@ public class DeviceDatasServiceImpl implements DeviceDatasService{
}
}
......@@ -42,24 +42,24 @@
insert into device_action (device_identification, action_type,
`status`, create_time, message
)
values (#{device_identification,jdbcType=VARCHAR}, #{action_type,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{create_time,jdbcType=TIMESTAMP}, #{message,jdbcType=LONGVARCHAR}
values (#{deviceIdentification,jdbcType=VARCHAR}, #{actionType,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{message,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceAction" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into device_action
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="device_identification != null and device_identification != ''">
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification,
</if>
<if test="action_type != null and action_type != ''">
<if test="actionType != null and actionType != ''">
action_type,
</if>
<if test="status != null and status != ''">
`status`,
</if>
<if test="create_time != null">
<if test="createTime != null">
create_time,
</if>
<if test="message != null and message != ''">
......@@ -67,17 +67,17 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="device_identification != null and device_identification != ''">
#{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
#{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="action_type != null and action_type != ''">
#{action_type,jdbcType=VARCHAR},
<if test="actionType != null and actionType != ''">
#{actionType,jdbcType=VARCHAR},
</if>
<if test="status != null and status != ''">
#{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
#{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
#{message,jdbcType=LONGVARCHAR},
......@@ -88,17 +88,17 @@
<!--@mbg.generated-->
update device_action
<set>
<if test="device_identification != null and device_identification != ''">
device_identification = #{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="action_type != null and action_type != ''">
action_type = #{action_type,jdbcType=VARCHAR},
<if test="actionType != null and actionType != ''">
action_type = #{actionType,jdbcType=VARCHAR},
</if>
<if test="status != null and status != ''">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
create_time = #{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
message = #{message,jdbcType=LONGVARCHAR},
......@@ -109,20 +109,20 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceAction">
<!--@mbg.generated-->
update device_action
set device_identification = #{device_identification,jdbcType=VARCHAR},
action_type = #{action_type,jdbcType=VARCHAR},
set device_identification = #{deviceIdentification,jdbcType=VARCHAR},
action_type = #{actionType,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
message = #{message,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceAction">
<!--@mbg.generated-->
update device_action
set device_identification = #{device_identification,jdbcType=VARCHAR},
action_type = #{action_type,jdbcType=VARCHAR},
set device_identification = #{deviceIdentification,jdbcType=VARCHAR},
action_type = #{actionType,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP}
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateBatch" parameterType="java.util.List">
......@@ -131,12 +131,12 @@
<trim prefix="set" suffixOverrides=",">
<trim prefix="device_identification = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.device_identification,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=BIGINT} then #{item.deviceIdentification,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="action_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.action_type,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=BIGINT} then #{item.actionType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
......@@ -146,7 +146,7 @@
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.create_time,jdbcType=TIMESTAMP}
when id = #{item.id,jdbcType=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="message = case" suffix="end,">
......@@ -166,15 +166,15 @@
<trim prefix="set" suffixOverrides=",">
<trim prefix="device_identification = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.device_identification != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.device_identification,jdbcType=VARCHAR}
<if test="item.deviceIdentification != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.deviceIdentification,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="action_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.action_type != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.action_type,jdbcType=VARCHAR}
<if test="item.actionType != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.actionType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
......@@ -187,15 +187,15 @@
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.create_time != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.create_time,jdbcType=TIMESTAMP}
<if test="item.createTime != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="message = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.message != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.message,jdbcType=LONGVARCHAR}
when id = #{item.id,jdbcType=BIGINT} then #{item.message,jdbcType=LONGVARCHAR}
</if>
</foreach>
</trim>
......@@ -211,8 +211,8 @@
(device_identification, action_type, `status`, create_time, message)
values
<foreach collection="list" item="item" separator=",">
(#{item.device_identification,jdbcType=VARCHAR}, #{item.action_type,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR}, #{item.create_time,jdbcType=TIMESTAMP}, #{item.message,jdbcType=LONGVARCHAR}
(#{item.deviceIdentification,jdbcType=VARCHAR}, #{item.actionType,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.message,jdbcType=LONGVARCHAR}
)
</foreach>
</insert>
......@@ -233,20 +233,20 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
#{device_identification,jdbcType=VARCHAR},
#{action_type,jdbcType=VARCHAR},
#{deviceIdentification,jdbcType=VARCHAR},
#{actionType,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{create_time,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=BIGINT},
</if>
device_identification = #{device_identification,jdbcType=VARCHAR},
action_type = #{action_type,jdbcType=VARCHAR},
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
action_type = #{actionType,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
</trim>
</insert>
<insert id="insertOrUpdateWithBLOBs" keyColumn="id" keyProperty="id" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceAction" useGeneratedKeys="true">
......@@ -267,10 +267,10 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
#{device_identification,jdbcType=VARCHAR},
#{action_type,jdbcType=VARCHAR},
#{deviceIdentification,jdbcType=VARCHAR},
#{actionType,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{create_time,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
#{message,jdbcType=LONGVARCHAR},
</trim>
on duplicate key update
......@@ -278,10 +278,10 @@
<if test="id != null">
id = #{id,jdbcType=BIGINT},
</if>
device_identification = #{device_identification,jdbcType=VARCHAR},
action_type = #{action_type,jdbcType=VARCHAR},
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
action_type = #{actionType,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
message = #{message,jdbcType=LONGVARCHAR},
</trim>
</insert>
......@@ -292,16 +292,16 @@
<if test="id != null">
id,
</if>
<if test="device_identification != null and device_identification != ''">
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification,
</if>
<if test="action_type != null and action_type != ''">
<if test="actionType != null and actionType != ''">
action_type,
</if>
<if test="status != null and status != ''">
`status`,
</if>
<if test="create_time != null">
<if test="createTime != null">
create_time,
</if>
<if test="message != null and message != ''">
......@@ -313,17 +313,17 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="device_identification != null and device_identification != ''">
#{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
#{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="action_type != null and action_type != ''">
#{action_type,jdbcType=VARCHAR},
<if test="actionType != null and actionType != ''">
#{actionType,jdbcType=VARCHAR},
</if>
<if test="status != null and status != ''">
#{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
#{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
#{message,jdbcType=LONGVARCHAR},
......@@ -334,17 +334,17 @@
<if test="id != null">
id = #{id,jdbcType=BIGINT},
</if>
<if test="device_identification != null and device_identification != ''">
device_identification = #{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="action_type != null and action_type != ''">
action_type = #{action_type,jdbcType=VARCHAR},
<if test="actionType != null and actionType != ''">
action_type = #{actionType,jdbcType=VARCHAR},
</if>
<if test="status != null and status != ''">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
create_time = #{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
message = #{message,jdbcType=LONGVARCHAR},
......
......@@ -43,18 +43,18 @@
insert into device_datas (device_identification, message_id,
topic, `status`, create_time,
message)
values (#{device_identification,jdbcType=VARCHAR}, #{message_id,jdbcType=VARCHAR},
#{topic,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{create_time,jdbcType=TIMESTAMP},
values (#{deviceIdentification,jdbcType=VARCHAR}, #{messageId,jdbcType=VARCHAR},
#{topic,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{message,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceDatas" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into device_datas
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="device_identification != null and device_identification != ''">
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification,
</if>
<if test="message_id != null and message_id != ''">
<if test="messageId != null and messageId != ''">
message_id,
</if>
<if test="topic != null and topic != ''">
......@@ -63,7 +63,7 @@
<if test="status != null and status != ''">
`status`,
</if>
<if test="create_time != null">
<if test="createTime != null">
create_time,
</if>
<if test="message != null and message != ''">
......@@ -71,11 +71,11 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="device_identification != null and device_identification != ''">
#{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
#{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="message_id != null and message_id != ''">
#{message_id,jdbcType=VARCHAR},
<if test="messageId != null and messageId != ''">
#{messageId,jdbcType=VARCHAR},
</if>
<if test="topic != null and topic != ''">
#{topic,jdbcType=VARCHAR},
......@@ -83,8 +83,8 @@
<if test="status != null and status != ''">
#{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
#{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
#{message,jdbcType=LONGVARCHAR},
......@@ -95,11 +95,11 @@
<!--@mbg.generated-->
update device_datas
<set>
<if test="device_identification != null and device_identification != ''">
device_identification = #{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="message_id != null and message_id != ''">
message_id = #{message_id,jdbcType=VARCHAR},
<if test="messageId != null and messageId != ''">
message_id = #{messageId,jdbcType=VARCHAR},
</if>
<if test="topic != null and topic != ''">
topic = #{topic,jdbcType=VARCHAR},
......@@ -107,8 +107,8 @@
<if test="status != null and status != ''">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
create_time = #{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
message = #{message,jdbcType=LONGVARCHAR},
......@@ -119,22 +119,22 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceDatas">
<!--@mbg.generated-->
update device_datas
set device_identification = #{device_identification,jdbcType=VARCHAR},
message_id = #{message_id,jdbcType=VARCHAR},
set device_identification = #{deviceIdentification,jdbcType=VARCHAR},
message_id = #{messageId,jdbcType=VARCHAR},
topic = #{topic,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
message = #{message,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceDatas">
<!--@mbg.generated-->
update device_datas
set device_identification = #{device_identification,jdbcType=VARCHAR},
message_id = #{message_id,jdbcType=VARCHAR},
set device_identification = #{deviceIdentification,jdbcType=VARCHAR},
message_id = #{messageId,jdbcType=VARCHAR},
topic = #{topic,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP}
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateBatch" parameterType="java.util.List">
......@@ -143,12 +143,12 @@
<trim prefix="set" suffixOverrides=",">
<trim prefix="device_identification = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.device_identification,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=BIGINT} then #{item.deviceIdentification,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="message_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.message_id,jdbcType=VARCHAR}
when id = #{item.id,jdbcType=BIGINT} then #{item.messageId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="topic = case" suffix="end,">
......@@ -163,7 +163,7 @@
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.create_time,jdbcType=TIMESTAMP}
when id = #{item.id,jdbcType=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="message = case" suffix="end,">
......@@ -183,15 +183,15 @@
<trim prefix="set" suffixOverrides=",">
<trim prefix="device_identification = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.device_identification != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.device_identification,jdbcType=VARCHAR}
<if test="item.deviceIdentification != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.deviceIdentification,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="message_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.message_id != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.message_id,jdbcType=VARCHAR}
<if test="item.messageId != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.messageId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
......@@ -211,8 +211,8 @@
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.create_time != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.create_time,jdbcType=TIMESTAMP}
<if test="item.createTime != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
......@@ -235,8 +235,8 @@
(device_identification, message_id, topic, `status`, create_time, message)
values
<foreach collection="list" item="item" separator=",">
(#{item.device_identification,jdbcType=VARCHAR}, #{item.message_id,jdbcType=VARCHAR},
#{item.topic,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.create_time,jdbcType=TIMESTAMP},
(#{item.deviceIdentification,jdbcType=VARCHAR}, #{item.messageId,jdbcType=VARCHAR},
#{item.topic,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.message,jdbcType=LONGVARCHAR})
</foreach>
</insert>
......@@ -258,22 +258,22 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
#{device_identification,jdbcType=VARCHAR},
#{message_id,jdbcType=VARCHAR},
#{deviceIdentification,jdbcType=VARCHAR},
#{messageId,jdbcType=VARCHAR},
#{topic,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{create_time,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=BIGINT},
</if>
device_identification = #{device_identification,jdbcType=VARCHAR},
message_id = #{message_id,jdbcType=VARCHAR},
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
message_id = #{messageId,jdbcType=VARCHAR},
topic = #{topic,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
</trim>
</insert>
<insert id="insertOrUpdateWithBLOBs" keyColumn="id" keyProperty="id" parameterType="com.mqttsnet.thinglinks.link.api.domain.device.entity.DeviceDatas" useGeneratedKeys="true">
......@@ -295,11 +295,11 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
#{device_identification,jdbcType=VARCHAR},
#{message_id,jdbcType=VARCHAR},
#{deviceIdentification,jdbcType=VARCHAR},
#{messageId,jdbcType=VARCHAR},
#{topic,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{create_time,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
#{message,jdbcType=LONGVARCHAR},
</trim>
on duplicate key update
......@@ -307,11 +307,11 @@
<if test="id != null">
id = #{id,jdbcType=BIGINT},
</if>
device_identification = #{device_identification,jdbcType=VARCHAR},
message_id = #{message_id,jdbcType=VARCHAR},
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
message_id = #{messageId,jdbcType=VARCHAR},
topic = #{topic,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{create_time,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
message = #{message,jdbcType=LONGVARCHAR},
</trim>
</insert>
......@@ -322,10 +322,10 @@
<if test="id != null">
id,
</if>
<if test="device_identification != null and device_identification != ''">
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification,
</if>
<if test="message_id != null and message_id != ''">
<if test="messageId != null and messageId != ''">
message_id,
</if>
<if test="topic != null and topic != ''">
......@@ -334,7 +334,7 @@
<if test="status != null and status != ''">
`status`,
</if>
<if test="create_time != null">
<if test="createTime != null">
create_time,
</if>
<if test="message != null and message != ''">
......@@ -346,11 +346,11 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="device_identification != null and device_identification != ''">
#{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
#{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="message_id != null and message_id != ''">
#{message_id,jdbcType=VARCHAR},
<if test="messageId != null and messageId != ''">
#{messageId,jdbcType=VARCHAR},
</if>
<if test="topic != null and topic != ''">
#{topic,jdbcType=VARCHAR},
......@@ -358,8 +358,8 @@
<if test="status != null and status != ''">
#{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
#{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
#{message,jdbcType=LONGVARCHAR},
......@@ -370,11 +370,11 @@
<if test="id != null">
id = #{id,jdbcType=BIGINT},
</if>
<if test="device_identification != null and device_identification != ''">
device_identification = #{device_identification,jdbcType=VARCHAR},
<if test="deviceIdentification != null and deviceIdentification != ''">
device_identification = #{deviceIdentification,jdbcType=VARCHAR},
</if>
<if test="message_id != null and message_id != ''">
message_id = #{message_id,jdbcType=VARCHAR},
<if test="messageId != null and messageId != ''">
message_id = #{messageId,jdbcType=VARCHAR},
</if>
<if test="topic != null and topic != ''">
topic = #{topic,jdbcType=VARCHAR},
......@@ -382,8 +382,8 @@
<if test="status != null and status != ''">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
create_time = #{create_time,jdbcType=TIMESTAMP},
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="message != null and message != ''">
message = #{message,jdbcType=LONGVARCHAR},
......
......@@ -10,9 +10,9 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备标识" prop="deviceId">
<el-form-item label="设备标识" prop="deviceIdentification">
<el-input
v-model="queryParams.deviceId"
v-model="queryParams.deviceIdentification"
placeholder="请输入设备标识"
clearable
size="small"
......@@ -166,7 +166,7 @@
<dict-tag :options="dict.type.link_device_auth_mode" :value="scope.row.authMode"/>
</template>
</el-table-column>
<el-table-column label="设备标识" align="center" prop="deviceId" />
<el-table-column label="设备标识" align="center" prop="deviceIdentification" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="连接实例" align="center" prop="connector">
<template slot-scope="scope">
......@@ -281,8 +281,8 @@
<el-row>
<el-col :span="11">
<el-form-item label="设备标识" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备标识" />
<el-form-item label="设备标识" prop="deviceIdentification">
<el-input v-model="form.deviceIdentification" placeholder="请输入设备标识" />
</el-form-item>
</el-col>
<el-col :span="11">
......@@ -462,7 +462,7 @@ export default {
pageNum: 1,
pageSize: 10,
clientId: null,
deviceId: null,
deviceIdentification: null,
deviceName: null,
connector: null,
deviceStatus: null,
......@@ -493,7 +493,7 @@ export default {
authMode: [
{ required: true, message: "认证方式不能为空", trigger: "change" }
],
deviceId: [
deviceIdentification: [
{ required: true, message: "设备标识不能为空", trigger: "blur" }
],
deviceName: [
......@@ -579,7 +579,7 @@ export default {
userName: null,
password: null,
authMode: null,
deviceId: null,
deviceIdentification: null,
deviceName: null,
latitude: null,
longitude: null,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册