Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

98 строки
3.4 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.WxMerchantRelationMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchantRelation">
  5. <result column="id" property="id"/>
  6. <result column="tenant_id" property="tenantId"/>
  7. <result column="parent_tenant_id" property="parentTenantId"/>
  8. <result column="region_merchant_id" property="regionMerchantId"/>
  9. <result column="merchant_id" property="merchantId"/>
  10. <result column="is_del" property="isDel"/>
  11. <result column="create_date" property="createDate"/>
  12. <result column="update_date" property="updateDate"/>
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`region_merchant_id`,`is_del`,`create_date`,`update_date`
  16. </sql>
  17. <update id="updateByReginId">
  18. update wx_merchant_relation
  19. set is_del = 1, update_date = now()
  20. where region_merchant_id = #{regionId}
  21. </update>
  22. <insert id="insertBatch" parameterType="java.util.List">
  23. insert into wx_merchant_relation (id, tenant_id,merchant_id,region_merchant_id,parent_tenant_id)
  24. values
  25. <foreach collection="list" item="item" index="index" separator=",">
  26. (#{item.id},
  27. #{item.tenantId},
  28. #{item.merchantId},
  29. #{item.regionMerchantId},
  30. #{item.parentTenantId})
  31. </foreach>
  32. </insert>
  33. <select id="selectByReginId" resultType="com.iformall.domain.po.WxMerchantRelation">
  34. select
  35. <include refid="allColumns"/>
  36. from wx_merchant_relation
  37. where is_del = 0 and region_merchant_id = #{regionId} and merchant_id in
  38. <foreach collection="ids" index="index" item="id" open="(" separator="," close=")">
  39. #{id}
  40. </foreach>
  41. </select>
  42. <update id="updateByMerchantIds">
  43. update wx_merchant_relation
  44. set is_del = 0,
  45. update_date = now()
  46. where region_merchant_id = #{regionId} and merchant_id in
  47. <foreach collection="merchantIds" index="index" item="id" open="(" separator="," close=")">
  48. #{id}
  49. </foreach>
  50. </update>
  51. <update id="deleteByMerchantIds">
  52. update wx_merchant_relation
  53. set is_del = 1,
  54. update_date = now()
  55. where region_merchant_id = #{regionId} and merchant_id in
  56. <foreach collection="merchantIds" index="index" item="id" open="(" separator="," close=")">
  57. #{id}
  58. </foreach>
  59. </update>
  60. <update id="deleteByMerchantId">
  61. update wx_merchant_relation
  62. set is_del = 1, update_date = now()
  63. where merchant_id = #{merchantId}
  64. </update>
  65. <select id="getRelationByRegionId" resultType="java.lang.Long">
  66. select
  67. merchant_id
  68. from wx_merchant_relation
  69. where is_del = 0
  70. and region_merchant_id = #{regionId}
  71. </select>
  72. <select id="getRegionMerchantId" resultType="java.lang.Long">
  73. select
  74. region_merchant_id
  75. from wx_merchant_relation
  76. where is_del = 0
  77. and merchant_id = #{merchantId}
  78. </select>
  79. <select id="getInfByRegionId" resultType="com.iformall.domain.po.WxMerchantRelation">
  80. select
  81. <include refid="allColumns"/>
  82. from wx_merchant_relation
  83. where region_merchant_id = #{id}
  84. </select>
  85. </mapper>