Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

49 řádky
1.7 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.KwMeterDataMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.KwMeterData">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="meter_id" jdbcType="BIGINT" property="meteId"/>
  8. <result column="box_id" jdbcType="BIGINT" property="boxId"/>
  9. <result column="address" jdbcType="VARCHAR" property="address"/>
  10. <result column="result" jdbcType="VARCHAR" property="result"/>
  11. <result column="device_time" jdbcType="TIMESTAMP" property="deviceTime"/>
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  13. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`tenant_id`,`meter_id`,`box_id`,`address`,`result`,`device_time`,`create_time`,`update_time`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where 1 = 1
  20. <if test=" null != id ">
  21. and `id` = #{id}
  22. </if>
  23. <if test=" null != tenantId ">
  24. and `tenant_id` = #{tenantId}
  25. </if>
  26. <if test=" null != ids ">
  27. and id in
  28. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  29. #{idItem}
  30. </foreach>
  31. </if>
  32. <if test=" null != sortColumns">order by ${sortColumns}</if>
  33. </sql>
  34. <select id="findList" parameterType="com.iformall.domain.po.KwMeters" resultMap="BaseResultMap">
  35. select
  36. <include refid="allColumns"/>
  37. from kw_box_cmd_history
  38. <include refid="dynamicWhereConditions"/>
  39. </select>
  40. </mapper>