提交增加运维管理

This commit is contained in:
LEED
2025-04-29 22:30:18 +08:00
parent 4201690d93
commit 360b630306
98 changed files with 6300 additions and 45 deletions

View File

@@ -447,7 +447,7 @@
else 1
end as is_owner,
(select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
p.protocol_code,p.transport,p.guid,
p.protocol_code,p.transport,d.guid,
d.group_id,d.agencies_id
from iot_device d
left join iot_product p on p.product_id=d.product_id
@@ -547,7 +547,7 @@
else 1
end as is_owner,
(select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
p.protocol_code,p.transport,p.guid
p.protocol_code,p.transport,d.guid
from iot_device d
left join iot_product p on p.product_id=d.product_id
<if test="groupId != null and groupId !=0 "> left join iot_device_group g on g.device_id=d.device_id </if>
@@ -585,7 +585,7 @@
else 1
end as is_owner,
(select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
p.protocol_code,p.transport,p.guid
p.protocol_code,p.transport,d.guid
from iot_device d
left join iot_product p on p.product_id=d.product_id
<if test="groupId != null and groupId !=0 "> left join iot_device_group g on g.device_id=d.device_id </if>
@@ -624,7 +624,7 @@
else 1
end as is_owner,
(select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
p.protocol_code,p.transport,p.guid
p.protocol_code,p.transport,d.guid
from iot_device d
left join iot_product p on p.product_id=d.product_id
<if test="groupId != null and groupId !=0 "> left join iot_device_group g on g.device_id=d.device_id </if>
@@ -658,7 +658,7 @@
d.firmware_version, d.status,d.rssi,d.is_shadow,d.is_simulate ,d.location_way,d.ic_way,d.iccid,d.volt,d.sd,d.pd,d.imei, d.gw_id, d.gw_name,
d.things_model_value, d.active_time,d.create_time, if(null = d.img_url or '' = d.img_url, p.img_url, d.img_url) as img_url,
(select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
p.protocol_code,p.transport,p.guid
p.protocol_code,p.transport,d.guid
from iot_device d
left join iot_product p on p.product_id=d.product_id
<where>
@@ -697,7 +697,7 @@
d.img_url,
d.summary,
d.remark,
p.guid,
d.guid,
d.group_id,
d.agencies_id,
d.ic_way,
@@ -891,6 +891,8 @@
<if test="imei != null">imei,</if>
<if test="gwId != null">gw_id,</if>
<if test="gwName != null">gw_name,</if>
<if test="guid != null">guid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
@@ -931,13 +933,14 @@
<if test="imei != null">#{imei},</if>
<if test="gwId != null">#{gwId},</if>
<if test="gwName != null">#{gwName},</if>
<if test="guid != null">#{guid},</if>
</trim>
</insert>
<insert id="insertBatchDevice" parameterType="com.xinda.iot.domain.Device" useGeneratedKeys="true"
keyProperty="deviceId">
insert into iot_device (device_name, product_id, product_name, tenant_id, tenant_name, serial_number,
firmware_version, rssi, is_shadow, location_way, create_by, create_time,ic_way,iccid,volt,sd,pd,imei, gw_id, gw_name)
firmware_version, rssi, is_shadow, location_way, create_by, create_time,ic_way,iccid,volt,sd,pd,imei, gw_id, gw_name,guid)
values
<foreach collection="deviceList" item="device" separator=",">
(#{device.deviceName},
@@ -959,7 +962,8 @@
#{device.pd}),
#{device.imei}),
#{device.gwId}),
#{device.geName})
#{device.geName}),
#{device.guid})
</foreach>
</insert>
@@ -1004,6 +1008,7 @@
<if test="imei != null">imei = #{imei},</if>
<if test="gwId != null">gw_id = #{gwId},</if>
<if test="gwName != null">gw_name = #{gwName},</if>
<if test="guid != null">guid = #{guid},</if>
</trim>
where device_id = #{deviceId}
</update>
@@ -1085,6 +1090,7 @@
<if test="imei != null">imei = #{imei},</if>
<if test="gwId != null">gw_id = #{gwId},</if>
<if test="gwName != null">gw_name = #{gwName},</if>
<if test="guid != null">guid = #{guid},</if>
</trim>
where serial_number = #{serialNumber}
</update>
@@ -1408,5 +1414,17 @@
where status = 4
and group_id = '0'
</update>
<select id="selectScadaIdByGuid" resultType="Long">
select id
from scada
where guid = #{guid}
</select>
<select id="selectListScadaIdByGuidS" resultType="com.xinda.iot.model.DeviceShortOutput">
select id scadaId, guid
from scada
where guid in
<foreach collection="guidList" item="guid" open="(" separator="," close=")">
#{guid}
</foreach>
</select>
</mapper>