Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

838 řádky
41 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.WxRentContractMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRentContract">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
  7. <result column="shop_type_sub" jdbcType="VARCHAR" property="shopTypeSub"/>
  8. <result column="lease_purpose" jdbcType="VARCHAR" property="leasePurpose"/>
  9. <result column="contractual_rules" jdbcType="VARCHAR" property="contractualRules"/>
  10. <result column="delivery_date" jdbcType="TIMESTAMP" property="deliveryDate"/>
  11. <result column="delivery_grace_period" jdbcType="INTEGER" property="deliveryGracePeriod"/>
  12. <result column="opening_date" jdbcType="TIMESTAMP" property="openingDate"/>
  13. <result column="business_hours" jdbcType="VARCHAR" property="businessHours"/>
  14. <result column="scope_metre" jdbcType="INTEGER" property="scopeMetre"/>
  15. <result column="price" jdbcType="INTEGER" property="price"/>
  16. <result column="rental_start_date" jdbcType="TIMESTAMP" property="rentalStartDate"/>
  17. <result column="rental_end_date" jdbcType="TIMESTAMP" property="rentalEndDate"/>
  18. <result column="sign_date" jdbcType="TIMESTAMP" property="signDate"/>
  19. <result column="receive_period" jdbcType="INTEGER" property="receivePeriod"/>
  20. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  21. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  22. <result column="filepath" jdbcType="VARCHAR" property="filepath"/>
  23. <result column="status" jdbcType="INTEGER" property="status"/>
  24. <result column="contract_number" jdbcType="VARCHAR" property="contractNumber"/>
  25. <result column="first_party_bank_info" jdbcType="VARCHAR" property="firstPartyBankInfo"/>
  26. <result column="second_party_bank_info" jdbcType="VARCHAR" property="secondPartyBankInfo"/>
  27. <result column="second_party_tax_info" jdbcType="VARCHAR" property="secondPartyTaxInfo"/>
  28. <result column="property_name" jdbcType="VARCHAR" property="propertyName"/>
  29. <result column="property_fee" jdbcType="INTEGER" property="propertyFee"/>
  30. <result column="fee_cycle" jdbcType="INTEGER" property="feeCycle"/>
  31. <result column="water_fee" jdbcType="INTEGER" property="waterFee"/>
  32. <result column="electricity_fees" jdbcType="INTEGER" property="electricityFees"/>
  33. <result column="deposit" jdbcType="INTEGER" property="deposit"/>
  34. <!--<result column="deposit_info" jdbcType="VARCHAR" property="depositInfo"/>-->
  35. <result column="cashtype_content_lsit" jdbcType="VARCHAR" property="cashtypeContentLsit"/>
  36. <result column="cashtype_lsit" jdbcType="VARCHAR" property="cashtypeLsit"/>
  37. <result column="pay_date" jdbcType="INTEGER" property="payDate"/>
  38. <result column="is_del" jdbcType="INTEGER" property="isDel"/>
  39. <result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/>
  40. <result column="brand" jdbcType="VARCHAR" property="brand"/>
  41. <result column="business_id" jdbcType="INTEGER" property="businessId"/>
  42. <result column="shop_type" jdbcType="INTEGER" property="shopType"/>
  43. <result column="shop_type_str" jdbcType="VARCHAR" property="shopTypeStr"/>
  44. <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
  45. <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
  46. <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
  47. <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/>
  48. <result column="pay_account" jdbcType="VARCHAR" property="payAccount"/>
  49. <result column="link_address" jdbcType="VARCHAR" property="linkAddress"/>
  50. <result column="filename" jdbcType="VARCHAR" property="filename"/>
  51. <result column="lease" jdbcType="INTEGER" property="lease"/>
  52. <result column="type" jdbcType="INTEGER" property="type"/>
  53. <result column="revenue" jdbcType="INTEGER" property="revenue"/>
  54. <result column="adjust_ratio" jdbcType="VARCHAR" property="adjustRatio"/>
  55. <result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/>
  56. <result column="pay_ratio" jdbcType="INTEGER" property="payRatio"/>
  57. <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/>
  58. <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/>
  59. <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
  60. <result column="bank_name" jdbcType="VARCHAR" property="bankName"/>
  61. <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/>
  62. <result column="fix_start_date" property="fixStartDate"/>
  63. <result column="fix_end_date" property="fixEndDate"/>
  64. <result column="business_type" property="businessType"/>
  65. <result column="receive_period" property="receivePeriod"/>
  66. <result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/>
  67. <result column="file_names" jdbcType="VARCHAR" property="fileNames"/>
  68. <result column="price_unit" property="priceUnit"/>
  69. <result column="rent_price" property="rentPrice"/>
  70. <result column="other_rent_price_info" jdbcType="VARCHAR" property="otherRentPriceInfo"/>
  71. <result column="subject_name" property="subjectName"/>
  72. <result column="rent_start_type" property="rentStartType"/>
  73. <result column="type" jdbcType="INTEGER" property="type"/>
  74. <result column="revenue" jdbcType="INTEGER" property="revenue"/>
  75. <result column="adjust_ratio" jdbcType="VARCHAR" property="adjustRatio"/>
  76. <result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/>
  77. <result column="pay_ratio" jdbcType="INTEGER" property="payRatio"/>
  78. <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/>
  79. <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/>
  80. <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
  81. <result column="bank_name" jdbcType="VARCHAR" property="bankName"/>
  82. <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/>
  83. <result column="fix_start_date" property="fixStartDate"/>
  84. <result column="fix_end_date" property="fixEndDate"/>
  85. <result column="business_type" property="businessType"/>
  86. <result column="receive_period" property="receivePeriod"/>
  87. <result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/>
  88. <result column="file_names" jdbcType="VARCHAR" property="fileNames"/>
  89. <result column="price_unit" property="priceUnit"/>
  90. <result column="rent_price" property="rentPrice"/>
  91. <result column="subject_name" property="subjectName"/>
  92. <result column="rent_start_type" property="rentStartType"/>
  93. <result column="shop_name" property="shopName"/>
  94. <result column="from_id" property="fromId"/>
  95. <result column="rent_input_way" property="rentInputWay"/>
  96. <result column="adjust_ratio_way" property="adjustRatioWay"/>
  97. <result column="operation_type" property="operationType"/>
  98. <result column="late_pay_ratio" property="latePayRatio"/>
  99. <result column="late_pay_day" property="latePayDay"/>
  100. <result column="bus_discount_ratio" property="busDiscountRatio"/>
  101. <result column="bus_discount_time" property="busDiscountTime"/>
  102. </resultMap>
  103. <sql id="allColumns">
  104. `id`,`merchant_id`,
  105. `shop_type_sub`,`lease_purpose`,`contractual_rules`,`delivery_date`,`delivery_grace_period`,`opening_date`,`business_hours`,`scope_metre`,
  106. `price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,
  107. `tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,
  108. `first_party_bank_info`,`second_party_bank_info`,`second_party_tax_info`,
  109. `property_name`,`property_fee`,`fee_cycle`,`water_fee`,`electricity_fees`,
  110. `deposit`,cashtype_content_lsit,cashtype_lsit,`pay_date`,`is_del`,`merchant_name`,
  111. `brand`,`business_id`,`shop_type`,`shop_type_str`,`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`,
  112. `pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio`,
  113. `start_date`,`end_date`,`shop_name`,`from_id`,
  114. `apply_status`,`bank_name`,`rent_shop_type`,`fix_start_date`,`fix_end_date`,
  115. `business_type`,`rent_info`, `file_names`,price_unit,rent_price,other_rent_price_info,`subject_name`,rent_start_type,
  116. `rent_input_way`,`adjust_ratio_way`,`operation_type`,late_pay_ratio,late_pay_day,bus_discount_ratio,bus_discount_time
  117. </sql>
  118. <sql id="dynamicWhereConditions">
  119. where 1 = 1
  120. <if test=" null != id ">and `id` = #{id}</if>
  121. <if test=" null != fromId ">and `from_id` = #{fromId}</if>
  122. <if test=" null != merchantId and '' != merchantId">and `merchant_id` = #{merchantId}</if>
  123. <if test=" null != price and '' != price">and `price` = #{price}</if>
  124. <if test=" null != rentalStartDate and '' != rentalStartDate">and `rental_start_date` = #{rentalStartDate}</if>
  125. <if test=" null != rentalEndDate and '' != rentalEndDate">and `rental_end_date` = #{rentalEndDate}</if>
  126. <if test=" null != signDate and '' != signDate">and `sign_date` = #{signDate}</if>
  127. <if test=" null != receivePeriod and '' != receivePeriod">and `receive_period` = #{receivePeriod}</if>
  128. <if test=" null != tenantId and '' != tenantId">
  129. and `tenant_id` = #{tenantId}
  130. </if>
  131. <if test=" null != parentTenantId and '' != parentTenantId">
  132. and `parent_tenant_id` = #{parentTenantId}
  133. </if>
  134. <if test=" null != filepath and '' != filepath">and `filepath` = #{filepath}</if>
  135. <if test=" null != status and '' != status">and `status` = #{status}</if>
  136. <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
  137. <if test=" null != contractNumber and '' != contractNumber">and `contract_number` = #{contractNumber}</if>
  138. <if test=" null != deposit and '' != deposit">and `deposit` = #{deposit}</if>
  139. <if test=" null != payDate and '' != payDate">and `pay_date` = #{payDate}</if>
  140. <if test=" null != isDel and '' != isDel">and `is_del` = #{isDel}</if>
  141. <if test=" null != merchantName and '' != merchantName">and `merchant_name` like concat('%', #{merchantName},'%') </if>
  142. <if test=" null != brand and '' != brand">and `brand` = #{brand}</if>
  143. <if test=" null != businessId and '' != businessId">and `business_id` = #{businessId}</if>
  144. <if test=" null != shopType and '' != shopType">and `shop_type` = #{shopType}</if>
  145. <if test=" null != updatetime and '' != updatetime">and `updatetime` = #{updatetime}</if>
  146. <if test=" null != createtime and '' != createtime">and `createtime` = #{createtime}</if>
  147. <if test=" null != linkPerson and '' != linkPerson">and `link_person` = #{linkPerson}</if>
  148. <if test=" null != linkPhone and '' != linkPhone">and `link_phone` = #{linkPhone}</if>
  149. <if test=" null != payAccount and '' != payAccount">and `pay_account` = #{payAccount}</if>
  150. <if test=" null != filename and '' != filename">and `filename` = #{filename}</if>
  151. <if test=" null != lease and '' != lease">and `lease` = #{lease}</if>
  152. <if test=" null != type and '' != type">and `type` = #{type}</if>
  153. <if test=" null != startDate and '' != startDate">and `start_date` = #{startDate}</if>
  154. <if test=" null != endDate and '' != endDate">and `end_date` = #{endDate}</if>
  155. <if test=" null != rentShopType and '' != rentShopType">and `rent_shop_type` = #{rentShopType}</if>
  156. <if test=" null != operationType and '' != operationType">and `operation_type` = #{operationType}</if>
  157. <if test=" null != queryShopId and '' != queryShopId">and json_contains(json_extract(rent_info,'$[*].id'),concat('"',#{queryShopId},'"'))</if>
  158. <if test=" null != shopNumber and shopNumber!=''">
  159. and shop_name like concat('%',#{shopNumber},'%')
  160. </if>
  161. <if test=" null != businessForRule and '' != businessForRule ">
  162. and business_id in (${businessForRule})
  163. </if>
  164. <if test="null != floorForRule and '' != floorForRule ">
  165. and `id` in
  166. <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")">
  167. select id from wx_rent_contract where 1=1
  168. <if test=" null != tenantId and '' != tenantId">
  169. and `tenant_id` = #{tenantId}
  170. </if>
  171. <if test=" null != parentTenantId and '' != parentTenantId">
  172. and `parent_tenant_id` = #{parentTenantId}
  173. </if>
  174. and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select
  175. id from wx_shop where 1=1
  176. <if test=" null != tenantId and '' != tenantId">
  177. and `tenant_id` = #{tenantId}
  178. </if>
  179. <if test=" null != parentTenantId and '' != parentTenantId">
  180. and `parent_tenant_id` = #{parentTenantId}
  181. </if>
  182. and floor in (${floorForRule}))
  183. </foreach>
  184. </if>
  185. <if test=" null != statuss ">
  186. and status in
  187. <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")">
  188. #{statusItem}
  189. </foreach>
  190. </if>
  191. <if test=" null != ids ">
  192. and id in
  193. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  194. #{idItem}
  195. </foreach>
  196. </if>
  197. <if test=" null != sortColumns">order by ${sortColumns}</if>
  198. </sql>
  199. <select id="findList" parameterType="com.iformall.domain.po.WxRentContract" resultMap="BaseResultMap">
  200. select
  201. <include refid="allColumns"/>
  202. from wx_rent_contract
  203. <include refid="dynamicWhereConditions"/>
  204. </select>
  205. <!-- 需要修改 -->
  206. <!-- <select id="queryRentContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract">
  207. select rc.id,rc.merchant_name merchantName,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.`status`,
  208. rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,f.floor_name floorName,b.building_name buildingName,
  209. rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type,
  210. rc.start_date startDate,rc.end_date endDate,br.`name` brandName,rc.apply_status applyStatus,rc.bank_name
  211. bankName,rc.rent_shop_type rentShopType,rc.fix_start_date fixStartDate,rc.fix_end_date fixEndDate
  212. ,rc.business_type businessType,rc.adjust_period adjustPeriod,rc.rent_info rentInfo, rc.file_names
  213. fileNames,rc.price_unit,rc.subject_name subjectName,rc.`rent_input_way` rentInputWay,rc.`adjust_ratio_way`
  214. adjustRatioWay,rc.bus_discount_ratio,rc.bus_discount_time
  215. from wx_rent_contract rc
  216. left join wx_shop s on rc.shop_id=s.id
  217. left join wx_mall_floor f on s.floor=f.id
  218. left join wx_mall_building b on s.building=b.id
  219. left join wx_brand br on rc.brand=br.id
  220. <where>
  221. <if test=" null != tenantId and '' != tenantId">
  222. and rc.`tenant_id` = #{tenantId}
  223. </if>
  224. <if test=" null != parentTenantId and '' != parentTenantId">
  225. and rc.`parent_tenant_id` = #{parentTenantId}
  226. </if>
  227. <if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like concat('%',#{merchantName},'%')</if>
  228. <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1">
  229. and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%')
  230. </if>
  231. <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==2">
  232. and s.`shop_number` like concat('%',#{shopNumber},'%')
  233. </if>
  234. <if test=" null != status ">and rc.`status` = #{status}</if>
  235. <if test=" null != shopId">and rc.`shop_id` = #{shopId}</if>
  236. <if test=" null != type ">and rc.`type` = #{type}</if>
  237. <if test=" null != rentShopType ">and rc.`rent_shop_type` = #{rentShopType}</if>
  238. <if test=" null != applyStatus ">and rc.`apply_status` = #{applyStatus}</if>
  239. <if test=" null != building and ''!= building">and b.id = #{building}</if>
  240. <if test=" null != floor and ''!= floor">and f.id = #{floor}</if>
  241. <if test=" null != operationType ">and `operation_type` = #{operationType}</if>
  242. <if test=" null != businessForRule and '' != businessForRule ">
  243. and rc.business_id in (${businessForRule})
  244. </if>
  245. <if test="null != rentShopType and 1 == rentShopType and null != floorForRule and '' != floorForRule ">
  246. and rc.`id` in
  247. <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")">
  248. select id from wx_rent_contract where 1=1
  249. <if test=" null != tenantId and '' != tenantId">
  250. and `tenant_id` = #{tenantId}
  251. </if>
  252. <if test=" null != parentTenantId and '' != parentTenantId">
  253. and `parent_tenant_id` = #{parentTenantId}
  254. </if>
  255. and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select
  256. id from wx_shop where 1=1
  257. <if test=" null != tenantId and '' != tenantId">
  258. and `tenant_id` = #{tenantId}
  259. </if>
  260. <if test=" null != parentTenantId and '' != parentTenantId">
  261. and `parent_tenant_id` = #{parentTenantId}
  262. </if>
  263. and floor in (${floorForRule}))
  264. </foreach>
  265. </if>
  266. <if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule ">
  267. and rc.shop_id in (select id from wx_shop where 1=1
  268. <if test=" null != tenantId and '' != tenantId">
  269. and `tenant_id` = #{tenantId}
  270. </if>
  271. <if test=" null != parentTenantId and '' != parentTenantId">
  272. and `parent_tenant_id` = #{parentTenantId}
  273. </if>
  274. and floor in (${floorForRule}))
  275. </if>
  276. <if test=" null != merchantId">and rc.`merchant_id` = #{merchantId}</if>
  277. </where>
  278. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  279. <if test=" null == sortColumns"> order by rc.createtime desc,rc.id desc </if>
  280. </select> -->
  281. <select id="queryRentContractCountByStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
  282. select count(1) from wx_rent_contract where status=#{status}
  283. <if test=" null != tenantId and '' != tenantId">
  284. and `tenant_id` = #{tenantId}
  285. </if>
  286. <if test=" null != parentTenantId and '' != parentTenantId">
  287. and `parent_tenant_id` = #{parentTenantId}
  288. </if>
  289. <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
  290. </select>
  291. <!-- <select id="queryRentContractWaitSignStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
  292. select count(id) from wx_rent_contract where status=#{status}
  293. <if test=" null != tenantId and '' != tenantId">
  294. and `tenant_id` = #{tenantId}
  295. </if>
  296. <if test=" null != parentTenantId and '' != parentTenantId">
  297. and `parent_tenant_id` = #{parentTenantId}
  298. </if>
  299. <if test=" null != rentShopType ">
  300. and rent_shop_type = #{rentShopType}
  301. </if>
  302. </select> -->
  303. <!-- <select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
  304. select count(id) from wx_rent_contract where status=4
  305. <if test=" null != tenantId and '' != tenantId">
  306. and `tenant_id` = #{tenantId}
  307. </if>
  308. <if test=" null != parentTenantId and '' != parentTenantId">
  309. and `parent_tenant_id` = #{parentTenantId}
  310. </if>
  311. <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
  312. </select> -->
  313. <!-- <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
  314. select count(id) from wx_rent_contract where status in (2,3,4)
  315. <if test=" null != tenantId and '' != tenantId">
  316. and `tenant_id` = #{tenantId}
  317. </if>
  318. <if test=" null != parentTenantId and '' != parentTenantId">
  319. and `parent_tenant_id` = #{parentTenantId}
  320. </if>
  321. <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
  322. </select> -->
  323. <!-- <select id="queryRentContractEndStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
  324. select count(id) from wx_rent_contract where status!=0 and status!=1 and status!=6 and status!=7 and rental_end_date &lt;now()
  325. <if test=" null != tenantId and '' != tenantId">
  326. and `tenant_id` = #{tenantId}
  327. </if>
  328. <if test=" null != parentTenantId and '' != parentTenantId">
  329. and `parent_tenant_id` = #{parentTenantId}
  330. </if>
  331. <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
  332. </select> -->
  333. <!-- <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract">
  334. update wx_rent_contract set status=#{status} where status not in(0,1,5,6,7,8)
  335. <if test=" null != tenantId and '' != tenantId">
  336. and `tenant_id` = #{tenantId}
  337. </if>
  338. <if test=" null != parentTenantId and '' != parentTenantId">
  339. and `parent_tenant_id` = #{parentTenantId}
  340. </if>
  341. and DATEDIFF(rental_end_date,now()) &lt;= 30 and rental_end_date > now()
  342. </update> -->
  343. <!-- <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract">
  344. update wx_rent_contract set status=#{status} where status not in(0,1,5,6,7,8)
  345. <if test=" null != tenantId and '' != tenantId">
  346. and `tenant_id` = #{tenantId}
  347. </if>
  348. <if test=" null != parentTenantId and '' != parentTenantId">
  349. and `parent_tenant_id` = #{parentTenantId}
  350. </if>
  351. and rental_start_date &lt;= now() and rental_end_date >= now()
  352. </update> -->
  353. <!-- <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract">
  354. update wx_rent_contract set status=#{status} where status not in(0,1,5,6,7,8)
  355. <if test=" null != tenantId and '' != tenantId">
  356. and `tenant_id` = #{tenantId}
  357. </if>
  358. <if test=" null != parentTenantId and '' != parentTenantId">
  359. and `parent_tenant_id` = #{parentTenantId}
  360. </if>
  361. and rental_end_date &lt;now()
  362. </update> -->
  363. <!-- <update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxRentContract">
  364. update wx_rent_contract set status=#{status} where status not in(0,5,6,7)
  365. <if test=" null != tenantId and '' != tenantId">
  366. and `tenant_id` = #{tenantId}
  367. </if>
  368. <if test=" null != parentTenantId and '' != parentTenantId">
  369. and `parent_tenant_id` = #{parentTenantId}
  370. </if>
  371. and merchant_id is null
  372. </update> -->
  373. <update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxRentContract">
  374. update wx_rent_contract
  375. set apply_status=#{applyStatus}
  376. <if test=" null != businessType ">,business_type=#{businessType}</if>
  377. <if test=" null != status ">,status=#{status}</if>
  378. where id=#{id}
  379. </update>
  380. <update id="updateStatus" parameterType="com.iformall.domain.po.WxRentContract">
  381. update wx_rent_contract set status=#{status} where id=#{id}
  382. </update>
  383. <!-- <update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract">
  384. update wx_rent_contract set status=#{status} where shop_id in (
  385. select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE status in(2,3,4)
  386. <if test=" null != tenantId and '' != tenantId">
  387. and `tenant_id` = #{tenantId}
  388. </if>
  389. <if test=" null != parentTenantId and '' != parentTenantId">
  390. and `parent_tenant_id` = #{parentTenantId}
  391. </if>
  392. )s) and status in(0,1) and status!=7 and rent_shop_type=2
  393. </update> -->
  394. <!-- <select id="getRentContractList" parameterType="com.iformall.domain.po.WxRentContract"
  395. resultType="com.iformall.domain.po.WxRentContract">
  396. select s.shop_id,s.shop_number,s.building_name building, s.floor_name floor,s.build_area,rc.* from (
  397. select s.id shop_id,ms.merchant_id,s.shop_number,b.building_name,f.floor_name,s.build_area,s.floor,s.building
  398. from wx_shop s
  399. left join wx_mall_building b on s.building=b.id
  400. left join wx_mall_floor f on s.floor=f.id
  401. left join wx_merchant_shop ms on s.id=ms.shop_id
  402. where ms.is_del=0) s
  403. inner join (select * from wx_rent_contract where status in(2,3,4)) rc on s.merchant_id=rc.merchant_id
  404. where 1=1
  405. <if test=" null != tenantId and '' != tenantId">
  406. and rc.`tenant_id` = #{tenantId}
  407. </if>
  408. <if test=" null != parentTenantId and '' != parentTenantId">
  409. and rc.`parent_tenant_id` = #{parentTenantId}
  410. </if>
  411. <if test=" null != shopNumber and ''!=shopNumber">
  412. and s.shop_number like concat('%', #{shopNumber},'%')
  413. </if>
  414. <if test=" null != floor and ''!=floor">
  415. and s.floor = #{floor}
  416. </if>
  417. <if test=" null != building and ''!=building">
  418. and s.building = #{building}
  419. </if>
  420. order by rc.id desc
  421. </select> -->
  422. <select id="updateStatusForUnsign" parameterType="com.iformall.domain.po.WxRentContract">
  423. update wx_rent_contract set status=1 where status=2 and merchant_id is null
  424. <if test=" null != tenantId and '' != tenantId">
  425. and `tenant_id` = #{tenantId}
  426. </if>
  427. <if test=" null != parentTenantId and '' != parentTenantId">
  428. and `parent_tenant_id` = #{parentTenantId}
  429. </if>
  430. </select>
  431. <!-- <select id="getRentInvalidList" parameterType="com.iformall.domain.po.WxRentContract"
  432. resultType="com.iformall.domain.po.WxRentContract">
  433. select id from wx_rent_contract where shop_id in (
  434. select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE status in(2,3,4)
  435. <if test=" null != tenantId and '' != tenantId">
  436. and `tenant_id` = #{tenantId}
  437. </if>
  438. <if test=" null != parentTenantId and '' != parentTenantId">
  439. and `parent_tenant_id` = #{parentTenantId}
  440. </if>
  441. )s) and status in(0,1) and status!=7 and apply_status=1
  442. <if test=" null != tenantId and '' != tenantId">
  443. and `tenant_id` = #{tenantId}
  444. </if>
  445. <if test=" null != parentTenantId and '' != parentTenantId">
  446. and `parent_tenant_id` = #{parentTenantId}
  447. </if>
  448. </select> -->
  449. <select id="queryOweCount" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long">
  450. select count(1) from wx_rent_contract r,wx_bill_rent b
  451. where b.rent_contract_id = r.id and b.status = 1 and r.id = #{id}
  452. </select>
  453. <select id="getMerchants" parameterType="com.iformall.domain.po.WxRentContract"
  454. resultType="com.iformall.domain.po.WxRentContract">
  455. select <include refid="allColumns"/> from wx_rent_contract where status in(2,3,4)
  456. and merchant_id not in(select merchant_id from wx_property_contract where status in(2,3,4))
  457. <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
  458. </select>
  459. <select id="selectRentContractCountByShopId" parameterType="java.util.Map" resultType="int">
  460. select count(1) from wx_rent_contract where 1=1
  461. <if test=" null != tenantId and '' != tenantId">
  462. and `tenant_id` = #{tenantId}
  463. </if>
  464. <if test=" null != parentTenantId and '' != parentTenantId">
  465. and `parent_tenant_id` = #{parentTenantId}
  466. </if>
  467. and json_contains(json_extract(rent_info,'$[*].id'),concat('"',#{shopId},'"')) and status in (2,3,4)
  468. <if test="id!=null">
  469. and id!=#{id}
  470. </if>
  471. </select>
  472. <select id="selectRentContractByShopId" parameterType="com.iformall.domain.po.WxRentContract"
  473. resultType="com.iformall.domain.po.WxRentContract">
  474. select <include refid="allColumns"/> from wx_rent_contract
  475. where 1=1
  476. <if test=" null != tenantId and '' != tenantId">
  477. and `tenant_id` = #{tenantId}
  478. </if>
  479. <if test=" null != parentTenantId and '' != parentTenantId">
  480. and `parent_tenant_id` = #{parentTenantId}
  481. </if>
  482. and json_contains(json_extract(rent_info,'$[*].id'),concat('"',${shopId},'"')) and rent_shop_type =1
  483. <if test=" null != status ">and status=#{status} and status!=7</if>
  484. </select>
  485. <!-- <update id="updateInvalidContract" parameterType="com.iformall.domain.po.WxRentContract">
  486. update wx_rent_contract set status=#{status}
  487. where 1=1
  488. <if test=" null != tenantId and '' != tenantId">
  489. and `tenant_id` = #{tenantId}
  490. </if>
  491. <if test=" null != parentTenantId and '' != parentTenantId">
  492. and `parent_tenant_id` = #{parentTenantId}
  493. </if>
  494. and id in(select r.id from (
  495. select id from wx_rent_contract where json_contains(json_extract(rent_info,'$[*].shopId'),concat('"',${shopId},'"'))
  496. and rent_shop_type=1 and status in(0,1) and status!=7)r)
  497. </update> -->
  498. <select id="selectRentContractByMerchantId" parameterType="com.iformall.domain.po.WxRentContract"
  499. resultType="com.iformall.domain.po.WxRentContract">
  500. select <include refid="allColumns"/> from wx_rent_contract
  501. where status in(2,3,4)
  502. and merchant_id = #{merchantId}
  503. </select>
  504. <select id="hasContractNumber" parameterType="com.iformall.domain.po.WxRentContract"
  505. resultType="int">
  506. select count(1) from (
  507. select * from wx_rent_contract where contract_number=#{contractNumber}
  508. and status not in(5,6,7)
  509. <if test=" null != tenantId and '' != tenantId">
  510. and `tenant_id` = #{tenantId}
  511. </if>
  512. <if test=" null != parentTenantId and '' != parentTenantId">
  513. and `parent_tenant_id` = #{parentTenantId}
  514. </if>
  515. union
  516. select * from wx_rent_contract where contract_number=#{contractNumber}
  517. and apply_status in(1,2)
  518. <if test=" null != tenantId and '' != tenantId">
  519. and `tenant_id` = #{tenantId}
  520. </if>
  521. <if test=" null != parentTenantId and '' != parentTenantId">
  522. and `parent_tenant_id` = #{parentTenantId}
  523. </if>
  524. ) r
  525. <where>
  526. <if test="id!=null and id!=''">
  527. r.id!=#{id}
  528. </if>
  529. </where>
  530. </select>
  531. <!-- <select id="getShopType" parameterType="com.iformall.domain.po.WxRentContract" resultType="int">
  532. select s.type
  533. from wx_rent_contract r
  534. left join wx_shop s on(s.id = r.`shop_id`)
  535. where r.id = #{id}
  536. </select> -->
  537. <resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo">
  538. <id column="id" property="id"/>
  539. <result column="tenant_id" property="tenantId"/>
  540. <result column="parent_tenant_id" property="parentTenantId"/>
  541. <result column="rent_id" property="rentId"/>
  542. <result column="property_id" property="propertyId"/>
  543. <result column="shop_name" property="shopName"/>
  544. <result column="merchant_name" property="merchantName"/>
  545. <result column="rent_info" property="rentInfo"/>
  546. <result column="rental_start_date" property="rentalStartDate"/>
  547. <result column="rental_end_date" property="rentalEndDate"/>
  548. <result column="rent_price" property="rentPrice"/>
  549. <result column="property_price" property="propertyPrice"/>
  550. <result column="type" property="type"/>
  551. <result column="status" property="status"/>
  552. <result column="apply_status" property="applyStatus"/>
  553. <result column="operation_type" property="operationType"/>
  554. <result column="rent_shop_type" property="rentShopType"/>
  555. <result column="merchant_id" property="merchantId"/>
  556. <result column="property_status" property="propertyStatus"/>
  557. <result column="rent_price_unit" property="rentPriceUnit"/>
  558. <result column="property_price_unit" property="propertyPriceUnit"/>
  559. <result column="bus_discount_time" property="busDiscountTime"/>
  560. <result column="bus_discount_ratio" property="busDiscountRatio"/>
  561. </resultMap>
  562. <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap">
  563. select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.id as rent_id, pc.id as property_id, rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`,
  564. rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status,
  565. rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status,
  566. rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,
  567. rc.business_type businessType,rc.bus_discount_ratio,rc.bus_discount_time
  568. from wx_rent_contract rc left join wx_property_contract pc on rc.id=pc.rent_contract_id
  569. <where>
  570. <if test=" null != tenantId and '' != tenantId">
  571. and rc.`tenant_id` = #{tenantId}
  572. </if>
  573. <if test=" null != parentTenantId and '' != parentTenantId">
  574. and rc.`parent_tenant_id` = #{parentTenantId}
  575. </if>
  576. <if test=" null != contractNumber and '' != contractNumber">
  577. and rc.`contract_number` = #{contractNumber}
  578. </if>
  579. <if test=" null != rentId and '' != rentId">
  580. and rc.`id` = #{rentId}
  581. </if>
  582. <if test=" null != propertyId and '' != propertyId">
  583. and pc.`id` = #{propertyId}
  584. </if>
  585. <if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like
  586. concat('%',#{merchantName},'%')
  587. </if>
  588. <if test=" null != shopNumber and shopNumber!=''">
  589. and (json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') or rc.shop_name like concat('%',#{shopNumber},'%') )
  590. </if>
  591. <!-- <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1">
  592. and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%')
  593. </if>
  594. <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==2">
  595. and s.`shop_number` like concat('%',#{shopNumber},'%')
  596. </if> -->
  597. <if test=" null != status ">and rc.`status` = #{status}</if>
  598. <if test=" null != type ">and rc.`type` = #{type}</if>
  599. <if test=" null != rentShopType ">
  600. and rc.`rent_shop_type` = #{rentShopType}
  601. </if>
  602. <if test=" null != applyStatus ">and rc.`apply_status` = #{applyStatus}</if>
  603. <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if>
  604. <if test=" null != businessForRule and '' != businessForRule ">
  605. and rc.business_id in (${businessForRule})
  606. </if>
  607. <if test="null != floorForRule and '' != floorForRule ">
  608. and rc.`id` in
  609. <foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")">
  610. select id from wx_rent_contract where 1=1
  611. <if test=" null != tenantId and '' != tenantId">
  612. and `tenant_id` = #{tenantId}
  613. </if>
  614. <if test=" null != parentTenantId and '' != parentTenantId">
  615. and `parent_tenant_id` = #{parentTenantId}
  616. </if>
  617. and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select
  618. id from wx_shop where 1=1
  619. <if test=" null != tenantId and '' != tenantId">
  620. and `tenant_id` = #{tenantId}
  621. </if>
  622. <if test=" null != parentTenantId and '' != parentTenantId">
  623. and `parent_tenant_id` = #{parentTenantId}
  624. </if>
  625. and floor in (${floorForRule}))
  626. </foreach>
  627. </if>
  628. <!-- <if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule ">
  629. and rc.shop_id in (select id from wx_shop where 1=1
  630. <if test=" null != tenantId and '' != tenantId">
  631. and `tenant_id` = #{tenantId}
  632. </if>
  633. <if test=" null != parentTenantId and '' != parentTenantId">
  634. and `parent_tenant_id` = #{parentTenantId}
  635. </if>
  636. and floor in (${floorForRule}))
  637. </if> -->
  638. </where>
  639. <if test=" null != sortColumns">order by ${sortColumns}</if>
  640. <if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if>
  641. </select>
  642. <select id="getByBill" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap">
  643. select <include refid="allColumns"/> from wx_rent_contract
  644. where id in(
  645. select rent_contract_id from wx_bill_rent id = #{id}
  646. )
  647. </select>
  648. <select id="getShopCountMax" resultType="int">
  649. select max(json_length(rent_info)) from wx_rent_contract
  650. </select>
  651. <select id="queryContractByBus" resultType="hashmap" parameterType="com.iformall.domain.po.WxBusiness">
  652. select 1 type,c.`rental_start_date`,c.`rental_end_date`,c.id id from wx_merchant m left join wx_rent_contract c on(m.id = c.merchant_id)
  653. where m.business_id = #{id} and c.price is not null and c.`rental_start_date` is not null and c.`rental_end_date` is not null
  654. union all
  655. select 2 type,c.`rental_start_date`,c.`rental_end_date`,c.id id from wx_merchant m left join wx_property_contract c on(m.id = c.merchant_id)
  656. where m.business_id = #{id} and c.price is not null and c.`rental_start_date` is not null and c.`rental_end_date` is not null
  657. </select>
  658. <!-- <select id="selectRentContractByShopIds" resultType="com.iformall.domain.po.WxRentContract">
  659. SELECT rc.id,rc.rental_start_date,rc.rental_end_date,rc.`shop_id`,rc.`rent_shop_type`,rc.`rent_info` FROM
  660. `wx_rent_contract` rc
  661. WHERE rc.`status` IN (2,3,4) AND status!=7
  662. <if test=" null != tenantId and '' != tenantId">
  663. and `tenant_id` = #{tenantId}
  664. </if>
  665. <if test=" null != parentTenantId and '' != parentTenantId">
  666. and `parent_tenant_id` = #{parentTenantId}
  667. </if>
  668. AND ( (rc.`rent_shop_type`=2 AND rc.`shop_id` IN
  669. <foreach collection="shopIds" index="index" item="idItem" open="(" separator="," close=")">
  670. #{idItem}
  671. </foreach>
  672. )
  673. OR (rc.`rent_shop_type`=1 AND rc.`rent_info` REGEXP #{shopIdsRegexp})
  674. )
  675. </select> -->
  676. <!-- <select id="selectContractCountByShopId" parameterType="com.iformall.domain.po.WxRentContract" resultType="int">
  677. SELECT count(*)
  678. FROM wx_rent_contract
  679. WHERE `status` = #{status} AND status!=7
  680. <if test=" null != tenantId and '' != tenantId">
  681. and `tenant_id` = #{tenantId}
  682. </if>
  683. <if test=" null != parentTenantId and '' != parentTenantId">
  684. and `parent_tenant_id` = #{parentTenantId}
  685. </if>
  686. AND (
  687. `rent_shop_type` = 1 AND
  688. json_contains(json_extract(rent_info, '$[*].shopId'), concat('"', #{shopId}, '"'))
  689. OR
  690. `rent_shop_type` = 2 AND `shop_id` = #{shopId}
  691. )
  692. </select> -->
  693. <!-- <select id="getContractByMerchant" resultType="com.iformall.domain.po.WxRentContract" parameterType="com.iformall.domain.po.WxRentContract">
  694. select * from wx_rent_contract where merchant_id = #{merchantId} and status=3
  695. </select> -->
  696. <select id="getCanApplyCount" resultType="Integer" parameterType="Long">
  697. select count(1) from wx_rent_contract where id != #{id} and (status=1 or (status=10 and apply_status=3) )
  698. </select>
  699. <select id="getMerchantIdsByStatuss" resultType="Long" parameterType="com.iformall.domain.po.WxRentContract">
  700. select distinct merchant_id from wx_rent_contract where 1=1
  701. <if test=" null != tenantId and '' != tenantId">
  702. and `tenant_id` = #{tenantId}
  703. </if>
  704. <if test=" null != parentTenantId and '' != parentTenantId">
  705. and `parent_tenant_id` = #{parentTenantId}
  706. </if>
  707. and status in
  708. <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")">
  709. #{statusItem}
  710. </foreach>
  711. </select>
  712. <select id="findRentByShop" parameterType="Long" resultType="hashmap">
  713. select
  714. rc.`id`,rc.`merchant_id`,
  715. rc.`shop_type_sub`,rc.`lease_purpose`,rc.`contractual_rules`,rc.`delivery_date`,rc.`delivery_grace_period`,rc.`opening_date`,rc.`business_hours`,rc.`scope_metre`,
  716. rc.`price`,rc.rent_area,rc.`rental_start_date`,rc.`rental_end_date`,rc.`sign_date`,rc.`receive_period`,
  717. rc.`tenant_id`,rc.`parent_tenant_id`,rc.`filepath`,rc.`status`,rc.`contract_number`,
  718. rc.`first_party_bank_info`,rc.`second_party_bank_info`,rc.`second_party_tax_info`,
  719. rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`,
  720. rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`,
  721. rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`,
  722. rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`,
  723. rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`,
  724. rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`,
  725. rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type,
  726. rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time
  727. from wx_shop s
  728. left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
  729. left join wx_merchant m on ms.merchant_id=m.id
  730. left join wx_rent_contract rc on rc.merchant_id = m.id and rc.is_del=0
  731. where s.`id` = #{shopId}
  732. and rc.`status` in (2,3)
  733. and rc.`rental_start_date` &lt;= now() and rc.rental_end_date >= now()
  734. order by rc.`updatetime` desc;
  735. </select>
  736. <select id="currentValidByMerchantId" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap">
  737. select
  738. rc.`id`,rc.`merchant_id`,
  739. rc.`shop_type_sub`,rc.`lease_purpose`,rc.`contractual_rules`,rc.`delivery_date`,rc.`delivery_grace_period`,rc.`opening_date`,rc.`business_hours`,rc.`scope_metre`,
  740. rc.`price`,rc.rent_area,rc.`rental_start_date`,rc.`rental_end_date`,rc.`sign_date`,rc.`receive_period`,
  741. rc.`tenant_id`,rc.`parent_tenant_id`,rc.`filepath`,rc.`status`,rc.`contract_number`,
  742. rc.`first_party_bank_info`,rc.`second_party_bank_info`,rc.`second_party_tax_info`,
  743. rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`,
  744. rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`,
  745. rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`,
  746. rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`,
  747. rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`,
  748. rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`,
  749. rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type,
  750. rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time
  751. from wx_rent_contract rc
  752. where rc.is_del = 0
  753. <if test=" null != tenantId and '' != tenantId">
  754. and rc.`tenant_id` = #{tenantId}
  755. </if>
  756. <if test=" null != parentTenantId and '' != parentTenantId">
  757. and rc.`parent_tenant_id` = #{parentTenantId}
  758. </if>
  759. and rc.`merchant_id` = #{merchantId}
  760. <if test=" null != shopNumber and shopNumber!=''">
  761. and rc.shop_name like concat('%',#{shopNumber},'%')
  762. </if>
  763. and rc.`rental_start_date` &lt;= now() and rc.rental_end_date >= now()
  764. <if test=" null != statuss ">
  765. and rc.`status` in
  766. <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")">
  767. #{statusItem}
  768. </foreach>
  769. </if>
  770. </select>
  771. </mapper>