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

141 строка
5.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.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. </resultMap>
  21. <sql id="allColumns">
  22. `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status`,`link_person`,
  23. `business_id`,`shop_type`,`brand`,`type`
  24. </sql>
  25. <sql id="dynamicWhereConditions">
  26. where 1 = 1
  27. <if test=" null != id ">
  28. and `id` = #{id}
  29. </if>
  30. <if test=" null != tenantId ">
  31. and `tenant_id` = #{tenantId}
  32. </if>
  33. <if test=" null != imgUrl ">
  34. and `img_url` like concat('%', #{imgUrl},'%')
  35. </if>
  36. <if test=" null != name and ''!=name ">
  37. and `name` like concat('%', #{name},'%')
  38. </if>
  39. <if test=" null != linkPhone and ''!=linkPhone ">
  40. and `link_phone` like concat('%', #{linkPhone},'%')
  41. </if>
  42. <if test=" null != createDate ">
  43. and `create_date` = #{createDate}
  44. </if>
  45. <if test=" null != updateDate ">
  46. and `update_date` = #{updateDate}
  47. </if>
  48. <if test=" null != carVendorType ">
  49. and `car_vendor_type` = #{carVendorType}
  50. </if>
  51. <if test=" null != businessId ">
  52. and `business_id` = #{businessId}
  53. </if>
  54. <if test=" null != carParams ">
  55. and `car_params` like concat('%', #{carParams},'%')
  56. </if>
  57. <if test=" null != status ">
  58. and `status` = #{status}
  59. </if>
  60. <if test=" null != linkPerson ">
  61. and `link_person` = #{linkPerson}
  62. </if>
  63. <if test=" null != type ">
  64. and `type` = #{type}
  65. </if>
  66. <if test=" null != ids ">
  67. and id in
  68. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  69. #{idItem}
  70. </foreach>
  71. </if>
  72. <if test=" null != sortColumns">order by ${sortColumns}</if>
  73. </sql>
  74. <select id="findList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap">
  75. select
  76. <include refid="allColumns"/>
  77. from wx_merchant
  78. <include refid="dynamicWhereConditions"/>
  79. </select>
  80. <sql id="allMerchantDiscountVoColumns">
  81. m.id,
  82. m.img_url,m.name,m.link_phone,m.status,
  83. s.addr,s.shop_number,s.baidu_poi,
  84. mb.building_name,mf.floor_name
  85. </sql>
  86. <resultMap id="MerchantDiscountVoResultMap" type="com.iformall.domain.vo.WxMerchantVo">
  87. <id column="id" jdbcType="BIGINT" property="id"/>
  88. <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/>
  89. <result column="name" jdbcType="VARCHAR" property="merchantName"/>
  90. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
  91. <result column="status" jdbcType="VARCHAR" property="merchantStatus"/>
  92. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  93. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  94. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  95. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  96. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  97. </resultMap>
  98. <select id="getMerchantByCode" parameterType="java.util.Map" resultMap="MerchantDiscountVoResultMap">
  99. select
  100. <include refid="allMerchantDiscountVoColumns"/>
  101. FROM wx_merchant m
  102. left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
  103. left join wx_shop s on ms.shop_id = s.id
  104. left join wx_mall_building mb on s.building = mb.id
  105. left join wx_mall_floor mf on s.floor = mf.id
  106. <where>
  107. <if test=" null != tenantId ">
  108. and m.`tenant_id` = #{tenantId}
  109. </if>
  110. <if test=" null != status ">
  111. and m.`status` = #{status}
  112. </if>
  113. <if test=" null != merchantCode ">
  114. and md5(m.`id`) = #{merchantCode}
  115. </if>
  116. </where>
  117. </select>
  118. </mapper>