create table wx_rent_contract_20200826 like wx_rent_contract;
insert into wx_rent_contract_20200826 select * from wx_rent_contract;
//更新多经点的合同的rentInfo
UPDATE wx_rent_contract wrc INNER JOIN wx_shop s ON wrc.shop_id = s.id
SET rent_info = JSON_ARRAY(JSON_OBJECT("id",s.id,"pointType",s.`point_type`,"addr",s.`addr`,"type",s.`type`,"floor",s.`floor`,"price","NAN","imgUrl",s.`img_url`,"shopId",s.id,"status",s.`status`,"deposit",wrc.`deposit`,"manager",s.`manager`,"building",s.`building`,"rentArea",wrc.`rent_area`,"buildArea",s.`build_area`,"shopNumber",s.`shop_number`,"adjustRatio",'[]',"managerPhone",s.`manager_phone`,"operationArea",s.`operation_area`))
WHERE wrc.rent_info IS NULL AND wrc.shop_id IS NOT NULL ;
//删除店铺不存在的垃圾数据
DELETE FROM wx_rent_contract WHERE shop_id IS NOT NULL AND shop_id NOT IN (SELECT id FROM wx_shop);
ALTER TABLE wx_rent_contract DROP COLUMN shop_id;
create table wx_property_contract_20200826 like wx_property_contract;
@@ -61,11 +70,13 @@ insert into wx_property_contract_20200826 select * from wx_property_contract;
ALTER TABLE wx_property_contract DROP COLUMN shop_id;
ALTER TABLE `wx_rent_contract` ADD COLUMN `shop_name` VARCHAR(100) COMMENT '店铺名称';
@@ -681,10 +681,10 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除");
}
wxRentContractQuery.setId(record.getId());
int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery.getTenantId(),wxRentContractQuery.getParentTenantId(),shopId,wxRentContractQuery.getId());
if (count > 0) {
return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租");