diff --git a/mallinkAdmin/src/main/resources/db/migration/V201904012109__ADD_RENT_FILES.sql b/mallinkAdmin/src/main/resources/db/migration/V201904012109__ADD_RENT_FILES.sql index 24362e491..c3851a5a3 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V201904012109__ADD_RENT_FILES.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V201904012109__ADD_RENT_FILES.sql @@ -1,11 +1,19 @@ ALTER TABLE `wx_rent_contract` ADD COLUMN `file_names` JSON NULL COMMENT '合同支持多文件' AFTER `fix_end_date`; -update `wx_rent_contract` -set `file_names` = -CASE - WHEN `filename` is not null and LENGTH(`filename`) > 0 THEN - CONCAT('[{\"filename\":\"',`filename`,'\",\"filepath\":\"',`filepath`,'\"}]') - ELSE - CONCAT('[]') -END; \ No newline at end of file +update wx_rent_contract set file_names=CONCAT('[{\"filename\":\"',`filename`,'\",\"filepath\":\"',`filepath`,'\"}]') +where filename is not null or LENGTH(`filename`) >0; + +update wx_rent_contract set file_names=CONCAT('[]') where filename is null or LENGTH(`filename`)=0 ; + + +ALTER TABLE `wx_property_contract` +ADD COLUMN `file_names` JSON NULL COMMENT '合同支持多文件'; + +update wx_property_contract set file_names=CONCAT('[{\"filename\":\"',`filename`,'\",\"filepath\":\"',`filepath`,'\"}]') +where filename is not null or LENGTH(`filename`) >0; + +update wx_property_contract set file_names=CONCAT('[]') where filename is null or LENGTH(`filename`)=0 ; + + + diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java index af268d1e6..be6a0fa62 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java @@ -178,7 +178,18 @@ public class WxPropertyContract implements Serializable { @io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo") private String rentInfo; - public String getRentInfo() { + @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "fileNames") + private String fileNames; + + public String getFileNames() { + return fileNames; + } + + public void setFileNames(String fileNames) { + this.fileNames = fileNames; + } + + public String getRentInfo() { return rentInfo; } diff --git a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml index 3567fd561..2b00b336b 100644 --- a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml @@ -37,6 +37,7 @@ + @@ -46,7 +47,7 @@ `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` + `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`, `file_names` @@ -106,7 +107,7 @@ rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate, start_date startDate,end_date endDate,rc.rent_contract_id rentContractId,br.`name` brandName, s.addr,rc.apply_status applyStatus,rc.adjust_period adjustPeriod,rc.business_type businessType, - rc.adjust_ratio adjustRatio,rc.rent_info rentInfo + rc.adjust_ratio adjustRatio,rc.rent_info rentInfo, rc.file_names fileNames from wx_property_contract rc left join wx_shop s on rc.shop_id=s.id left join wx_mall_floor f on s.floor=f.id