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.
 
 
 
 
 

82 satır
3.4 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.WxEnergyReadingCalcuteResultMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyReadingCalcuteResult">
  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="calcute_id" jdbcType="BIGINT" property="calcuteId"/>
  11. <result column="shop_id" jdbcType="BIGINT" property="shopId"/>
  12. <result column="fees_id" jdbcType="BIGINT" property="feesId"/>
  13. <result column="fees_shop_id" jdbcType="BIGINT" property="feesShopId"/>
  14. <result column="money" jdbcType="VARCHAR" property="money" />
  15. <result column="period" jdbcType="VARCHAR" property="period" />
  16. <result column="money_deail" jdbcType="VARCHAR" property="moneyDeail" />
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`calcute_id`,`shop_id`,`fees_id`,`fees_shop_id`,`money`,`period`,`money_deail`
  20. </sql>
  21. <sql id="dynamicWhereConditions">
  22. where 1=1
  23. <if test=" null != id ">and `id` = #{id}</if>
  24. <if test=" null != tenantId and '' != tenantId">
  25. and `tenant_id` = #{tenantId}
  26. </if>
  27. <if test=" null != parentTenantId and '' != parentTenantId">
  28. and `parent_tenant_id` = #{parentTenantId}
  29. </if>
  30. <if test=" null != period and '' != period">
  31. and `period` = #{period}
  32. </if>
  33. <if test=" null != calcuteId ">and `calcute_id` = #{calcuteId}</if>
  34. <if test=" null != shopId ">and `shop_id` = #{shopId}</if>
  35. <if test=" null != feesId ">and `fees_id` = #{feesId}</if>
  36. <if test=" null != feesShopId ">and `fees_shop_id` = #{feesShopId}</if>
  37. <if test=" null != ids ">
  38. and id in
  39. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  40. #{idItem}
  41. </foreach>
  42. </if>
  43. <if test=" null != sortColumns">order by ${sortColumns}</if>
  44. </sql>
  45. <select id="findList" parameterType="com.iformall.domain.po.WxEnergyReadingCalcuteResult" resultMap="BaseResultMap">
  46. select
  47. <include refid="allColumns"/>
  48. from wx_energy_reading_calcute_result
  49. <include refid="dynamicWhereConditions"/>
  50. </select>
  51. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  52. select
  53. <include refid="allColumns"/>
  54. from wx_energy_reading_calcute_result where id = #{id} and `tenant_id` = #{tenantId}
  55. </select>
  56. <select id="findShopIdList" parameterType="com.iformall.domain.po.WxEnergyReadingCalcuteResult" resultType="Long">
  57. select distinct shop_id
  58. from wx_energy_reading_calcute_result
  59. <include refid="dynamicWhereConditions"/>
  60. </select>
  61. <insert id="insertResults" parameterType="HashMap">
  62. INSERT INTO wx_energy_reading_calcute_result (
  63. <include refid="allColumns"/>
  64. )
  65. VALUES
  66. <foreach collection="list" item="item" index="index" separator=",">
  67. (
  68. #{item.id},#{item.tenantId},#{item.parentTenantId},#{item.createTime},#{item.updateTime},#{item.calcuteId},
  69. #{item.shopId},#{item.feesId},#{item.feesShopId},#{item.money},#{item.period},#{item.moneyDeail}
  70. )
  71. </foreach>
  72. </insert>
  73. </mapper>