Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

96 rindas
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.TtPoiTakeRateMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtPoiTakeRate">
  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="coupon_id" jdbcType="BIGINT" property="couponId"/>
  9. <result column="type" jdbcType="INTEGER" property="type"/>
  10. <result column="name" jdbcType="VARCHAR" property="name"/>
  11. <result column="content_type" jdbcType="INTEGER" property="contentType"/>
  12. <result column="douyin_id" jdbcType="VARCHAR" property="douyinId" />
  13. <result column="take_rate" jdbcType="INTEGER" property="takeRate"/>
  14. <result column="status" jdbcType="INTEGER" property="status"/>
  15. <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
  16. <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  17. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  18. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  19. </resultMap>
  20. <sql id="allColumns">
  21. `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,
  22. `type`,`name`,`content_type`,
  23. `douyin_id`,`take_rate`,`status`,
  24. `start_time`,`end_time`,`create_date`,`update_date`
  25. </sql>
  26. <sql id="dynamicWhereConditions">
  27. where 1 = 1
  28. <if test=" null != id ">
  29. and `id` = #{id}
  30. </if>
  31. <if test=" null != tenantId and '' != tenantId">
  32. and `tenant_id` = #{tenantId}
  33. </if>
  34. <if test=" null != parentTenantId and '' != parentTenantId">
  35. and `parent_tenant_id` = #{parentTenantId}
  36. </if>
  37. <if test=" null != couponId ">
  38. and `coupon_id` = #{couponId}
  39. </if>
  40. <if test=" null != type ">
  41. and `type` = #{type}
  42. </if>
  43. <if test=" null != name and '' != name">
  44. and `name` = #{name}
  45. </if>
  46. <if test=" null != douyinId and '' != douyinId">
  47. and `douyin_id` = #{douyinId}
  48. </if>
  49. <if test=" null != contentType ">
  50. and `content_type` = #{contentType}
  51. </if>
  52. <if test=" null != status ">
  53. and `status` = #{status}
  54. </if>
  55. <if test=" null != ids ">
  56. and id in
  57. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  58. #{idItem}
  59. </foreach>
  60. </if>
  61. <if test=" null != sortColumns">order by ${sortColumns}</if>
  62. </sql>
  63. <select id="selectByCouponAndDouyin" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  64. select <include refid="allColumns"/>
  65. from tt_poi_take_rate
  66. where tenant_id = #{tenantId}
  67. and `coupon_id` = #{couponId}
  68. and `type` = #{type}
  69. and `douyin_id` = #{douyinId}
  70. </select>
  71. <select id="findList" parameterType="com.iformall.domain.po.TtPoiTakeRate" resultMap="BaseResultMap">
  72. select
  73. <include refid="allColumns"/>
  74. from tt_poi_take_rate
  75. <include refid="dynamicWhereConditions"/>
  76. </select>
  77. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  78. select <include refid="allColumns" /> from tt_poi_take_rate where id = #{id} and tenant_id=#{tenantId}
  79. </select>
  80. </mapper>