Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

87 wiersze
3.3 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.WxEnergyFeesTimeShopMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyFeesTimeShop">
  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="period" jdbcType="VARCHAR" property="period"/>
  11. <result column="time_id" jdbcType="BIGINT" property="timeId"/>
  12. <result column="shop_id" jdbcType="BIGINT" property="shopId"/>
  13. <result column="type" jdbcType="INTEGER" property="type"/>
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`period`,`time_id`,`shop_id`,`type`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where 1=1
  20. <if test=" null != id ">and `id` = #{id}</if>
  21. <if test=" null != tenantId and '' != tenantId">
  22. and `tenant_id` = #{tenantId}
  23. </if>
  24. <if test=" null != parentTenantId and '' != parentTenantId">
  25. and `parent_tenant_id` = #{parentTenantId}
  26. </if>
  27. <if test=" null != period and '' != period">
  28. and `period` = #{period}
  29. </if>
  30. <if test=" null != type ">and `type` = #{type}</if>
  31. <if test=" null != timeId ">and `time_id` = #{timeId}</if>
  32. <if test=" null != shopId ">and `shop_id` = #{shopId}</if>
  33. <if test=" null != shopIds ">
  34. and shop_id in
  35. <foreach collection="shopIds" index="index" item="sidItem" open="(" separator="," close=")">
  36. #{sidItem}
  37. </foreach>
  38. </if>
  39. <if test=" null != ids ">
  40. and id in
  41. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  42. #{idItem}
  43. </foreach>
  44. </if>
  45. <if test=" null != sortColumns">order by ${sortColumns}</if>
  46. </sql>
  47. <select id="findList" parameterType="com.iformall.domain.po.WxEnergyFeesTimeShop" resultMap="BaseResultMap">
  48. select
  49. <include refid="allColumns"/>
  50. from wx_energy_fees_time_shop
  51. <include refid="dynamicWhereConditions"/>
  52. </select>
  53. <select id="findCount" parameterType="com.iformall.domain.po.WxEnergyFeesTimeShop" resultType="Integer">
  54. select count(1)
  55. from wx_energy_fees_time_shop
  56. <include refid="dynamicWhereConditions"/>
  57. </select>
  58. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  59. select
  60. <include refid="allColumns"/>
  61. from wx_energy_fees_time_shop where id = #{id} and `tenant_id` = #{tenantId}
  62. </select>
  63. <delete id="deleteByTimeId" parameterType="HashMap">
  64. delete from wx_energy_fees_time_shop where `tenant_id` = #{tenantId} and `time_id` = #{timeId}
  65. </delete>
  66. <select id="findShopIdList" parameterType="com.iformall.domain.po.WxEnergyFeesTimeShop" resultType="Long">
  67. select distinct shop_id
  68. from wx_energy_fees_time_shop
  69. <include refid="dynamicWhereConditions"/>
  70. </select>
  71. <select id="findTimeIdList" parameterType="com.iformall.domain.po.WxEnergyFeesTimeShop" resultType="Long">
  72. select distinct time_id
  73. from wx_energy_fees_time_shop
  74. <include refid="dynamicWhereConditions"/>
  75. </select>
  76. </mapper>