<?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.usky.iot.mapper.DmpDeviceTypeMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.usky.iot.domain.DmpDeviceType">
        <id column="id" property="id" />
        <result column="type_code" property="typeCode" />
        <result column="type_abbrevia" property="typeAbbrevia" />
        <result column="type_name" property="typeName" />
        <result column="type_domain" property="typeDomain" />
        <result column="type_img" property="typeImg" />
        <result column="data_field" property="dataField" />
        <result column="type_desc" property="typeDesc" />
        <result column="tenant_id" property="tenantId" />
        <result column="created_by" property="createdBy" />
        <result column="created_time" property="createdTime" />
        <result column="updated_by" property="updatedBy" />
        <result column="updated_time" property="updatedTime" />
    </resultMap>
    <select id="getProductInfo" resultType="com.usky.iot.domain.DmpProductInfo">
        select
        distinct device_type
        from dmp_product
        <where>
            <if test="tenantId != null">
                and tenant_id = #{tenantId}
            </if>
            <if test="1 == 1">
                and delete_flag = 0
            </if>
        </where>
    </select>
    <select id="getProductInfoList" resultType="com.usky.iot.domain.DmpProductInfo">
        select *
        from dmp_product
        <where>
            <if test="typeCode != null">
                and device_type = #{typeCode}
            </if>
            <if test="1 == 1">
                and delete_flag = 0
            </if>
        </where>
    </select>

</mapper>
