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

751 строка
26 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="building_name" jdbcType="VARCHAR" property="buildingName"/>
  14. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  15. <result column="status" jdbcType="INTEGER" property="status"/>
  16. <result column="x" jdbcType="DECIMAL" property="x"/>
  17. <result column="y" jdbcType="DECIMAL" property="y"/>
  18. <result column="sid" jdbcType="VARCHAR" property="sid"/>
  19. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  20. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  21. <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
  22. <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
  23. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  24. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  25. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  26. <result column="manager" jdbcType="VARCHAR" property="manager"/>
  27. <result column="manager_phone" jdbcType="VARCHAR" property="managerPhone"/>
  28. <result column="type" jdbcType="INTEGER" property="type"/>
  29. <result column="sell_status" jdbcType="INTEGER" property="sellStatus"/>
  30. <result column="point_type" jdbcType="INTEGER" property="pointType"/>
  31. <result column="comments" jdbcType="VARCHAR" property="comments"/>
  32. <result column="is_del" jdbcType="INTEGER" property="isDel"/>
  33. <result column="freeDay" property="freeDay"/>
  34. <result column="rent" property="rent"/>
  35. <result column="rent_unit" property="rentUnit"/>
  36. <result column="business_id" property="businessId"/>
  37. <result column="pulic_rate" jdbcType="VARCHAR" property="pulicRate"/>
  38. </resultMap>
  39. <sql id="allColumns">
  40. `id`,`tenant_id`,`parent_tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`sid`,`addr`,
  41. `baidu_poi`,`longitude`,`latitude`,`create_date`,`update_date`,`img_url`,`manager`,`manager_phone`,
  42. `type`,`sell_status`,`point_type`,`comments`,`is_del`,DATEDIFF(now(),create_date) freeDay,rent,rent_unit,business_id,pulic_rate
  43. </sql>
  44. <sql id="dynamicWhereConditions">
  45. where is_del=0
  46. <if test=" null != id ">
  47. and `id` = #{id}
  48. </if>
  49. <if test=" null != tenantId and '' != tenantId">
  50. and `tenant_id` = #{tenantId}
  51. </if>
  52. <if test=" null != parentTenantId and '' != parentTenantId">
  53. and `parent_tenant_id` = #{parentTenantId}
  54. </if>
  55. <if test=" null != shopNumber and ''!=shopNumber">
  56. and `shop_number` like concat('%', #{shopNumber},'%')
  57. </if>
  58. <if test=" null != queryShopNumber and ''!=queryShopNumber">
  59. and `shop_number` = #{queryShopNumber}
  60. </if>
  61. <if test=" null != buildArea ">
  62. and `build_area` like concat('%', #{buildArea},'%')
  63. </if>
  64. <if test=" null != operationArea ">
  65. and `operation_area` like concat('%', #{operationArea},'%')
  66. </if>
  67. <if test=" null != building ">
  68. and `building` like concat('%', #{building},'%')
  69. </if>
  70. <if test=" null != floor ">
  71. and `floor` = #{floor}
  72. </if>
  73. <if test=" null != status ">
  74. and `status` = #{status}
  75. </if>
  76. <if test=" null != sellStatus ">
  77. and `sell_status` = #{sellStatus}
  78. </if>
  79. <if test=" null != x ">
  80. and `x` = #{x}
  81. </if>
  82. <if test=" null != y ">
  83. and `y` = #{y}
  84. </if>
  85. <if test=" null != sid ">
  86. and `sid` = #{sid}
  87. </if>
  88. <if test=" null != addr ">
  89. and `addr` like concat('%', #{addr},'%')
  90. </if>
  91. <if test=" null != baiduPoi ">
  92. and `baidu_poi` like concat('%', #{baiduPoi},'%')
  93. </if>
  94. <if test=" null != longitude ">
  95. and `longitude` = #{longitude}
  96. </if>
  97. <if test=" null != latitude ">
  98. and `latitude` = #{latitude}
  99. </if>
  100. <if test=" null != createDate ">
  101. and `create_date` = #{createDate}
  102. </if>
  103. <if test=" null != updateDate ">
  104. and `update_date` = #{updateDate}
  105. </if>
  106. <if test=" null != manager ">
  107. and `manager` = #{manager}
  108. </if>
  109. <if test=" null != managerPhone ">
  110. and `manager_phone` = #{managerPhone}
  111. </if>
  112. <if test=" null != type ">
  113. and `type` = #{type}
  114. </if>
  115. <if test=" null != pointType ">
  116. and `point_type` = #{pointType}
  117. </if>
  118. <if test=" null != floorForRule and '' != floorForRule ">
  119. and `floor` in (${floorForRule})
  120. </if>
  121. <if test=" null != shopTypeForRule and '' != shopTypeForRule ">
  122. and type in (${shopTypeForRule})
  123. </if>
  124. <if test=" null != typeList ">
  125. and type in
  126. <foreach collection="typeList" index="index" item="tidItem" open="(" separator="," close=")">
  127. #{tidItem}
  128. </foreach>
  129. </if>
  130. <if test=" null != searchKeyShopNumber and '' != searchKeyShopNumber ">
  131. and (`shop_number` like concat('%', #{searchKeyShopNumber},'%')
  132. <if test=" null != searchKeyShopIds ">
  133. or id in
  134. <foreach collection="searchKeyShopIds" index="index" item="oridItem" open="(" separator="," close=")">
  135. #{oridItem}
  136. </foreach>
  137. </if>
  138. )
  139. </if>
  140. <if test=" null != ids ">
  141. and id in
  142. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  143. #{idItem}
  144. </foreach>
  145. </if>
  146. <if test=" null != sortColumns">order by ${sortColumns}</if>
  147. </sql>
  148. <select id="findList" parameterType="com.iformall.domain.po.WxShop" resultMap="BaseResultMap">
  149. select
  150. <include refid="allColumns"/>
  151. from wx_shop
  152. <include refid="dynamicWhereConditions"/>
  153. </select>
  154. <select id="findCount" parameterType="com.iformall.domain.po.WxShop" resultType="java.lang.Long">
  155. select count(id)
  156. from wx_shop
  157. <include refid="dynamicWhereConditions"/>
  158. </select>
  159. <select id="findIdList" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
  160. select id
  161. from wx_shop
  162. <include refid="dynamicWhereConditions"/>
  163. </select>
  164. <select id="findAreaSum" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
  165. select ifnull(sum(build_area),0)
  166. from wx_shop
  167. <include refid="dynamicWhereConditions"/>
  168. </select>
  169. <select id="selectBatchByIds" resultMap="BaseResultMap">
  170. select
  171. s.`id`,s.`tenant_id`,s.`parent_tenant_id`,s.`shop_number`,s.`build_area`,s.`operation_area`,s.building,s.floor,s.`status`,s.`x`,s.`y`,s.`sid`,s.`addr`,
  172. s.`baidu_poi`,s.`longitude`,s.`latitude`,s.`create_date`,s.`update_date`,s.`img_url`,s.`manager`,s.`manager_phone`,
  173. s.`type`,s.`point_type`,s.`comments`,s.`is_del`,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,s.business_id
  174. from wx_shop s
  175. where s.is_del=0
  176. <if test=" null != ids ">
  177. and s.id in
  178. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  179. #{idItem}
  180. </foreach>
  181. </if>
  182. </select>
  183. <select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  184. 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,
  185. s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,s.status,s.type,s.sell_status sellStatus,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,
  186. s.business_id as businessId,s.create_date create_date,s.rent,s.rent_unit,s.building as buildingId,s.floor as floorId,s.manager,s.manager_phone managerPhone
  187. from wx_shop s
  188. where s.is_del=0
  189. <if test=" null != type ">
  190. and s.`type` = #{type}
  191. </if>
  192. <if test=" null != tenantId and '' != tenantId">
  193. and s.`tenant_id` = #{tenantId}
  194. </if>
  195. <if test=" null != parentTenantId and '' != parentTenantId">
  196. and s.`parent_tenant_id` = #{parentTenantId}
  197. </if>
  198. <if test=" null != status">
  199. and s.`status` = #{status}
  200. </if>
  201. <if test=" null != sellStatus ">
  202. and s.`sell_status` = #{sellStatus}
  203. </if>
  204. <if test=" null != building ">
  205. and s.`building`= #{building}
  206. </if>
  207. <if test=" null != floor ">
  208. and s.`floor` = #{floor}
  209. </if>
  210. <if test=" null != id ">
  211. and s.`id` = #{id}
  212. </if>
  213. <if test=" null != shopNumber and ''!=shopNumber">
  214. and s.`shop_number` like concat('%', #{shopNumber},'%')
  215. </if>
  216. <if test=" null != queryShopNumber and ''!=queryShopNumber">
  217. and s.`shop_number` = #{queryShopNumber}
  218. </if>
  219. <if test=" null != buildArea ">
  220. and s.`build_area` like concat('%', #{buildArea},'%')
  221. </if>
  222. <if test=" null != operationArea ">
  223. and s.`operation_area` like concat('%', #{operationArea},'%')
  224. </if>
  225. <if test=" null != x ">
  226. and s.`x` = #{x}
  227. </if>
  228. <if test=" null != y ">
  229. and s.`y` = #{y}
  230. </if>
  231. <if test=" null != sid ">
  232. and s.`sid` = #{sid}
  233. </if>
  234. <if test=" null != addr ">
  235. and s.`addr` like concat('%', #{addr},'%')
  236. </if>
  237. <if test=" null != baiduPoi ">
  238. and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
  239. </if>
  240. <if test=" null != longitude ">
  241. and s.`longitude` = #{longitude}
  242. </if>
  243. <if test=" null != latitude ">
  244. and s.`latitude` = #{latitude}
  245. </if>
  246. <if test=" null != createDate ">
  247. and s.`create_date` = #{createDate}
  248. </if>
  249. <if test=" null != updateDate ">
  250. and s.`update_date` = #{updateDate}
  251. </if>
  252. <if test=" null != manager ">
  253. and s.`manager` = #{manager}
  254. </if>
  255. <if test=" null != managerPhone ">
  256. and s.`manager_phone` = #{managerPhone}
  257. </if>
  258. <if test=" null != pointType ">
  259. and s.`point_type` = #{pointType}
  260. </if>
  261. <if test=" null != floorForRule and '' != floorForRule ">
  262. and s.`floor` in (${floorForRule})
  263. </if>
  264. <if test=" null != businessForRule and '' != businessForRule ">
  265. and s.`business_id` in (${businessForRule})
  266. </if>
  267. <if test=" null != typeList ">
  268. and s.type in
  269. <foreach collection="typeList" index="index" item="tidItem" open="(" separator="," close=")">
  270. #{tidItem}
  271. </foreach>
  272. </if>
  273. <if test=" null != ids ">
  274. and s.id in
  275. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  276. #{idItem}
  277. </foreach>
  278. </if>
  279. <if test=" null != sortColumns">order by ${sortColumns}</if>
  280. </select>
  281. <select id="notRentListMapAsPage" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  282. select s.id as id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,s.build_area buildArea,
  283. s.img_url imgUrl,s.operation_area operationArea,s.status,s.manager,s.manager_phone managerPhone,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,
  284. s.create_date as createDate,s.building as buildingId,s.floor as floorId
  285. from wx_shop s
  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 != queryShopNumber and ''!=queryShopNumber">
  300. and s.`shop_number` = #{queryShopNumber}
  301. </if>
  302. <if test=" null != status">
  303. and s.`status` = #{status}
  304. </if>
  305. <if test=" null != sellStatus ">
  306. and s.`sell_status` = #{sellStatus}
  307. </if>
  308. <if test=" null != type ">
  309. and s.`type` = #{type}
  310. </if>
  311. <if test=" null != pointType ">
  312. and s.`point_type` = #{pointType}
  313. </if>
  314. <if test=" null != floorForRule and '' != floorForRule ">
  315. and s.`floor` in (${floorForRule})
  316. </if>
  317. <if test=" null != businessForRule and '' != businessForRule ">
  318. and s.`business_id` in (${businessForRule})
  319. </if>
  320. <if test=" null != shopTypeForRule and '' != shopTypeForRule ">
  321. and s.`type` in (${shopTypeForRule})
  322. </if>
  323. <if test="null != sortColumn">
  324. order by ${sortColumn} ${sortOrder}
  325. </if>
  326. <if test="null == sortColumn">
  327. <if test=" null != sortColumns">order by ${sortColumns}</if>
  328. </if>
  329. </select>
  330. <select id="findListWithMerchantMap" parameterType="com.iformall.domain.vo.WxShopVo" resultMap="BaseResultMap">
  331. select
  332. s.id as 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,
  333. s.create_date,s.building,s.floor
  334. from wx_shop s
  335. where s.is_del=0
  336. <if test=" null != id ">
  337. and s.`id` = #{id}
  338. </if>
  339. <if test=" null != tenantId and '' != tenantId">
  340. and s.`tenant_id` = #{tenantId}
  341. </if>
  342. <if test=" null != parentTenantId and '' != parentTenantId">
  343. and s.`parent_tenant_id` = #{parentTenantId}
  344. </if>
  345. <if test=" null != shopNumber and ''!=shopNumber">
  346. and s.`shop_number` like concat('%', #{shopNumber},'%')
  347. </if>
  348. <if test=" null != queryShopNumber and ''!=queryShopNumber">
  349. and s.`shop_number` = #{queryShopNumber}
  350. </if>
  351. <if test=" null != buildArea ">
  352. and s.`build_area` like concat('%', #{buildArea},'%')
  353. </if>
  354. <if test=" null != operationArea ">
  355. and s.`operation_area` like concat('%', #{operationArea},'%')
  356. </if>
  357. <if test=" null != building ">
  358. and s.`building`= #{building}
  359. </if>
  360. <if test=" null != floor ">
  361. and s.`floor` = #{floor}
  362. </if>
  363. <if test=" null != status">
  364. and s.`status` = #{status}
  365. </if>
  366. <if test=" null != sellStatus ">
  367. and s.`sell_status` = #{sellStatus}
  368. </if>
  369. <if test=" null != x ">
  370. and s.`x` = #{x}
  371. </if>
  372. <if test=" null != y ">
  373. and s.`y` = #{y}
  374. </if>
  375. <if test=" null != sid ">
  376. and s.`sid` = #{sid}
  377. </if>
  378. <if test=" null != addr ">
  379. and s.`addr` like concat('%', #{addr},'%')
  380. </if>
  381. <if test=" null != baiduPoi ">
  382. and s.`baidu_poi` like concat('%', #{baiduPoi},'%')
  383. </if>
  384. <if test=" null != longitude ">
  385. and s.`longitude` = #{longitude}
  386. </if>
  387. <if test=" null != latitude ">
  388. and s.`latitude` = #{latitude}
  389. </if>
  390. <if test=" null != createDate ">
  391. and s.`create_date` = #{createDate}
  392. </if>
  393. <if test=" null != updateDate ">
  394. and s.`update_date` = #{updateDate}
  395. </if>
  396. <if test=" null != manager ">
  397. and s.`manager` = #{manager}
  398. </if>
  399. <if test=" null != managerPhone ">
  400. and s.`manager_phone` = #{managerPhone}
  401. </if>
  402. <if test=" null != type ">
  403. and s.`type` = #{type}
  404. </if>
  405. <if test=" null != pointType ">
  406. and s.`point_type` = #{pointType}
  407. </if>
  408. <if test="null != businessId">
  409. and s.business_id = #{businessId}
  410. </if>
  411. <if test=" null != floorForRule and '' != floorForRule ">
  412. and s.`floor` in (${floorForRule})
  413. </if>
  414. <if test=" null != businessForRule and '' != businessForRule ">
  415. and s.`business_id` in (${businessForRule})
  416. </if>
  417. <if test=" null != shopTypeForRule and '' != shopTypeForRule ">
  418. and s.`type` in (${shopTypeForRule})
  419. </if>
  420. <if test=" null != ids ">
  421. and s.id in
  422. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  423. #{idItem}
  424. </foreach>
  425. </if>
  426. <if test=" null != sortColumns">order by ${sortColumns}</if>
  427. </select>
  428. <select id="getShopList" resultType="hashmap" parameterType="hashmap">
  429. select id,shop_number shopNumber from wx_shop
  430. where shop_number = #{shopNumber} and is_del=0
  431. <if test=" null != tenantId and '' != tenantId">
  432. and `tenant_id` = #{tenantId}
  433. </if>
  434. <if test=" null != parentTenantId and '' != parentTenantId">
  435. and `parent_tenant_id` = #{parentTenantId}
  436. </if>
  437. </select>
  438. <select id="getMerchantShopByShopId" resultType="hashmap" parameterType="hashmap">
  439. select
  440. s.id,s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber, s.manager, s.manager_phone managerPhone
  441. from wx_shop s
  442. where s.id = #{id} and s.is_del=0
  443. </select>
  444. <select id="queryShopLeftInfo" resultType="hashmap" parameterType="hashmap">
  445. select count(id) shopcount,IFNULL(sum(build_area),0) area from wx_shop
  446. where status=#{status} and is_del=0
  447. <if test=" null != tenantId and '' != tenantId">
  448. and `tenant_id` = #{tenantId}
  449. </if>
  450. <if test=" null != parentTenantId and '' != parentTenantId">
  451. and `parent_tenant_id` = #{parentTenantId}
  452. </if>
  453. </select>
  454. <select id="listShopFromContract" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  455. select s.id id,s.shop_number shopNumber,s.build_area buildArea,s.building as buildingId,s.floor as floorId,
  456. s.img_url imgUrl,s.operation_area operationArea,s.manager,s.manager_phone managerPhone,s.status,s.create_date
  457. from wx_shop s
  458. where s.is_del=0
  459. <if test=" null != tenantId and '' != tenantId">
  460. and s.`tenant_id` = #{tenantId}
  461. </if>
  462. <if test=" null != parentTenantId and '' != parentTenantId">
  463. and s.`parent_tenant_id` = #{parentTenantId}
  464. </if>
  465. <if test=" null != status">
  466. and s.`status` = #{status}
  467. </if>
  468. <if test="null != notInIdList and null!=status and status==1 and type!=null and type==2">
  469. and s.id not in(
  470. <foreach collection="notInIdList" index="index" item="notInIdItem" open="(" separator="," close=")">
  471. #{notInIdItem}
  472. </foreach>
  473. )
  474. </if>
  475. <if test=" null != type ">
  476. and s.`type` = #{type}
  477. </if>
  478. <if test=" null != pointType ">
  479. and s.`point_type` = #{pointType}
  480. </if>
  481. <if test=" null != shopNumber and '' != shopNumber ">
  482. and s.shop_number = #{shopNumber}
  483. </if>
  484. <if test=" null != building and '' != building ">
  485. and b.building_name like concat('%', #{building},'%')
  486. </if>
  487. <if test=" null != merchantName and ''!=merchantName ">
  488. and m.`name` like concat('%', #{merchantName},'%')
  489. </if>
  490. <if test=" null != sortColumns">order by ${sortColumns}</if>
  491. </select>
  492. <select id="hasShopNumber" parameterType="com.iformall.domain.po.WxShop" resultType="Integer">
  493. select count(1) from wx_shop where shop_number=#{shopNumber}
  494. and is_del=0
  495. <if test=" null != type">
  496. and `type`=#{type}
  497. </if>
  498. <if test=" null != tenantId and '' != tenantId">
  499. and `tenant_id` = #{tenantId}
  500. </if>
  501. <if test=" null != parentTenantId and '' != parentTenantId">
  502. and `parent_tenant_id` = #{parentTenantId}
  503. </if>
  504. <if test=" null != id">
  505. and id != #{id}
  506. </if>
  507. </select>
  508. <select id="hasShopSid" parameterType="com.iformall.domain.po.WxShop" resultType="Integer">
  509. select count(1) from wx_shop where sid=#{sid}
  510. and is_del=0
  511. <if test=" null != tenantId and '' != tenantId">
  512. and `tenant_id` = #{tenantId}
  513. </if>
  514. <if test=" null != parentTenantId and '' != parentTenantId">
  515. and `parent_tenant_id` = #{parentTenantId}
  516. </if>
  517. <if test=" null != id">
  518. and id != #{id}
  519. </if>
  520. </select>
  521. <resultMap id="rentRate" type="com.iformall.domain.vo.WxShopRentRateVo">
  522. <result column="xTime" property="xTime"/>
  523. <result column="rate" property="rate"/>
  524. </resultMap>
  525. <select id="getCountByWxShop" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
  526. select count(1) from wx_shop w where w.is_del=0
  527. <if test=" null != tenantId and '' != tenantId">
  528. and `tenant_id` = #{tenantId}
  529. </if>
  530. <if test=" null != parentTenantId and '' != parentTenantId">
  531. and `parent_tenant_id` = #{parentTenantId}
  532. </if>
  533. <if test="null != type">
  534. and `type`=#{type}
  535. </if>
  536. <if test="null != status">
  537. and status = #{status}
  538. </if>
  539. <if test="null != building">
  540. and building = #{building}
  541. </if>
  542. <if test="null != floor">
  543. and floor = #{floor}
  544. </if>
  545. <if test="null != startdate">
  546. and `create_date` >= #{startdate}
  547. </if>
  548. <if test="null != enddate">
  549. and `create_date` &lt;= #{enddate}
  550. </if>
  551. <if test="null != businessId and businessId!=0">
  552. and business_id = #{businessId}
  553. </if>
  554. <if test=" null != floorForRule and '' != floorForRule ">
  555. and `floor` in (${floorForRule})
  556. </if>
  557. <if test=" null != businessForRule and '' != businessForRule ">
  558. and `business_id` in (${businessForRule})
  559. </if>
  560. </select>
  561. <update id="updateUnRentByIds" parameterType="Long">
  562. update wx_shop set status = 0
  563. where id in
  564. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  565. #{idItem}
  566. </foreach>
  567. </update>
  568. <select id="detailById" parameterType="Long" resultType="hashmap">
  569. 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,
  570. s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,
  571. s.status,s.manager,s.manager_phone managerPhone,
  572. s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,s.business_id as businessId,s.create_date,
  573. s.building as buildingId,s.floor as floorId
  574. from wx_shop s where s.`id` = #{id}
  575. </select>
  576. <select id="detailBySid" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
  577. select
  578. s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,
  579. CONVERT(s.build_area,DECIMAL(10,2)) buildArea,
  580. s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,
  581. s.status,s.manager,s.manager_phone managerPhone,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,
  582. s.business_id as businessId,s.create_date,s.building as buildingId,s.floor as floorId
  583. from wx_shop s where s.`is_del` = 0 and s.`sid` = #{sid}
  584. <if test=" null != tenantId and '' != tenantId">
  585. and s.`tenant_id` = #{tenantId}
  586. </if>
  587. <if test=" null != parentTenantId and '' != parentTenantId">
  588. and s.`parent_tenant_id` = #{parentTenantId}
  589. </if>
  590. </select>
  591. <select id="newFindShopVoList" parameterType="java.util.Map" resultType="com.iformall.domain.vo.WxShopVo">
  592. select id,shop_number shopNumber,img_url imgUrl,addr,building,floor,baidu_poi baiduPoi,manager_phone linkPhone,manager linkPerson,operation_area operationArea
  593. from wx_shop
  594. where is_del=0
  595. <if test=" null != tenantId and '' != tenantId">
  596. and `tenant_id` = #{tenantId}
  597. </if>
  598. <if test=" null != shopIds ">
  599. and id in
  600. <foreach collection="shopIds" index="index" item="idItem" open="(" separator="," close=")">
  601. #{idItem}
  602. </foreach>
  603. </if>
  604. </select>
  605. <select id="countShopByStatus" resultType="com.iformall.domain.dto.cockpit.CountShopByStatusDTO">
  606. SELECT
  607. `status` AS status, COUNT(id) AS shopCount
  608. FROM
  609. wx_shop
  610. WHERE
  611. is_del = 0
  612. AND tenant_id IN
  613. <foreach collection="tenantIds" index="index" item="tenantId" open="(" separator="," close=")">
  614. #{tenantId}
  615. </foreach>
  616. GROUP BY
  617. `status`;
  618. </select>
  619. <select id="findShopNumberList" parameterType="com.iformall.domain.po.WxShop" resultType="String">
  620. select shop_number from wx_shop
  621. <include refid="dynamicWhereConditions"/>
  622. </select>
  623. </mapper>