`id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,
`sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`,
`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,
`shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`,
`link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`,
`start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`, `file_names`
where 1 = 1
and `id` = #{id}and `merchant_id` = #{merchantId}and `price` = #{price}and `rental_start_date` = #{rentalStartDate}and `rental_end_date` = #{rentalEndDate}and `sign_date` = #{signDate}and `receive_period` = #{receivePeriod}and `tenant_id` = #{tenantId}and `filepath` = #{filepath}and `status` = #{status}and `contract_number` = #{contractNumber}and `deposit` = #{deposit}and `pay_date` = #{payDate}and `is_del` = #{isDel}and `merchant_name` = #{merchantName}and `brand` = #{brand}and `business_id` = #{businessId}and `shop_type` = #{shopType}and `shop_id` = #{shopId}and `updatetime` = #{updatetime}and `createtime` = #{createtime}and `rent_area` = #{rentArea}and `link_person` = #{linkPerson}and `link_phone` = #{linkPhone}and `pay_account` = #{payAccount}and `filename` = #{filename}and `lease` = #{lease}and `rent_contract_id` = #{rentContractId}and `start_date` = #{startDate}and `end_date` = #{endDate}and `rent_shop_type` = #{rentShopType}
and id in
#{idItem}
order by ${sortColumns}
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now()
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now()
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and rental_end_date <now()
update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=7 and merchant_id is null
update wx_property_contract set status=#{status} where shop_id in (
select s.shop_id from (SELECT shop_id FROM wx_property_contract WHERE tenant_id = #{tenantId} and merchant_id is not null and status!=6
)s) and merchant_id is null and tenant_id=#{tenantId}
update wx_property_contract set apply_status=#{applyStatus}
,business_type=#{businessType},status=#{status}
where id=#{id}
update wx_property_contract set status=#{status} where id=#{id}
update wx_property_contract set status=#{status} where rent_contract_id=#{rentContractId}