mqtt配置修改

This commit is contained in:
2025-11-11 10:37:04 +08:00
parent 43edc47aaa
commit 5381cd597c
4 changed files with 135 additions and 30 deletions

View File

@ -7,8 +7,10 @@
<resultMap type="EmsMqttTopicConfig" id="EmsMqttTopicConfigResult">
<result property="id" column="id" />
<result property="mqttTopic" column="mqtt_topic" />
<result property="qos" column="qos" />
<result property="topicName" column="topic_name" />
<result property="method" column="method" />
<result property="handleMethod" column="handle_method" />
<result property="handleType" column="handle_type" />
<result property="siteId" column="siteId" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -17,15 +19,17 @@
</resultMap>
<sql id="selectEmsMqttTopicConfigVo">
select id, mqtt_topic, topic_name, method, siteId, create_by, create_time, update_by, update_time from ems_mqtt_topic_config
select id, mqtt_topic, qos, topic_name, handle_method, handle_type, siteId, create_by, create_time, update_by, update_time from ems_mqtt_topic_config
</sql>
<select id="selectEmsMqttTopicConfigList" parameterType="EmsMqttTopicConfig" resultMap="EmsMqttTopicConfigResult">
<include refid="selectEmsMqttTopicConfigVo"/>
<where>
<if test="mqttTopic != null and mqttTopic != ''"> and mqtt_topic like concat('%', #{mqttTopic}, '%')</if>
<if test="mqttTopic != null and mqttTopic != ''"> and mqtt_topic = #{mqttTopic}</if>
<if test="qos != null "> and qos = #{qos}</if>
<if test="topicName != null and topicName != ''"> and topic_name like concat('%', #{topicName}, '%')</if>
<if test="method != null and method != ''"> and method = #{method}</if>
<if test="handleMethod != null and handleMethod != ''"> and handle_method = #{handleMethod}</if>
<if test="handleType != null and handleType != ''"> and handle_type = #{handleType}</if>
<if test="siteId != null and siteId != ''"> and siteId = #{siteId}</if>
</where>
</select>
@ -39,8 +43,10 @@
insert into ems_mqtt_topic_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mqttTopic != null">mqtt_topic,</if>
<if test="qos != null">qos,</if>
<if test="topicName != null">topic_name,</if>
<if test="method != null">method,</if>
<if test="handleMethod != null">handle_method,</if>
<if test="handleType != null">handle_type,</if>
<if test="siteId != null">siteId,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -49,8 +55,10 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mqttTopic != null">#{mqttTopic},</if>
<if test="qos != null">#{qos},</if>
<if test="topicName != null">#{topicName},</if>
<if test="method != null">#{method},</if>
<if test="handleMethod != null">#{handleMethod},</if>
<if test="handleType != null">#{handleType},</if>
<if test="siteId != null">#{siteId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -63,8 +71,10 @@
update ems_mqtt_topic_config
<trim prefix="SET" suffixOverrides=",">
<if test="mqttTopic != null">mqtt_topic = #{mqttTopic},</if>
<if test="qos != null">qos = #{qos},</if>
<if test="topicName != null">topic_name = #{topicName},</if>
<if test="method != null">method = #{method},</if>
<if test="handleMethod != null">handle_method = #{handleMethod},</if>
<if test="handleType != null">handle_type = #{handleType},</if>
<if test="siteId != null">siteId = #{siteId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@ -84,4 +94,10 @@
#{id}
</foreach>
</delete>
<select id="checkTopicIsExist" parameterType="String" resultType="String">
select mqtt_topic as topic
from ems_mqtt_topic_config
where mqtt_topic = #{strategyTopic}
</select>
</mapper>