Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

250 righe
7.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.WxShopMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxShop">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  8. <result column="build_area" jdbcType="VARCHAR" property="buildArea"/>
  9. <result column="operation_area" jdbcType="VARCHAR" property="operationArea"/>
  10. <result column="building" jdbcType="BIGINT" property="building"/>
  11. <result column="floor" jdbcType="BIGINT" property="floor"/>
  12. <result column="status" jdbcType="INTEGER" property="status"/>
  13. <result column="x" jdbcType="DECIMAL" property="x"/>
  14. <result column="y" jdbcType="DECIMAL" property="y"/>
  15. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  16. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  17. <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
  18. <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
  19. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  20. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  21. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  22. </resultMap>
  23. <sql id="allColumns">
  24. `id`,`tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`addr`,`baidu_poi`,`longitude`,`latitude`,`create_date`,`update_date`,`img_url`
  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 != shopNumber and ''!=shopNumber">
  35. and `shop_number` like concat('%', #{shopNumber},'%')
  36. </if>
  37. <if test=" null != buildArea ">
  38. and `build_area` like concat('%', #{buildArea},'%')
  39. </if>
  40. <if test=" null != operationArea ">
  41. and `operation_area` like concat('%', #{operationArea},'%')
  42. </if>
  43. <if test=" null != building ">
  44. and `building` like concat('%', #{building},'%')
  45. </if>
  46. <if test=" null != floor ">
  47. and `floor` = #{floor}
  48. </if>
  49. <if test=" null != status ">
  50. and `status` = #{status}
  51. </if>
  52. <if test=" null != x ">
  53. and `x` = #{x}
  54. </if>
  55. <if test=" null != y ">
  56. and `y` = #{y}
  57. </if>
  58. <if test=" null != addr ">
  59. and `addr` like concat('%', #{addr},'%')
  60. </if>
  61. <if test=" null != baiduPoi ">
  62. and `baidu_poi` like concat('%', #{baiduPoi},'%')
  63. </if>
  64. <if test=" null != longitude ">
  65. and `longitude` = #{longitude}
  66. </if>
  67. <if test=" null != latitude ">
  68. and `latitude` = #{latitude}
  69. </if>
  70. <if test=" null != createDate ">
  71. and `create_date` = #{createDate}
  72. </if>
  73. <if test=" null != updateDate ">
  74. and `update_date` = #{updateDate}
  75. </if>
  76. <if test=" null != ids ">
  77. and id in
  78. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  79. #{idItem}
  80. </foreach>
  81. </if>
  82. <if test=" null != sortColumns">order by ${sortColumns}</if>
  83. </sql>
  84. <select id="findList" parameterType="com.iformall.domain.po.WxShop" resultMap="BaseResultMap">
  85. select
  86. <include refid="allColumns"/>
  87. from wx_shop
  88. <include refid="dynamicWhereConditions"/>
  89. </select>
  90. <select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  91. select s.id,s.shop_number shopNumber,s.build_area buildArea,
  92. s.img_url imgUrl,s.operation_area operationArea,
  93. s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
  94. m.link_person linkPerson,m.link_phone linkPhone
  95. from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
  96. left join wx_merchant m on ms.merchant_id=m.id
  97. left join wx_mall_building b on s.building=b.id
  98. left join wx_mall_floor f on s.floor=f.id
  99. where 1 = 1
  100. <if test=" null != id ">
  101. and s.`id` = #{id}
  102. </if>
  103. <if test=" null != tenantId ">
  104. and s.`tenant_id`= #{tenantId}
  105. </if>
  106. <if test=" null != shopNumber and ''!=shopNumber">
  107. and s.`shop_number` like concat('%', #{shopNumber},'%')
  108. </if>
  109. <if test=" null != buildArea ">
  110. and s.`build_area` like concat('%', #{buildArea},'%')
  111. </if>
  112. <if test=" null != operationArea ">
  113. and s.`operation_area` like concat('%', #{operationArea},'%')
  114. </if>
  115. <if test=" null != building ">
  116. and s.`building`= #{building}
  117. </if>
  118. <if test=" null != floor ">
  119. and s.`floor` = #{floor}
  120. </if>
  121. <if test=" null != status ">
  122. and s.`status` = #{status}
  123. </if>
  124. <if test=" null != x ">
  125. and s.`x` = #{x}
  126. </if>
  127. <if test=" null != y ">
  128. and s.`y` = #{y}
  129. </if>
  130. <if test=" null != addr ">
  131. and s.`addr` like concat('%', #{addr},'%')
  132. </if>
  133. <if test=" null != baiduPoi ">
  134. and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
  135. </if>
  136. <if test=" null != longitude ">
  137. and s.`longitude` = #{longitude}
  138. </if>
  139. <if test=" null != latitude ">
  140. and s.`latitude` = #{latitude}
  141. </if>
  142. <if test=" null != createDate ">
  143. and s.`create_date` = #{createDate}
  144. </if>
  145. <if test=" null != updateDate ">
  146. and s.`update_date` = #{updateDate}
  147. </if>
  148. <if test=" null != ids ">
  149. and s.id in
  150. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  151. #{idItem}
  152. </foreach>
  153. </if>
  154. <if test=" null != sortColumns">order by s.${sortColumns}</if>
  155. </select>
  156. <select id="getbshoplist" resultType="hashmap" parameterType="hashmap">
  157. select id,shop_number shopNumber from wx_shop
  158. where tenant_id=#{tenantId} and shop_number = #{shopNumber}
  159. </select>
  160. <select id="getMerchantShopByShopId" resultType="hashmap" parameterType="hashmap">
  161. select m.`name` merchantName,s.build_area buildArea,s.operation_area operationArea,
  162. c.price,c.receive_period receivePeriod,s.shop_number shopNumber,m.link_person linkPerson,
  163. m.link_phone linkPhone
  164. from wx_merchant_shop ms inner join wx_merchant m on ms.merchant_id=m.id
  165. inner join wx_shop s on ms.shop_id=s.id
  166. inner join wx_rent_contract c on ms.merchant_id=c.merchant_id
  167. where ms.tenant_id=#{tenantId} and ms.shop_id=#{shopId} and ms.is_del=0
  168. </select>
  169. <select id="queryShopLeftInfo" resultType="hashmap" parameterType="hashmap">
  170. select count(id) shopcount,sum(build_area) area from wx_shop
  171. where tenant_id=#{tenantId} and status=#{status}
  172. </select>
  173. </mapper>