`id`,`tenant_id`,`parent_tenant_id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`, `pay_date`,`createtime`,`expired_day`,`owe`,`status`,`is_del`,`need_pay`,`apply_status`,`apply_pay_img`,`apply_update_time`, `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`return_price`,`shop_info`,`pay_way`,freeze,service_charge_pay where 1 = 1 and `id` = #{id} and `tenant_id` = #{tenantId} and `parent_tenant_id` = #{parentTenantId} and `property_contract_id` = #{propertyContractId} and `receive_pay` = #{receivePay} and `pay` = #{pay} and `receive_date` = #{receiveDate} and `pay_date` = #{payDate} and `createtime` = #{createtime} and `expired_day` = #{expiredDay} and `owe` = #{owe} and `status` = #{status} and `apply_status` = #{applyStatus} and `is_del` = #{isDel} and `need_pay` = #{needPay} and `merchant_id` = #{merchantId} and `user_id` = #{userId} and `shop_id` = #{shopId} and `updatetime` = #{updatetime} and `rent_shop_type` = #{rentShopType} and `pay_way` = #{payWay} and property_contract_id in #{pidItem} and id in #{idItem} order by ${sortColumns} and br.`id` = #{id} and br.`tenant_id` = #{tenantId} and br.`parent_tenant_id` = #{parentTenantId} and br.`merchant_id` = #{merchantId} and br.`status` = #{status} and br.`apply_status` = #{applyStatus} and br.`is_del` = #{isDel} and br.`rent_shop_type` = #{rentShopType} and br.`property_contract_id` = #{propertyContractId} and br.`pay_way` = #{payWay} and br.`starttime` <= #{starttime} and br.`endtime` >= #{endtime} and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} and br.`owe` > 0 and br.`merchant_id` in #{midItem} update wx_bill_property_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) where status!=#{paid} and `tenant_id` = #{tenantId} and `parent_tenant_id` = #{parentTenantId} and status!=5 and DATEDIFF(now(),receive_date)>0 update wx_bill_property_deposit set status=#{waitPay} where id in( select a.id from (select br.id,rc.receive_period,br.property_contract_id,br.receive_date from wx_bill_property_deposit br left join wx_property_contract rc on br.property_contract_id=rc.id where br.status!=#{paid} and br.`tenant_id` = #{tenantId} and br.`parent_tenant_id` = #{parentTenantId} and br.status!=5 and now() < br.receive_date and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a)