diff --git a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml index af370fdb4..047b72128 100644 --- a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml @@ -119,7 +119,11 @@ and rc.`merchant_name` like concat('%',#{merchantName},'%') - and s.`shop_number` like concat('%',#{shopNumber},'%') + + and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') + + + and s.`shop_number` like concat('%',#{shopNumber},'%') and rc.`status` = #{status} and rc.`rent_contract_id` = #{rentContractId} diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 7cc7b0323..89997e4f6 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -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 @@ rc.tenant_id=#{tenantId} and rc.`merchant_name` like concat('%',#{merchantName},'%') - and s.`shop_number` like concat('%',#{shopNumber},'%') + + and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') + + + and s.`shop_number` like concat('%',#{shopNumber},'%') + and rc.`status` = #{status} - and rc.`shop_id` = #{shopId} + and rc.`shop_id` = #{shopId} and rc.`type` = #{type} and rc.`rent_shop_type` = #{rentShopType} @@ -186,7 +191,7 @@ 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 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) +