| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?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.middle.platform.manage.biz.mapper.IotProductMapper">
- <resultMap id="BaseResultMap" type="com.middle.platform.manage.biz.entity.IotProduct">
- <!--@mbg.generated-->
- <!--@Table iot_product-->
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="code" jdbcType="VARCHAR" property="code"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="secret" jdbcType="VARCHAR" property="secret"/>
- <result column="node_type" jdbcType="TINYINT" property="nodeType"/>
- <result column="network_type" jdbcType="TINYINT" property="networkType"/>
- <result column="report_protocol" jdbcType="TINYINT" property="reportProtocol"/>
- <result column="vendors" jdbcType="TINYINT" property="vendors"/>
- <result column="data_format" jdbcType="TINYINT" property="dataFormat"/>
- <result column="auth_type" jdbcType="TINYINT" property="authType"/>
- <result column="tag" jdbcType="VARCHAR" property="tag"/>
- <result column="size" jdbcType="INTEGER" property="size"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="create_by" jdbcType="BIGINT" property="createBy"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
- <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime"/>
- <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id,
- code,
- `name`,
- secret,
- node_type,
- network_type,
- report_protocol,
- data_format,
- vendors,
- auth_type,
- tag,
- `size`,
- remark,
- create_by,
- create_time,
- update_by,
- update_time,
- delete_time,
- del_flag
- </sql>
- <select id="pageQuery" resultType="com.middle.platform.manage.biz.domain.vo.IotProductVo">
- select *
- from iot_product ip
- <where>
- <if test="keywords != null and keywords != ''">
- and ip.name like concat('%', #{keywords,jdbcType=VARCHAR}, '%')
- </if>
- and ip.del_flag = 0
- </where>
- </select>
- <select id="list" resultType="com.middle.platform.manage.biz.domain.vo.IotProductDownVo">
- select ip.id, ip.name, ip.code
- from iot_product ip
- <where>
- and ip.del_flag = 0
- </where>
- </select>
- <select id="selectProduct" resultType="com.middle.platform.manage.api.pojo.ProductVo">
- select ip.id,
- ip.code,
- ip.data_format,
- id.guid
- from iot_product ip
- inner join iot_device id on ip.id = id.product_id and id.del_flag = 0
- <where>
- <if test="productKey != null and productKey != ''">
- and ip.code = #{productKey,jdbcType=VARCHAR}
- </if>
- <if test="deviceSn != null and deviceSn != ''">
- and id.sn = #{deviceSn,jdbcType=VARCHAR}
- </if>
- and ip.del_flag = 0
- </where>
- </select>
- <select id="queryProductTopic" resultType="com.middle.platform.manage.api.pojo.TopicVo">
- select iu.url, iu.permission, iu.func
- from iot_product ip
- inner join iot_url iu on ip.id = iu.product_id and iu.del_flag = 0
- <where>
- <if test="type != null">
- and iu.type = #{type,jdbcType=INTEGER}
- </if>
- and iu.permission in (1, 3)
- and ip.del_flag = 0
- </where>
- </select>
- </mapper>
|