25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

124 lines
6.1 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.iformall.mapper.WxOfflineActivityGrantItemMapper">
  6. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOfflineActivityGrantItem">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/>
  9. <result property="parentTenantId" column="parent_tenant_id" jdbcType="VARCHAR"/>
  10. <result property="grantId" column="grant_id" jdbcType="BIGINT"/>
  11. <result property="activityId" column="activity_id" jdbcType="BIGINT"/>
  12. <result property="activityName" column="activity_name" jdbcType="VARCHAR"/>
  13. <result property="activityItemId" column="activity_item_id" jdbcType="BIGINT"/>
  14. <result property="activityItemName" column="activity_item_name" jdbcType="INTEGER"/>
  15. <result property="activityItemType" column="activity_item_type" jdbcType="SMALLINT"/>
  16. <result property="awardItamId" column="award_itam_id" jdbcType="BIGINT"/>
  17. <result property="awardName" column="award_name" jdbcType="VARCHAR"/>
  18. <result property="awardGrade" column="award_grade" jdbcType="INTEGER"/>
  19. <result property="awardMinAmount" column="award_min_amount" jdbcType="DECIMAL"/>
  20. <result property="awardMaxAmount" column="award_max_amount" jdbcType="DECIMAL"/>
  21. <result property="awardsItemRule" column="awards_item_rule" jdbcType="INTEGER"/>
  22. <result property="cashBackRatio" column="cash_back_ratio" jdbcType="DECIMAL"/>
  23. <result property="awardPrice" column="award_price" jdbcType="DECIMAL"/>
  24. <result property="awardCount" column="award_count" jdbcType="INTEGER"/>
  25. <result property="moneyRule" column="money_rule" jdbcType="SMALLINT"/>
  26. <result property="mallShareRate" column="mall_share_rate" jdbcType="DECIMAL"/>
  27. <result property="merchantShareRate" column="merchant_share_rate" jdbcType="DECIMAL"/>
  28. <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
  29. <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
  30. </resultMap>
  31. <sql id="allColumns">
  32. id,tenant_id,parent_tenant_id,
  33. grant_id,activity_id,activity_name,
  34. activity_item_id,activity_item_name,activity_item_type,
  35. award_itam_id,award_name,award_grade,
  36. award_min_amount,award_max_amount,awards_item_rule,cash_back_ratio,
  37. award_price,award_count,money_rule,
  38. mall_share_rate,merchant_share_rate,
  39. create_date,update_date
  40. </sql>
  41. <sql id="dynamicWhereConditions">
  42. where 1 = 1
  43. <if test=" null != id ">
  44. and `id` = #{id}
  45. </if>
  46. <if test=" null != tenantId and '' != tenantId">
  47. and `tenant_id` = #{tenantId}
  48. </if>
  49. <if test=" null != parentTenantId and '' != parentTenantId">
  50. and `parent_tenant_id` = #{parentTenantId}
  51. </if>
  52. <if test=" null != grantId">
  53. and `grant_id` = #{grantId}
  54. </if>
  55. <if test=" null != activityId">
  56. and `activity_id` = #{activityId}
  57. </if>
  58. <if test=" null != activityItemId">
  59. and `activity_item_id` = #{activityItemId}
  60. </if>
  61. <if test=" null != awardItamId">
  62. and `award_itam_id` = #{awardItamId}
  63. </if>
  64. <if test=" null != ids ">
  65. and id in
  66. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  67. #{idItem}
  68. </foreach>
  69. </if>
  70. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  71. </sql>
  72. <select id="findList" parameterType="com.iformall.domain.po.WxOfflineActivityGrantItem" resultMap="BaseResultMap">
  73. select <include refid="allColumns" /> from wx_offline_activity_grant_item
  74. <include refid="dynamicWhereConditions" />
  75. </select>
  76. <insert id="insertList" parameterType="java.util.List">
  77. insert into wx_offline_activity_grant_item
  78. (id,tenant_id,parent_tenant_id,
  79. grant_id,activity_id,activity_name,
  80. activity_item_id,activity_item_name,activity_item_type,
  81. award_itam_id,award_name,award_grade,
  82. award_min_amount,award_max_amount,awards_item_rule,cash_back_ratio,
  83. award_price,award_count,money_rule,
  84. mall_share_rate,merchant_share_rate,
  85. create_date,update_date)
  86. values
  87. <foreach collection="grantItemList" item="item" index="index" separator=",">
  88. (#{item.id,jdbcType=BIGINT},#{item.tenantId,jdbcType=VARCHAR},#{item.parentTenantId,jdbcType=VARCHAR},
  89. #{item.grantId,jdbcType=BIGINT},#{item.activityId,jdbcType=BIGINT},#{item.activityName,jdbcType=VARCHAR},
  90. #{item.activityItemId,jdbcType=BIGINT},#{item.activityItemName,jdbcType=VARCHAR},#{item.activityItemType,jdbcType=INTEGER},
  91. #{item.awardItamId,jdbcType=BIGINT},#{item.awardName,jdbcType=VARCHAR},#{item.awardGrade,jdbcType=INTEGER},
  92. #{item.awardMinAmount,jdbcType=DECIMAL},#{item.awardMaxAmount,jdbcType=DECIMAL},#{item.awardsItemRule,jdbcType=INTEGER},#{item.cashBackRatio,jdbcType=DECIMAL},
  93. #{item.awardPrice,jdbcType=DECIMAL},#{item.awardCount,jdbcType=INTEGER},#{item.moneyRule,jdbcType=INTEGER},
  94. #{item.mallShareRate,jdbcType=DECIMAL},#{item.merchantShareRate,jdbcType=DECIMAL},
  95. #{item.createDate,jdbcType=TIMESTAMP},#{item.updateDate,jdbcType=TIMESTAMP})
  96. </foreach>
  97. </insert>
  98. <select id="getSumAwardCount" parameterType="com.iformall.domain.po.WxOfflineActivityGrantItem" resultType="Integer">
  99. SELECT COUNT(1) FROM wx_offline_activity_grant_item
  100. where 1 = 1
  101. <if test=" null != tenantId and '' != tenantId">
  102. and tenant_id = #{tenantId}
  103. </if>
  104. <if test=" null != parentTenantId and '' != parentTenantId">
  105. and parent_tenant_id = #{parentTenantId}
  106. </if>
  107. <if test=" null != activityId ">
  108. and activity_id = #{activityId}
  109. </if>
  110. </select>
  111. </mapper>