2024-12-09 18:08:42 +08:00
|
|
|
<?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">
|
2024-12-10 15:22:07 +08:00
|
|
|
<mapper namespace="com.zsc.edu.gateway.modules.iot.device.repo.DeviceRepository">
|
2024-12-12 14:37:08 +08:00
|
|
|
<resultMap id="BaseResultMap" type="com.zsc.edu.gateway.modules.iot.device.vo.DeviceVo">
|
2024-12-09 18:08:42 +08:00
|
|
|
<id column="id" property="id"/>
|
|
|
|
<result column="name" property="name"/>
|
|
|
|
<result column="online" property="online"/>
|
|
|
|
<result column="state" property="state"/>
|
|
|
|
<result column="hardware_version" property="hardwareVersion"/>
|
|
|
|
<result column="firmware_version" property="firmwareVersion"/>
|
|
|
|
<result column="factory_id" property="factoryId"/>
|
|
|
|
<result column="client_id" property="clientId"/>
|
|
|
|
<result column="product_id" property="productId"/>
|
2025-01-09 17:28:33 +08:00
|
|
|
<result column="extend_params" property="extendParams" jdbcType="VARCHAR"
|
|
|
|
typeHandler="com.zsc.edu.gateway.framework.json.JsonbTypeHandler"/>
|
|
|
|
<result column="properties" property="properties" jdbcType="VARCHAR"
|
|
|
|
typeHandler="com.zsc.edu.gateway.framework.json.JsonbTypeHandler"/>
|
2024-12-12 14:37:08 +08:00
|
|
|
<result column="create_by" jdbcType="VARCHAR" property="deviceCreateBy"/>
|
|
|
|
<result column="update_by" jdbcType="VARCHAR" property="deviceUpdateBy"/>
|
|
|
|
<result column="create_time" jdbcType="DATE" property="deviceCreateTime"/>
|
|
|
|
<result column="update_time" jdbcType="DATE" property="deviceUpdateTime"/>
|
|
|
|
<result column="remark" jdbcType="VARCHAR" property="deviceRemark"/>
|
2025-02-28 17:23:22 +08:00
|
|
|
<result column="longitude" jdbcType="DOUBLE" property="longitude"/>
|
|
|
|
<result column="latitude" jdbcType="DOUBLE" property="latitude"/>
|
|
|
|
<result column="icon" jdbcType="VARCHAR" property="icon"/>
|
2025-01-08 10:17:44 +08:00
|
|
|
<result column="name" property="productName"/>
|
2024-12-17 14:29:37 +08:00
|
|
|
<result column="product_type" jdbcType="VARCHAR" property="productType"/>
|
2024-12-12 14:37:08 +08:00
|
|
|
<result column="model" property="model"/>
|
|
|
|
<result column="link" property="link"/>
|
2024-12-10 15:22:07 +08:00
|
|
|
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
|
|
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
|
|
|
<result column="create_time" jdbcType="DATE" property="createTime"/>
|
|
|
|
<result column="update_time" jdbcType="DATE" property="updateTime"/>
|
|
|
|
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
2024-12-12 14:37:08 +08:00
|
|
|
<collection property="params" ofType="com.zsc.edu.gateway.modules.iot.tsl.entity.Param" autoMapping="true"
|
|
|
|
columnPrefix="param_">
|
2024-12-10 15:22:07 +08:00
|
|
|
<id column="id" property="id"/>
|
2024-12-12 14:37:08 +08:00
|
|
|
<result column="data_type" property="dataType"/>
|
|
|
|
<result column="uint" property="uint"/>
|
2024-12-10 15:22:07 +08:00
|
|
|
<result column="type" property="type"/>
|
2024-12-12 14:37:08 +08:00
|
|
|
<result column="identifier" property="identifier"/>
|
|
|
|
<result column="name" property="name"/>
|
|
|
|
<result column="remark" property="remark"/>
|
|
|
|
</collection>
|
2024-12-09 18:08:42 +08:00
|
|
|
</resultMap>
|
2024-12-10 15:22:07 +08:00
|
|
|
|
2024-12-12 14:37:08 +08:00
|
|
|
<select id="findById" resultMap="BaseResultMap">
|
|
|
|
select d.*,
|
|
|
|
p.*,
|
|
|
|
ip.id as param_id,
|
|
|
|
ip.data_type as param_data_type,
|
|
|
|
ip.uint as param_uint,
|
|
|
|
ip.type as param_type,
|
|
|
|
ip.identifier as param_identifier,
|
|
|
|
ip.name as param_name,
|
|
|
|
ip.remark as param_remark
|
|
|
|
from iot_device d
|
2024-12-10 15:22:07 +08:00
|
|
|
left join iot_product p on d.product_id = p.id
|
2025-01-08 10:09:54 +08:00
|
|
|
left join iot_param ip on p.id = ip.foreign_id and ip.foreign_type = 3
|
2024-12-12 14:37:08 +08:00
|
|
|
where d.id = #{id}
|
2024-12-10 15:22:07 +08:00
|
|
|
</select>
|
|
|
|
|
2024-12-09 18:08:42 +08:00
|
|
|
</mapper>
|