2024-12-10 15:22:07 +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">
|
|
|
|
<mapper namespace="com.zsc.edu.gateway.modules.iot.product.repo.ProductRepository">
|
|
|
|
<resultMap id="BaseResultMap" type="com.zsc.edu.gateway.modules.iot.product.entity.Product">
|
|
|
|
<id column="id" property="id"/>
|
2024-12-12 14:37:08 +08:00
|
|
|
<result column="dept_id" property="deptId"/>
|
2024-12-10 15:22:07 +08:00
|
|
|
<result column="name" property="name"/>
|
2024-12-17 14:29:37 +08:00
|
|
|
<result column="type_string" property="productType"/>
|
2024-12-10 15:22:07 +08:00
|
|
|
<result column="model" property="model"/>
|
|
|
|
<result column="link" property="link"/>
|
|
|
|
<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"/>
|
|
|
|
<result column="data_type" property="dataType"/>
|
|
|
|
<result column="uint" property="uint"/>
|
|
|
|
<result column="type" property="type"/>
|
|
|
|
<result column="identifier" property="identifier"/>
|
|
|
|
<result column="name" property="name"/>
|
|
|
|
<result column="remark" property="remark"/>
|
|
|
|
</collection>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="selectById" resultMap="BaseResultMap">
|
2024-12-12 14:37:08 +08:00
|
|
|
select 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
|
2024-12-10 15:22:07 +08:00
|
|
|
from iot_product p
|
|
|
|
left join iot_product_param pp on p.id = pp.product_id
|
|
|
|
left join iot_param ip on pp.param_id = ip.id
|
|
|
|
where p.id = #{id}
|
|
|
|
</select>
|
|
|
|
</mapper>
|