選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

86 行
4.2 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.WxEnergyMeterReadingMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyMeterReading">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  9. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  10. <result column="cur_number" jdbcType="VARCHAR" property="curNumber"/>
  11. <result column="pre_number" jdbcType="VARCHAR" property="preNumber"/>
  12. <result column="pre_time" jdbcType="TIMESTAMP" property="preTime"/>
  13. <result column="pre_by" jdbcType="BIGINT" property="preBy"/>
  14. <result column="pre_by_name" jdbcType="VARCHAR" property="preByName"/>
  15. <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
  16. <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  17. <result column="create_by" jdbcType="BIGINT" property="createBy"/>
  18. <result column="create_by_name" jdbcType="VARCHAR" property="createByName"/>
  19. <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
  20. <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/>
  21. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  22. <result column="meter_id" jdbcType="BIGINT" property="meterId"/>
  23. <result column="meter_type" jdbcType="INTEGER" property="meterType"/>
  24. <result column="meter_rate" jdbcType="VARCHAR" property="meterRate"/>
  25. <result column="meter_name" jdbcType="VARCHAR" property="meterName"/>
  26. <result column="is_del" jdbcType="INTEGER" property="isDel"/>
  27. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  28. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  29. <result column="shop_name" jdbcType="VARCHAR" property="shopName"/>
  30. </resultMap>
  31. <sql id="allColumns">
  32. `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`cur_number`,`pre_number`,`pre_time`,`pre_by`,`pre_by_name`,`start_time`,`end_time`,`create_by`,`create_by_name`,
  33. `update_by`,`update_by_name`,`remark`,`meter_id`,`meter_type`,`meter_rate`,`meter_name`,`is_del`,`building_name`,`floor_name`,`shop_name`
  34. </sql>
  35. <sql id="dynamicWhereConditions">
  36. where 1=1
  37. <if test=" null != id ">and `id` = #{id}</if>
  38. <if test=" null != tenantId and '' != tenantId">
  39. and `tenant_id` = #{tenantId}
  40. </if>
  41. <if test=" null != parentTenantId and '' != parentTenantId">
  42. and `parent_tenant_id` = #{parentTenantId}
  43. </if>
  44. <if test=" null != createBy ">and `create_by` = #{createBy}</if>
  45. <if test=" null != meterId ">and `meter_id` = #{meterId}</if>
  46. <if test=" null != meterType ">and `meter_type` = #{meterType}</if>
  47. <if test=" null != meterName and '' != meterName ">and meter_name like concat('%', #{meterName},'%')</if>
  48. <if test=" null != isDel ">and `is_del` = #{isDel}</if>
  49. <if test=" null != createByName and '' != createByName ">and create_by_name like concat('%', #{createByName},'%')</if>
  50. <if test=" null != shopIds ">
  51. and shop_id in
  52. <foreach collection="shopIds" index="index" item="sidItem" open="(" separator="," close=")">
  53. #{sidItem}
  54. </foreach>
  55. </if>
  56. <if test=" null != ids ">
  57. and id in
  58. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  59. #{idItem}
  60. </foreach>
  61. </if>
  62. <if test=" null != sortColumns">order by ${sortColumns}</if>
  63. </sql>
  64. <select id="findList" parameterType="com.iformall.domain.po.WxEnergyMeterReading" resultMap="BaseResultMap">
  65. select
  66. <include refid="allColumns"/>
  67. from wx_energy_meter_reading
  68. <include refid="dynamicWhereConditions"/>
  69. </select>
  70. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  71. select
  72. <include refid="allColumns"/>
  73. from wx_energy_meter_reading where id = #{id} and `tenant_id` = #{tenantId}
  74. </select>
  75. <update id = "setIsDel" parameterType="HashMap">
  76. update wx_energy_meter_reading set is_del = #{isDel} where id = #{id} and `tenant_id` = #{tenantId}
  77. </update>
  78. </mapper>