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.
 
 
 
 
 

75 lines
2.8 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.WxCashBackActivityMerchantMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCashBackActivityMerchant">
  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="activity_id" jdbcType="BIGINT" property="activityId" />
  9. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  10. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  11. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  12. </resultMap>
  13. <sql id="allColumns">
  14. `id`,`tenant_id`,`parent_tenant_id`,`activity_id`,`merchant_id`,`create_date`,`update_date`
  15. </sql>
  16. <sql id="dynamicWhereConditions">
  17. where 1 = 1
  18. <if test=" null != id ">
  19. and `id` = #{id}
  20. </if>
  21. <if test=" null != tenantId and '' != tenantId">
  22. and `tenant_id` = #{tenantId}
  23. </if>
  24. <if test=" null != parentTenantId and '' != parentTenantId">
  25. and `parent_tenant_id` = #{parentTenantId}
  26. </if>
  27. <if test=" null != activityId ">
  28. and `activity_id` = #{activityId}
  29. </if>
  30. <if test=" null != merchantId ">
  31. and `merchant_id` = #{merchantId}
  32. </if>
  33. <if test=" null != ids ">
  34. and id in
  35. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  36. #{idItem}
  37. </foreach>
  38. </if>
  39. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  40. </sql>
  41. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  42. select <include refid="allColumns" /> from wx_cash_back_activity_merchant where id = #{id} and tenant_id=#{tenantId}
  43. </select>
  44. <select id="findList" parameterType="com.iformall.domain.po.WxCashBackActivityMerchant" resultMap="BaseResultMap">
  45. select <include refid="allColumns" /> from wx_cash_back_activity_merchant
  46. <include refid="dynamicWhereConditions" />
  47. </select>
  48. <delete id="delete" parameterType="com.iformall.domain.po.WxCashBackActivityMerchant">
  49. delete from wx_cash_back_activity_merchant
  50. where `activity_id` = #{activityId}
  51. <if test=" null != merchantId ">
  52. and `merchant_id` = #{merchantId}
  53. </if>
  54. </delete>
  55. <select id="merchantCount" parameterType="com.iformall.domain.po.WxCashBackActivityMerchant" resultType="Integer">
  56. select count(1) from wx_cash_back_activity_merchant
  57. <include refid="dynamicWhereConditions" />
  58. </select>
  59. <select id="findActivityIdList" parameterType="java.util.HashMap" resultType="Long">
  60. select activity_id from wx_cash_back_activity_merchant where merchant_id = #{merchantId} and tenant_id=#{tenantId}
  61. </select>
  62. </mapper>