You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.1 KiB

3 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iteaj.iboot.msn.iot.mapper.DeviceModelMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.iteaj.iboot.msn.iot.entity.DeviceModel">
  6. <result column="id" property="id" />
  7. <result column="type_id" property="typeId" />
  8. <result column="model" property="model" />
  9. <result column="type_name" property="typeName" />
  10. <result column="remark" property="remark" />
  11. </resultMap>
  12. <select id="detailOfPage" resultType="com.iteaj.iboot.msn.iot.entity.DeviceModel">
  13. select a.*, idt.name type_name from iot_device_model a
  14. left join iot_device_type idt on a.type_id=idt.id
  15. <where>
  16. <if test="entity.typeId != null">
  17. and find_in_set(#{entity.typeId}, idt.path)
  18. </if>
  19. <if test="entity.model != null">
  20. and a.model like '%${entity.model}%'
  21. </if>
  22. </where>
  23. </select>
  24. </mapper>