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

638 строки
24 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="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  9. <result column="build_area" jdbcType="VARCHAR" property="buildArea"/>
  10. <result column="operation_area" jdbcType="VARCHAR" property="operationArea"/>
  11. <result column="building" jdbcType="BIGINT" property="building"/>
  12. <result column="floor" jdbcType="BIGINT" property="floor"/>
  13. <result column="status" jdbcType="INTEGER" property="status"/>
  14. <result column="x" jdbcType="DECIMAL" property="x"/>
  15. <result column="y" jdbcType="DECIMAL" property="y"/>
  16. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  17. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  18. <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
  19. <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
  20. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  21. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  22. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  23. <result column="manager" jdbcType="VARCHAR" property="manager"/>
  24. <result column="manager_phone" jdbcType="VARCHAR" property="managerPhone"/>
  25. <result column="type" jdbcType="INTEGER" property="type"/>
  26. <result column="point_type" jdbcType="INTEGER" property="pointType"/>
  27. <result column="comments" jdbcType="VARCHAR" property="comments"/>
  28. <result column="is_del" jdbcType="INTEGER" property="isDel"/>
  29. <result column="freeDay" property="freeDay"/>
  30. <result column="rent" property="rent"/>
  31. <result column="rent_unit" property="rentUnit"/>
  32. <result column="business_id" property="businessId"/>
  33. </resultMap>
  34. <sql id="allColumns">
  35. `id`,`tenant_id`,`parent_tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`addr`,
  36. `baidu_poi`,`longitude`,`latitude`,`create_date`,`update_date`,`img_url`,`manager`,`manager_phone`,
  37. `type`,`point_type`,`comments`,`is_del`,DATEDIFF(now(),create_date) freeDay,rent,rent_unit,business_id
  38. </sql>
  39. <sql id="dynamicWhereConditions">
  40. where is_del=0
  41. <if test=" null != id ">
  42. and `id` = #{id}
  43. </if>
  44. <if test=" null != tenantId and '' != tenantId">
  45. and `tenant_id` = #{tenantId}
  46. </if>
  47. <if test=" null != parentTenantId and '' != parentTenantId">
  48. and `parent_tenant_id` = #{parentTenantId}
  49. </if>
  50. <if test=" null != shopNumber and ''!=shopNumber">
  51. and `shop_number` like concat('%', #{shopNumber},'%')
  52. </if>
  53. <if test=" null != buildArea ">
  54. and `build_area` like concat('%', #{buildArea},'%')
  55. </if>
  56. <if test=" null != operationArea ">
  57. and `operation_area` like concat('%', #{operationArea},'%')
  58. </if>
  59. <if test=" null != building ">
  60. and `building` like concat('%', #{building},'%')
  61. </if>
  62. <if test=" null != floor ">
  63. and `floor` = #{floor}
  64. </if>
  65. <if test=" null != status ">
  66. and `status` = #{status}
  67. </if>
  68. <if test=" null != x ">
  69. and `x` = #{x}
  70. </if>
  71. <if test=" null != y ">
  72. and `y` = #{y}
  73. </if>
  74. <if test=" null != addr ">
  75. and `addr` like concat('%', #{addr},'%')
  76. </if>
  77. <if test=" null != baiduPoi ">
  78. and `baidu_poi` like concat('%', #{baiduPoi},'%')
  79. </if>
  80. <if test=" null != longitude ">
  81. and `longitude` = #{longitude}
  82. </if>
  83. <if test=" null != latitude ">
  84. and `latitude` = #{latitude}
  85. </if>
  86. <if test=" null != createDate ">
  87. and `create_date` = #{createDate}
  88. </if>
  89. <if test=" null != updateDate ">
  90. and `update_date` = #{updateDate}
  91. </if>
  92. <if test=" null != manager ">
  93. and `manager` = #{manager}
  94. </if>
  95. <if test=" null != managerPhone ">
  96. and `manager_phone` = #{managerPhone}
  97. </if>
  98. <if test=" null != type ">
  99. and `type` = #{type}
  100. </if>
  101. <if test=" null != pointType ">
  102. and `point_type` = #{pointType}
  103. </if>
  104. <if test=" null != ids ">
  105. and id in
  106. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  107. #{idItem}
  108. </foreach>
  109. </if>
  110. <if test=" null != sortColumns">order by ${sortColumns}</if>
  111. </sql>
  112. <select id="findList" parameterType="com.iformall.domain.po.WxShop" resultMap="BaseResultMap">
  113. select
  114. <include refid="allColumns"/>
  115. from wx_shop
  116. <include refid="dynamicWhereConditions"/>
  117. </select>
  118. <select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  119. select s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,DECIMAL(10,2)) buildArea,
  120. s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,
  121. s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
  122. m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone,
  123. s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,rent,rent_unit,s.business_id as
  124. businessId,s.create_date create_date
  125. from wx_shop s
  126. left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
  127. left join wx_merchant m on ms.merchant_id=m.id
  128. left join wx_mall_building b on s.building=b.id
  129. left join wx_mall_floor f on s.floor=f.id
  130. where s.is_del=0
  131. <if test=" null != type ">
  132. and s.`type` = #{type}
  133. </if>
  134. <if test=" null != tenantId and '' != tenantId">
  135. and s.`tenant_id` = #{tenantId}
  136. </if>
  137. <if test=" null != parentTenantId and '' != parentTenantId">
  138. and s.`parent_tenant_id` = #{parentTenantId}
  139. </if>
  140. <if test=" null != status">
  141. and s.`status` = #{status}
  142. </if>
  143. <if test=" null != building ">
  144. and s.`building`= #{building}
  145. </if>
  146. <if test=" null != floor ">
  147. and s.`floor` = #{floor}
  148. </if>
  149. <if test=" null != id ">
  150. and s.`id` = #{id}
  151. </if>
  152. <if test=" null != shopNumber and ''!=shopNumber">
  153. and s.`shop_number` like concat('%', #{shopNumber},'%')
  154. </if>
  155. <if test=" null != buildArea ">
  156. and s.`build_area` like concat('%', #{buildArea},'%')
  157. </if>
  158. <if test=" null != operationArea ">
  159. and s.`operation_area` like concat('%', #{operationArea},'%')
  160. </if>
  161. <if test=" null != x ">
  162. and s.`x` = #{x}
  163. </if>
  164. <if test=" null != y ">
  165. and s.`y` = #{y}
  166. </if>
  167. <if test=" null != addr ">
  168. and s.`addr` like concat('%', #{addr},'%')
  169. </if>
  170. <if test=" null != baiduPoi ">
  171. and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
  172. </if>
  173. <if test=" null != longitude ">
  174. and s.`longitude` = #{longitude}
  175. </if>
  176. <if test=" null != latitude ">
  177. and s.`latitude` = #{latitude}
  178. </if>
  179. <if test=" null != createDate ">
  180. and s.`create_date` = #{createDate}
  181. </if>
  182. <if test=" null != updateDate ">
  183. and s.`update_date` = #{updateDate}
  184. </if>
  185. <if test=" null != manager ">
  186. and s.`manager` = #{manager}
  187. </if>
  188. <if test=" null != managerPhone ">
  189. and s.`manager_phone` = #{managerPhone}
  190. </if>
  191. <if test=" null != pointType ">
  192. and s.`point_type` = #{pointType}
  193. </if>
  194. <if test=" null != ids ">
  195. and s.id in
  196. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  197. #{idItem}
  198. </foreach>
  199. </if>
  200. <if test=" null != sortColumns">order by ${sortColumns}</if>
  201. </select>
  202. <select id="notRentListMapAsPage" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  203. select s.id as id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,s.build_area buildArea,
  204. s.img_url imgUrl,s.operation_area operationArea,
  205. s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone,
  206. s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.create_date as createDate
  207. from wx_shop s
  208. left join wx_mall_building b on s.building=b.id
  209. left join wx_mall_floor f on s.floor=f.id
  210. where s.is_del=0
  211. <if test=" null != id ">
  212. and s.`id` = #{id}
  213. </if>
  214. <if test=" null != tenantId and '' != tenantId">
  215. and s.`tenant_id` = #{tenantId}
  216. </if>
  217. <if test=" null != parentTenantId and '' != parentTenantId">
  218. and s.`parent_tenant_id` = #{parentTenantId}
  219. </if>
  220. <if test=" null != shopNumber and ''!=shopNumber">
  221. and s.`shop_number` like concat('%', #{shopNumber},'%')
  222. </if>
  223. <if test=" null != status">
  224. and s.`status` = #{status}
  225. </if>
  226. <if test=" null != type ">
  227. and s.`type` = #{type}
  228. </if>
  229. <if test=" null != pointType ">
  230. and s.`point_type` = #{pointType}
  231. </if>
  232. <if test="null != sortColumn">
  233. order by ${sortColumn} ${sortOrder}
  234. </if>
  235. <if test="null == sortColumn">
  236. <if test=" null != sortColumns">order by ${sortColumns}</if>
  237. </if>
  238. </select>
  239. <resultMap id="VoResultMap" type="com.iformall.domain.vo.WxShopVo">
  240. <id column="id" jdbcType="BIGINT" property="id"/>
  241. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  242. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  243. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  244. <result column="build_area" jdbcType="VARCHAR" property="buildArea"/>
  245. <result column="operation_area" jdbcType="VARCHAR" property="operationArea"/>
  246. <result column="building" jdbcType="BIGINT" property="building"/>
  247. <result column="floor" jdbcType="BIGINT" property="floor"/>
  248. <result column="status" jdbcType="INTEGER" property="status"/>
  249. <result column="x" jdbcType="DECIMAL" property="x"/>
  250. <result column="y" jdbcType="DECIMAL" property="y"/>
  251. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  252. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  253. <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
  254. <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
  255. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  256. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  257. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  258. <result column="manager" jdbcType="VARCHAR" property="manager"/>
  259. <result column="manager_phone" jdbcType="VARCHAR" property="managerPhone"/>
  260. <result column="type" jdbcType="INTEGER" property="type"/>
  261. <result column="point_type" jdbcType="INTEGER" property="pointType"/>
  262. <result column="comments" jdbcType="VARCHAR" property="comments"/>
  263. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  264. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  265. <result column="merchantId" jdbcType="VARCHAR" property="merchantId"/>
  266. <result column="merchantName" jdbcType="VARCHAR" property="merchantName"/>
  267. <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/>
  268. <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
  269. <result column="business" jdbcType="VARCHAR" property="business"/>
  270. <result column="brandName" jdbcType="VARCHAR" property="brandName"/>
  271. </resultMap>
  272. <select id="findListWithMerchantMap" parameterType="com.iformall.domain.vo.WxShopVo" resultMap="VoResultMap">
  273. select
  274. s.id as
  275. id,s.shop_number,s.build_area,s.img_url,s.operation_area,s.status,s.manager,s.manager_phone,s.addr,s.type,s.point_type,
  276. b.building_name,f.floor_name,
  277. m.id merchantId,m.name merchantName,m.link_person,m.link_phone,
  278. brand.name brandName,
  279. bus.title business,s.create_date as create_date
  280. from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
  281. left join wx_merchant m on ms.merchant_id=m.id
  282. left join wx_mall_building b on s.building=b.id
  283. left join wx_mall_floor f on s.floor=f.id
  284. left join wx_business bus on m.business_id = bus.id
  285. left join wx_brand brand on m.brand = brand.id
  286. where s.is_del=0
  287. <if test=" null != id ">
  288. and s.`id` = #{id}
  289. </if>
  290. <if test=" null != tenantId and '' != tenantId">
  291. and s.`tenant_id` = #{tenantId}
  292. </if>
  293. <if test=" null != parentTenantId and '' != parentTenantId">
  294. and s.`parent_tenant_id` = #{parentTenantId}
  295. </if>
  296. <if test=" null != shopNumber and ''!=shopNumber">
  297. and s.`shop_number` like concat('%', #{shopNumber},'%')
  298. </if>
  299. <if test=" null != buildArea ">
  300. and s.`build_area` like concat('%', #{buildArea},'%')
  301. </if>
  302. <if test=" null != operationArea ">
  303. and s.`operation_area` like concat('%', #{operationArea},'%')
  304. </if>
  305. <if test=" null != building ">
  306. and s.`building`= #{building}
  307. </if>
  308. <if test=" null != floor ">
  309. and s.`floor` = #{floor}
  310. </if>
  311. <if test=" null != status">
  312. and s.`status` = #{status}
  313. </if>
  314. <if test=" null != x ">
  315. and s.`x` = #{x}
  316. </if>
  317. <if test=" null != y ">
  318. and s.`y` = #{y}
  319. </if>
  320. <if test=" null != addr ">
  321. and s.`addr` like concat('%', #{addr},'%')
  322. </if>
  323. <if test=" null != baiduPoi ">
  324. and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
  325. </if>
  326. <if test=" null != longitude ">
  327. and s.`longitude` = #{longitude}
  328. </if>
  329. <if test=" null != latitude ">
  330. and s.`latitude` = #{latitude}
  331. </if>
  332. <if test=" null != createDate ">
  333. and s.`create_date` = #{createDate}
  334. </if>
  335. <if test=" null != updateDate ">
  336. and s.`update_date` = #{updateDate}
  337. </if>
  338. <if test=" null != manager ">
  339. and s.`manager` = #{manager}
  340. </if>
  341. <if test=" null != managerPhone ">
  342. and s.`manager_phone` = #{managerPhone}
  343. </if>
  344. <if test=" null != type ">
  345. and s.`type` = #{type}
  346. </if>
  347. <if test=" null != pointType ">
  348. and s.`point_type` = #{pointType}
  349. </if>
  350. <if test="null != businessId">
  351. and s.business_id = #{businessId}
  352. </if>
  353. <if test=" null != ids ">
  354. and s.id in
  355. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  356. #{idItem}
  357. </foreach>
  358. </if>
  359. <if test=" null != sortColumns">order by ${sortColumns}</if>
  360. </select>
  361. <select id="getShopList" resultType="hashmap" parameterType="hashmap">
  362. select id,shop_number shopNumber from wx_shop
  363. where shop_number = #{shopNumber} and is_del=0
  364. <if test=" null != tenantId and '' != tenantId">
  365. and `tenant_id` = #{tenantId}
  366. </if>
  367. <if test=" null != parentTenantId and '' != parentTenantId">
  368. and `parent_tenant_id` = #{parentTenantId}
  369. </if>
  370. </select>
  371. <select id="getMerchantShopByShopId" resultType="hashmap" parameterType="hashmap">
  372. select m.`name` merchantName,s.build_area buildArea,s.operation_area operationArea,
  373. c.price,c.receive_period receivePeriod,s.shop_number shopNumber,m.link_person linkPerson,
  374. m.link_phone linkPhone
  375. from wx_merchant_shop ms inner join wx_merchant m on ms.merchant_id=m.id
  376. inner join wx_shop s on ms.shop_id=s.id
  377. inner join wx_rent_contract c on ms.merchant_id=c.merchant_id
  378. where ms.shop_id=#{shopId} and ms.is_del=0 and s.is_del=0
  379. <if test=" null != tenantId and '' != tenantId">
  380. and ms.`tenant_id` = #{tenantId}
  381. </if>
  382. <if test=" null != parentTenantId and '' != parentTenantId">
  383. and ms.`parent_tenant_id` = #{parentTenantId}
  384. </if>
  385. </select>
  386. <select id="queryShopLeftInfo" resultType="hashmap" parameterType="hashmap">
  387. select count(id) shopcount,IFNULL(sum(build_area),0) area from wx_shop
  388. where status=#{status} and is_del=0
  389. <if test=" null != tenantId and '' != tenantId">
  390. and `tenant_id` = #{tenantId}
  391. </if>
  392. <if test=" null != parentTenantId and '' != parentTenantId">
  393. and `parent_tenant_id` = #{parentTenantId}
  394. </if>
  395. </select>
  396. <select id="listShopFromContract" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  397. select s.id id,s.shop_number shopNumber,s.build_area buildArea,
  398. s.img_url imgUrl,s.operation_area operationArea,
  399. s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
  400. m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone,
  401. m.brand,m.business_id businessId,m.shop_type shopType,s.create_date create_date
  402. from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id
  403. left join wx_merchant m on ms.merchant_id=m.id
  404. left join wx_mall_building b on s.building=b.id
  405. left join wx_mall_floor f on s.floor=f.id
  406. where s.is_del=0 and ms.is_del=0
  407. <if test=" null != tenantId and '' != tenantId">
  408. and s.`tenant_id` = #{tenantId}
  409. </if>
  410. <if test=" null != parentTenantId and '' != parentTenantId">
  411. and s.`parent_tenant_id` = #{parentTenantId}
  412. </if>
  413. <if test=" null != status">
  414. and s.`status` = #{status}
  415. </if>
  416. <if test="null!=status and status==1 and type!=null and type==2">
  417. and s.id not in(
  418. SELECT shop_id FROM wx_rent_contract WHERE status in(1,2,3,4,8)
  419. and rent_shop_type=2
  420. <if test=" null != tenantId and '' != tenantId">
  421. and `tenant_id` = #{tenantId}
  422. </if>
  423. <if test=" null != parentTenantId and '' != parentTenantId">
  424. and `parent_tenant_id` = #{parentTenantId}
  425. </if>
  426. )
  427. </if>
  428. <if test=" null != type ">
  429. and s.`type` = #{type}
  430. </if>
  431. <if test=" null != pointType ">
  432. and s.`point_type` = #{pointType}
  433. </if>
  434. <if test=" null != shopNumber and '' != shopNumber ">
  435. and s.shop_number = #{shopNumber}
  436. </if>
  437. <if test=" null != building and '' != building ">
  438. and b.building_name like concat('%', #{building},'%')
  439. </if>
  440. <if test=" null != merchantName and ''!=merchantName ">
  441. and m.`name` like concat('%', #{merchantName},'%')
  442. </if>
  443. <if test=" null != sortColumns">order by ${sortColumns}</if>
  444. </select>
  445. <select id="hasShopNumber" parameterType="com.iformall.domain.po.WxShop" resultType="Integer">
  446. select count(*) from wx_shop where shop_number=#{shopNumber} and `type`=#{type}
  447. and is_del=0
  448. <if test=" null != tenantId and '' != tenantId">
  449. and `tenant_id` = #{tenantId}
  450. </if>
  451. <if test=" null != parentTenantId and '' != parentTenantId">
  452. and `parent_tenant_id` = #{parentTenantId}
  453. </if>
  454. <if test=" null != id">
  455. and id != #{id}
  456. </if>
  457. </select>
  458. <resultMap id="ShopVoResultMap" type="com.iformall.domain.vo.WxShopVo">
  459. <id column="id" jdbcType="BIGINT" property="id"/>
  460. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  461. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  462. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  463. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  464. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  465. <result column="manager_phone" jdbcType="VARCHAR" property="linkPhone"/>
  466. <result column="manager" jdbcType="VARCHAR" property="linkPerson"/>
  467. </resultMap>
  468. <resultMap id="rentRate" type="com.iformall.domain.vo.WxShopRentRateVo">
  469. <result column="xTime" property="xTime"/>
  470. <result column="rate" property="rate"/>
  471. </resultMap>
  472. <select id="findShopVoList" parameterType="java.util.Map" resultMap="ShopVoResultMap">
  473. select s.id,s.shop_number,b.building_name,f.floor_name,s.addr,s.baidu_poi,s.manager_phone,s.manager
  474. from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id
  475. left join wx_merchant m on ms.merchant_id=m.id
  476. left join wx_mall_building b on s.building=b.id
  477. left join wx_mall_floor f on s.floor=f.id
  478. where s.is_del=0 and ms.is_del=0
  479. and m.id=#{merchantId}
  480. </select>
  481. <select id="getCountByWxShop" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
  482. select count(*) from wx_shop w where w.is_del=0
  483. <if test=" null != tenantId and '' != tenantId">
  484. and `tenant_id` = #{tenantId}
  485. </if>
  486. <if test=" null != parentTenantId and '' != parentTenantId">
  487. and `parent_tenant_id` = #{parentTenantId}
  488. </if>
  489. <if test="null != type">
  490. and `type`=#{type}
  491. </if>
  492. <if test="null != status">
  493. and status = #{status}
  494. </if>
  495. <if test="null != building">
  496. and building = #{building}
  497. </if>
  498. <if test="null != floor">
  499. and floor = #{floor}
  500. </if>
  501. <if test="null != startdate">
  502. and `create_date` >= #{startdate}
  503. </if>
  504. <if test="null != enddate">
  505. and `create_date` &lt;= #{enddate}
  506. </if>
  507. <if test="null != businessId and businessId!=0">
  508. and business_id = #{businessId}
  509. </if>
  510. </select>
  511. <select id="rentRateHistory" resultType="hashmap" parameterType="hashmap">
  512. select
  513. <if test="1 == dateType">
  514. DATE_FORMAT(w.create_date,'%Y/%m/%d') xTime
  515. </if>
  516. <if test="2 == dateType">
  517. DATE_FORMAT(w.create_date,'%Y/%m') xTime
  518. </if>
  519. ,count(distinct w.shop_id) xCount
  520. from wx_merchant_shop w left join wx_shop s on w.shop_id=s.id
  521. where w.is_del=0 and s.is_del=0
  522. <if test=" null != tenantId and '' != tenantId">
  523. and w.`tenant_id` = #{tenantId}
  524. </if>
  525. <if test=" null != parentTenantId and '' != parentTenantId">
  526. and w.`parent_tenant_id` = #{parentTenantId}
  527. </if>
  528. <if test="building!=null">
  529. and s.building=#{building}
  530. </if>
  531. <if test="floor!=null">
  532. and s.floor=#{floor}
  533. </if>
  534. <if test="businessId!=null and businessId!=0">
  535. and s.business_id=#{businessId}
  536. </if>
  537. group by xTime
  538. order by xTime
  539. </select>
  540. </mapper>