Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

168 Zeilen
6.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.WxLegionActivityUserMapper">
  6. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLegionActivityUser">
  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="phone" column="phone" jdbcType="VARCHAR"/>
  12. <result property="name" column="name" jdbcType="VARCHAR"/>
  13. <result property="address" column="address" jdbcType="VARCHAR"/>
  14. <result property="vipNum" column="vip_num" jdbcType="VARCHAR"/>
  15. <result property="merchantId" column="merchant_id" jdbcType="BIGINT"/>
  16. <result property="legionId" column="legion_id" jdbcType="BIGINT"/>
  17. <result property="unionId" column="union_id" jdbcType="BIGINT"/>
  18. <result property="status" column="status" jdbcType="INTEGER"/>
  19. <result property="createBy" column="create_by" jdbcType="BIGINT"/>
  20. <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
  21. <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
  22. </resultMap>
  23. <sql id="allColumns">
  24. id,tenant_id,parent_tenant_id,
  25. activity_id,phone,`name`,
  26. address,vip_num,merchant_id,
  27. legion_id,union_id,status,create_by,
  28. create_date,update_date
  29. </sql>
  30. <sql id="dynamicWhereConditions">
  31. where 1 = 1
  32. <if test=" null != id ">
  33. and `id` = #{id}
  34. </if>
  35. <if test=" null != tenantId and '' != tenantId">
  36. and `tenant_id` = #{tenantId}
  37. </if>
  38. <if test=" null != parentTenantId and '' != parentTenantId">
  39. and `parent_tenant_id` = #{parentTenantId}
  40. </if>
  41. <if test=" null != activityId ">
  42. and `activity_id` = #{activityId}
  43. </if>
  44. <if test=" null != phone and phone != '' ">
  45. and `phone` like concat('%', #{phone},'%')
  46. </if>
  47. <if test=" null != name and name != '' ">
  48. and `name` like concat('%', #{name},'%')
  49. </if>
  50. <if test=" null != vipNum and vipNum != '' ">
  51. and `vip_num` like concat('%', #{vipNum},'%')
  52. </if>
  53. <if test=" null != merchantId ">
  54. and `merchant_id` = #{merchantId}
  55. </if>
  56. <if test=" null != legionId ">
  57. and `legion_id` = #{legionId}
  58. </if>
  59. <if test=" null != unionId ">
  60. and `union_id` = #{unionId}
  61. </if>
  62. <if test=" null != createDateBegin">
  63. and `create_date` &gt;= #{createDateBegin}
  64. </if>
  65. <if test=" null != createDateEnd">
  66. and `create_date` &lt;= #{createDateEnd}
  67. </if>
  68. <if test=" null != status ">
  69. and `status` = #{status}
  70. </if>
  71. <if test=" null != merchantIdList ">
  72. and merchant_id in
  73. <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")">
  74. #{midItem}
  75. </foreach>
  76. </if>
  77. <if test=" null != ids ">
  78. and id in
  79. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  80. #{idItem}
  81. </foreach>
  82. </if>
  83. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  84. </sql>
  85. <select id="findList" parameterType="com.iformall.domain.po.WxLegionActivityUser" resultMap="BaseResultMap">
  86. select <include refid="allColumns" /> from wx_legion_activity_user
  87. <include refid="dynamicWhereConditions" />
  88. </select>
  89. <select id="findIdList" parameterType="com.iformall.domain.po.WxLegionActivityUser" resultType="Long">
  90. select id from wx_legion_activity_user
  91. <include refid="dynamicWhereConditions" />
  92. </select>
  93. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  94. select <include refid="allColumns" /> from wx_legion_activity_user where id = #{id} and tenant_id=#{tenantId}
  95. </select>
  96. <select id="merchantCountStatistics" parameterType="com.iformall.domain.po.WxLegionActivityUser" resultType="com.iformall.domain.vo.LegionActivityUserStatistics">
  97. SELECT merchant_id as 'merchantId',
  98. count(1) as 'count'
  99. FROM wx_legion_activity_user
  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. <if test=" null != merchantId ">
  111. and `merchant_id` = #{merchantId}
  112. </if>
  113. <if test=" null != createDateBegin">
  114. and `create_date` &gt;= #{createDateBegin}
  115. </if>
  116. <if test=" null != createDateEnd">
  117. and `create_date` &lt;= #{createDateEnd}
  118. </if>
  119. <if test=" null != status ">
  120. and `status` = #{status}
  121. </if>
  122. GROUP BY merchant_id
  123. </select>
  124. <update id="updateStatus" parameterType="com.iformall.domain.po.WxLegionActivityUser">
  125. update wx_legion_activity_user
  126. set `status` = #{status},
  127. `update_date` = #{updateDate}
  128. where 1 = 1
  129. <if test=" null != id ">
  130. and `id` = #{id}
  131. </if>
  132. <if test=" null != tenantId and '' != tenantId">
  133. and `tenant_id` = #{tenantId}
  134. </if>
  135. <if test=" null != parentTenantId and '' != parentTenantId">
  136. and `parent_tenant_id` = #{parentTenantId}
  137. </if>
  138. <if test=" null != activityId ">
  139. and `activity_id` = #{activityId}
  140. </if>
  141. <if test=" null != merchantIdList ">
  142. and merchant_id in
  143. <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")">
  144. #{midItem}
  145. </foreach>
  146. </if>
  147. </update>
  148. </mapper>