@@ -112,7 +112,7 @@
rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,f.floor_name floorName,b.building_name buildingName,
rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type,
rc.start_date startDate,rc.end_date endDate,br.`name` brandName,rc.apply_status applyStatus,rc.bank_name
bankName,rc.merchant_id merchantId,rc. rent_shop_type rentShopType,rc.fix_start_date fixStartDate,rc.fix_end_date fixEndDate
bankName,rc.rent_shop_type rentShopType,rc.fix_start_date fixStartDate,rc.fix_end_date fixEndDate
,rc.business_type businessType,rc.adjust_period adjustPeriod,rc.rent_info rentInfo, rc.file_names fileNames
from wx_rent_contract rc
left join wx_shop s on rc.shop_id=s.id
@@ -122,9 +122,14 @@
<where>
rc.tenant_id=#{tenantId}
<if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like concat('%',#{merchantName},'%')</if>
<if test=" null != shopNumber and shopNumber!=''">and s.`shop_number` like concat('%',#{shopNumber},'%')</if>
<if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1">
and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%')
</if>
<if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==2">
and s.`shop_number` like concat('%',#{shopNumber},'%')
</if>
<if test=" null != status ">and rc.`status` = #{status}</if>
<if test=" null != shopId ">and rc.`shop_id` = #{shopId}</if>
<if test=" null != shopId">and rc.`shop_id` = #{shopId}</if>
<if test=" null != type ">and rc.`type` = #{type}</if>
<if test=" null != rentShopType ">and rc.`rent_shop_type` = #{rentShopType}</if>
@@ -186,7 +191,7 @@
<update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where shop_id in (
select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status in(2,3,4)
)s) and status=1 and status!=7 and tenant_id=#{tenantId}
)s) and status=1 and status!=7 and tenant_id=#{tenantId} and rent_shop_type=2
</update>
<select id="getRentContractList" parameterType="com.iformall.domain.po.WxRentContract"
@@ -227,5 +232,10 @@
<select id="selectRentContractCountByShopId" parameterType="com.iformall.domain.po.WxRentContract" resultType="int">
select count(*) from wx_rent_contract where tenant_id=#{tenantId} and json_contains(json_extract(rent_info,'$[*].shopId'),concat('"',${shopId},'"')) and status in (2,3,4)
</select>
<update id="updateInvalidContract" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and id in(select r.id from (
select id from wx_rent_contract where json_contains(json_extract(rent_info,'$[*].shopId'),concat('"',${shopId},'"'))
and rent_shop_type=1 and status in(0,1) and status!=7)r)
</update>
</mapper>