You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

82 lines
4.8 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="INTEGER"/>
  20. <result property="awardMaxAmount" column="award_max_amount" jdbcType="INTEGER"/>
  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="INTEGER"/>
  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. <insert id="insertList" parameterType="java.util.List">
  42. insert into wx_offline_activity_grant_item
  43. (id,tenant_id,parent_tenant_id,
  44. grant_id,activity_id,activity_name,
  45. activity_item_id,activity_item_name,activity_item_type,
  46. award_itam_id,award_name,award_grade,
  47. award_min_amount,award_max_amount,awards_item_rule,cash_back_ratio,
  48. award_price,award_count,money_rule,
  49. mall_share_rate,merchant_share_rate,
  50. create_date,update_date)
  51. values
  52. <foreach collection="grantItemList" item="item" index="index" separator=",">
  53. (#{item.id,jdbcType=BIGINT},#{item.tenantId,jdbcType=VARCHAR},#{item.parentTenantId,jdbcType=VARCHAR},
  54. #{item.grantId,jdbcType=BIGINT},#{item.activityId,jdbcType=BIGINT},#{item.activityName,jdbcType=VARCHAR},
  55. #{item.activityItemId,jdbcType=BIGINT},#{item.activityItemName,jdbcType=VARCHAR},#{item.activityItemType,jdbcType=INTEGER},
  56. #{item.awardItamId,jdbcType=BIGINT},#{item.awardName,jdbcType=VARCHAR},#{item.awardGrade,jdbcType=INTEGER},
  57. #{item.awardMinAmount,jdbcType=INTEGER},#{item.awardMaxAmount,jdbcType=INTEGER},#{item.awardsItemRule,jdbcType=INTEGER},#{item.cashBackRatio,jdbcType=DECIMAL},
  58. #{item.awardPrice,jdbcType=INTEGER},#{item.awardCount,jdbcType=INTEGER},#{item.moneyRule,jdbcType=INTEGER},
  59. #{item.mallShareRate,jdbcType=DECIMAL},#{item.merchantShareRate,jdbcType=DECIMAL},
  60. #{item.createDate,jdbcType=TIMESTAMP},#{item.updateDate,jdbcType=TIMESTAMP})
  61. </foreach>
  62. </insert>
  63. <select id="getSumAwardCount" parameterType="com.iformall.domain.po.WxOfflineActivityGrantItem" resultType="Integer">
  64. SELECT COUNT(1) FROM wx_offline_activity_grant_item
  65. where 1 = 1
  66. <if test=" null != tenantId and '' != tenantId">
  67. and tenant_id = #{tenantId}
  68. </if>
  69. <if test=" null != parentTenantId and '' != parentTenantId">
  70. and parent_tenant_id = #{parentTenantId}
  71. </if>
  72. <if test=" null != activityId ">
  73. and activity_id = #{activityId}
  74. </if>
  75. </select>
  76. </mapper>