Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

128 righe
5.3 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.WxOfflineActivityGrantAwardMapper">
  6. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOfflineActivityGrantAward">
  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="activityId" column="activity_id" jdbcType="BIGINT"/>
  11. <result property="orderMoneySum" column="order_money_sum" jdbcType="DECIMAL"/>
  12. <result property="orderCount" column="order_count" jdbcType="INTEGER"/>
  13. <result property="cusName" column="cus_name" jdbcType="VARCHAR"/>
  14. <result property="cusPhone" column="cus_phone" jdbcType="VARCHAR"/>
  15. <result property="realName" column="real_name" jdbcType="VARCHAR"/>
  16. <result property="realCard" column="real_card" jdbcType="VARCHAR"/>
  17. <result property="signImg" column="sign_img" jdbcType="VARCHAR"/>
  18. <result property="createBy" column="create_by" jdbcType="BIGINT"/>
  19. <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
  20. <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
  21. <result property="lotteryNum" column="lottery_num" jdbcType="VARCHAR"/>
  22. <result property="lotteryCount" column="lottery_count" jdbcType="INTEGER"/>
  23. <result property="anniversaryLotteryNum" column="anniversary_lottery_num" jdbcType="VARCHAR"/>
  24. </resultMap>
  25. <sql id="allColumns">
  26. id,tenant_id,parent_tenant_id,
  27. activity_id,order_money_sum,order_count,
  28. cus_name,cus_phone,real_name,
  29. real_card,sign_img,create_by,
  30. create_date,update_date,lottery_num,
  31. lottery_count,anniversary_lottery_num
  32. </sql>
  33. <sql id="dynamicWhereConditions">
  34. where 1 = 1
  35. <if test=" null != id ">
  36. and `id` = #{id}
  37. </if>
  38. <if test=" null != tenantId and '' != tenantId">
  39. and `tenant_id` = #{tenantId}
  40. </if>
  41. <if test=" null != parentTenantId and '' != parentTenantId">
  42. and `parent_tenant_id` = #{parentTenantId}
  43. </if>
  44. <if test=" null != activityId">
  45. and `activity_id` = #{activityId}
  46. </if>
  47. <if test=" null != cusName and cusName != '' ">
  48. and `cus_name` like concat('%', #{cusName},'%')
  49. </if>
  50. <if test=" null != cusPhone and cusPhone != '' ">
  51. and `cus_phone` = #{cusPhone}
  52. </if>
  53. <if test=" null != ids ">
  54. and id in
  55. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  56. #{idItem}
  57. </foreach>
  58. </if>
  59. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  60. </sql>
  61. <select id="findList" parameterType="com.iformall.domain.po.WxOfflineActivityGrantAward" resultMap="BaseResultMap">
  62. select <include refid="allColumns" /> from wx_offline_activity_grant_award
  63. <include refid="dynamicWhereConditions" />
  64. </select>
  65. <select id="getCusCount" parameterType="com.iformall.domain.po.WxOfflineActivityGrantAward" resultType="Integer">
  66. SELECT COUNT(DISTINCT cus_phone) FROM wx_offline_activity_grant_award
  67. where 1 = 1
  68. <if test=" null != tenantId and '' != tenantId">
  69. and `tenant_id` = #{tenantId}
  70. </if>
  71. <if test=" null != parentTenantId and '' != parentTenantId">
  72. and `parent_tenant_id` = #{parentTenantId}
  73. </if>
  74. <if test=" null != createDateBegin">
  75. and `create_date` &gt;= #{createDateBegin}
  76. </if>
  77. <if test=" null != createDateEnd">
  78. and `create_date` &lt;= #{createDateEnd}
  79. </if>
  80. </select>
  81. <select id="getRecordIdList" parameterType="com.iformall.domain.po.WxOfflineActivityGrantAward" resultType="Long">
  82. SELECT DISTINCT rg.record_id
  83. from wx_offline_activity_record_grant rg
  84. left join wx_offline_activity_grant_award ga on ga.id = rg.grant_id
  85. where 1 = 1
  86. <if test=" null != tenantId and '' != tenantId">
  87. and ga.`tenant_id` = #{tenantId}
  88. </if>
  89. <if test=" null != parentTenantId and '' != parentTenantId">
  90. and ga.`parent_tenant_id` = #{parentTenantId}
  91. </if>
  92. <if test=" null != createDateBegin">
  93. and ga.`create_date` &gt;= #{createDateBegin}
  94. </if>
  95. <if test=" null != createDateEnd">
  96. and ga.`create_date` &lt;= #{createDateEnd}
  97. </if>
  98. <if test=" null != createByIds ">
  99. and ga.create_by in
  100. <foreach collection="createByIds" index="index" item="sendItem" open="(" separator="," close=")">
  101. #{sendItem}
  102. </foreach>
  103. </if>
  104. </select>
  105. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  106. select <include refid="allColumns" /> from wx_offline_activity_grant_award where id = #{id} and tenant_id=#{tenantId}
  107. </select>
  108. </mapper>