No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

184 líneas
7.0 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.WxMerchantMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchant">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  8. <result column="name" jdbcType="VARCHAR" property="name"/>
  9. <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/>
  10. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  11. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  12. <result column="car_vendor_type" jdbcType="INTEGER" property="carVendorType"/>
  13. <result column="car_params" jdbcType="VARCHAR" property="carParams"/>
  14. <result column="status" jdbcType="INTEGER" property="status"/>
  15. <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
  16. <result column="business_id" jdbcType="INTEGER" property="businessId"/>
  17. <result column="shop_type" jdbcType="INTEGER" property="shopType"/>
  18. <result column="brand" jdbcType="VARCHAR" property="brand"/>
  19. <result column="type" jdbcType="SMALLINT" property="type"/>
  20. <result column="show" jdbcType="SMALLINT" property="show"/>
  21. </resultMap>
  22. <sql id="allColumns">
  23. `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status`,`link_person`,
  24. `business_id`,`shop_type`,`brand`,`type`,`show`
  25. </sql>
  26. <sql id="dynamicWhereConditions">
  27. where 1 = 1
  28. <if test=" null != id ">
  29. and `id` = #{id}
  30. </if>
  31. <if test=" null != tenantId ">
  32. and `tenant_id` = #{tenantId}
  33. </if>
  34. <if test=" null != imgUrl ">
  35. and `img_url` like concat('%', #{imgUrl},'%')
  36. </if>
  37. <if test=" null != name and ''!=name ">
  38. and `name` like concat('%', #{name},'%')
  39. </if>
  40. <if test=" null != linkPhone and ''!=linkPhone ">
  41. and `link_phone` like concat('%', #{linkPhone},'%')
  42. </if>
  43. <if test=" null != createDate ">
  44. and `create_date` = #{createDate}
  45. </if>
  46. <if test=" null != updateDate ">
  47. and `update_date` = #{updateDate}
  48. </if>
  49. <if test=" null != carVendorType ">
  50. and `car_vendor_type` = #{carVendorType}
  51. </if>
  52. <if test=" null != businessId ">
  53. and `business_id` = #{businessId}
  54. </if>
  55. <if test=" null != carParams ">
  56. and `car_params` like concat('%', #{carParams},'%')
  57. </if>
  58. <if test=" null != status ">
  59. and `status` = #{status}
  60. </if>
  61. <if test=" null != linkPerson ">
  62. and `link_person` = #{linkPerson}
  63. </if>
  64. <if test=" null != type ">
  65. and `type` = #{type}
  66. </if>
  67. <if test=" null != show ">
  68. and `show` = #{show}
  69. </if>
  70. <if test=" null != ids ">
  71. and id in
  72. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  73. #{idItem}
  74. </foreach>
  75. </if>
  76. <if test=" null != sortColumns">order by ${sortColumns}</if>
  77. </sql>
  78. <select id="findList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap">
  79. select
  80. <include refid="allColumns"/>
  81. from wx_merchant
  82. <include refid="dynamicWhereConditions"/>
  83. </select>
  84. <sql id="allMerchantVoColumns">
  85. m.id,
  86. m.img_url,m.name,m.link_phone,m.status,m.business_id,
  87. s.addr,s.shop_number,s.baidu_poi,
  88. mb.building_name,mf.floor_name,m.show
  89. </sql>
  90. <resultMap id="MerchantVoResultMap" type="com.iformall.domain.vo.WxMerchantVo">
  91. <id column="id" jdbcType="BIGINT" property="id"/>
  92. <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/>
  93. <result column="name" jdbcType="VARCHAR" property="merchantName"/>
  94. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
  95. <result column="status" jdbcType="VARCHAR" property="merchantStatus"/>
  96. <result column="business_id" jdbcType="INTEGER" property="businessId"/>
  97. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  98. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  99. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  100. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  101. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  102. <result column="show" jdbcType="VARCHAR" property="show"/>
  103. </resultMap>
  104. <select id="getMerchantByCode" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
  105. select
  106. <include refid="allMerchantVoColumns"/>
  107. FROM wx_merchant m
  108. left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
  109. left join wx_shop s on ms.shop_id = s.id
  110. left join wx_mall_building mb on s.building = mb.id
  111. left join wx_mall_floor mf on s.floor = mf.id
  112. <where>
  113. <if test=" null != tenantId ">
  114. and m.`tenant_id` = #{tenantId}
  115. </if>
  116. <if test=" null != status ">
  117. and m.`status` = #{status}
  118. </if>
  119. <if test=" null != merchantCode ">
  120. and md5(m.`id`) = #{merchantCode}
  121. </if>
  122. </where>
  123. </select>
  124. <select id="findListCVo" parameterType="com.iformall.domain.vo.WxMerchantVo" resultMap="MerchantVoResultMap">
  125. select
  126. <include refid="allMerchantVoColumns"/>
  127. FROM wx_merchant m
  128. left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
  129. left join wx_shop s on ms.shop_id = s.id
  130. left join wx_mall_building mb on s.building = mb.id
  131. left join wx_mall_floor mf on s.floor = mf.id
  132. where 1 = 1
  133. <if test=" null != merchantName and ''!=merchantName ">
  134. and m.`name` like concat('%', #{merchantName},'%')
  135. </if>
  136. <if test=" null != merchantLinkPhone and ''!=merchantLinkPhone ">
  137. and m.`link_phone` like concat('%', #{merchantLinkPhone},'%')
  138. </if>
  139. <if test=" null != businessId ">
  140. and m.`business_id` = #{businessId}
  141. </if>
  142. <if test=" null != merchantStatus ">
  143. and m.`status` = #{merchantStatus}
  144. </if>
  145. <if test=" null != shopNumber and ''!=shopNumber ">
  146. and s.`shop_number` like concat('%', #{shopNumber},'%')
  147. </if>
  148. <if test=" null != buildingName and ''!=buildingName ">
  149. and mb.`building_name` like concat('%', #{buildingName},'%')
  150. </if>
  151. <if test=" null != floorName and ''!=floorName ">
  152. and mf.`floor_name` like concat('%', #{floorName},'%')
  153. </if>
  154. </select>
  155. </mapper>