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

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