25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

109 satır
3.6 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.WxDeviceMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxDevice">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="device_id" jdbcType="VARCHAR" property="deviceId"/>
  8. <result column="version" jdbcType="VARCHAR" property="version"/>
  9. <result column="location" jdbcType="VARCHAR" property="location"/>
  10. <result column="name" jdbcType="VARCHAR" property="name"/>
  11. <result column="type" jdbcType="INTEGER" property="type"/>
  12. <result column="status" jdbcType="INTEGER" property="status"/>
  13. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  14. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  15. <result column="online_status" jdbcType="INTEGER" property="onlineStatus"/>
  16. <result column="first_hb_time" jdbcType="TIMESTAMP" property="firstHbTime"/>
  17. <result column="last_hb_time" jdbcType="TIMESTAMP" property="lastHbTime"/>
  18. <result column="hb_cmd" jdbcType="INTEGER" property="hbCmd"/>
  19. <result column="config" jdbcType="VARCHAR" property="config"/>
  20. </resultMap>
  21. <sql id="allColumns">
  22. `id`, `tenant_id`, `device_id`, `type`, `status`, `location`, `name`, `version`, `create_date`, `update_date`, `online_status`, `first_hb_time`, `last_hb_time`, `hb_cmd`, `config`
  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 != deviceId ">
  33. and `device_id` = #{deviceId}
  34. </if>
  35. <if test=" null != version ">
  36. and `version` like concat('%', #{version},'%')
  37. </if>
  38. <if test=" null != location ">
  39. and `location` like concat('%', #{location},'%')
  40. </if>
  41. <if test=" null != name ">
  42. and `name` like concat('%', #{name},'%')
  43. </if>
  44. <if test=" null != type ">
  45. and `type` = #{type}
  46. </if>
  47. <if test=" null != status ">
  48. and `status` = #{status}
  49. </if>
  50. <if test=" null != createDate ">
  51. and `create_date` = #{createDate}
  52. </if>
  53. <if test=" null != updateDate ">
  54. and `update_date` = #{updateDate}
  55. </if>
  56. <if test=" null != onlineStatus ">
  57. and `online_status` = #{onlineStatus}
  58. </if>
  59. <if test=" null != firstHbTime ">
  60. and `first_hb_time` = #{firstHbTime}
  61. </if>
  62. <if test=" null != lastHbTime ">
  63. and `last_hb_time` = #{lastHbTime}
  64. </if>
  65. <if test=" null != hbCmd ">
  66. and `hb_cmd` = #{hbCmd}
  67. </if>
  68. <if test=" null != config ">
  69. and `config` = #{config}
  70. </if>
  71. <if test=" null != ids ">
  72. and id in
  73. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  74. #{idItem}
  75. </foreach>
  76. </if>
  77. <if test=" null != sortColumns">order by ${sortColumns}</if>
  78. </sql>
  79. <select id="findList" parameterType="com.iformall.domain.po.WxDevice" resultMap="BaseResultMap">
  80. select
  81. <include refid="allColumns"/>
  82. from wx_device
  83. <include refid="dynamicWhereConditions"/>
  84. </select>
  85. </mapper>