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.
 
 
 
 
 

75 lines
2.5 KiB

  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.iformall.mapper.KwBoxMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.KwBox">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="name"/>
  7. <result column="imei" jdbcType="BIGINT" property="imei"/>
  8. <result column="iccid" jdbcType="VARCHAR" property="iccid"/>
  9. <result column="place" jdbcType="VARCHAR" property="place"/>
  10. <result column="fw_version" jdbcType="VARCHAR" property="fwVersion"/>
  11. <result column="hd_version" jdbcType="VARCHAR" property="hdVersion"/>
  12. <result column="status" jdbcType="INTEGER" property="status"/>
  13. <result column="online" jdbcType="INTEGER" property="online"/>
  14. <result column="register_time" jdbcType="TIMESTAMP" property="registerTime"/>
  15. <result column="last_online_time" jdbcType="TIMESTAMP" property="lastOnlineTime"/>
  16. <result column="config" jdbcType="VARCHAR" property="config"/>
  17. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  18. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  19. </resultMap>
  20. <sql id="allColumns">
  21. `id`,`tenant_id`,`imei`,`iccid`,`place`,`fw_version`,`hd_version`,`status`,`online`,`register_time`,
  22. `last_online_time`,`config`,`create_time`,`update_time`
  23. </sql>
  24. <sql id="dynamicWhereConditions">
  25. where 1 = 1
  26. <if test=" null != id ">
  27. and `id` = #{id}
  28. </if>
  29. <if test=" null != tenantId ">
  30. and `tenant_id` = #{tenantId}
  31. </if>
  32. <if test=" null != imei and '' != imei ">
  33. and `imei` like concat('%', #{imei},'%')
  34. </if>
  35. <if test=" null != iccid and '' != iccid ">
  36. and `iccid` like concat('%', #{iccid},'%')
  37. </if>
  38. <if test=" null != place and '' != place ">
  39. and `place` like concat('%', #{place},'%')
  40. </if>
  41. <if test=" null != status ">
  42. and `status` = #{status}
  43. </if>
  44. <if test=" null != tenantId ">
  45. and `online` = #{online}
  46. </if>
  47. <if test=" null != ids ">
  48. and id in
  49. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  50. #{idItem}
  51. </foreach>
  52. </if>
  53. <if test=" null != sortColumns">order by ${sortColumns}</if>
  54. </sql>
  55. <select id="findList" parameterType="com.iformall.domain.po.KwBox" resultMap="BaseResultMap">
  56. select
  57. <include refid="allColumns"/>
  58. from kw_box
  59. <include refid="dynamicWhereConditions"/>
  60. </select>
  61. </mapper>