diff --git a/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql b/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql index 4bbfc8eb1..aeca024a2 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql @@ -6,13 +6,140 @@ ADD COLUMN `other_rent_price_info` json COMMENT '其他租金单价' AFTER `rent --单店铺 -update wx_rent_contract set cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') -where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) <= 1 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') , + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "")) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) <= 1 and cashtype_lsit is null; + + +--多店铺合铺 +--2 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') , + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 2 and rent_input_way = 1 and cashtype_lsit is null; + +--3 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') , + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[2].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[2].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[2].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 3 and rent_input_way = 1 and cashtype_lsit is null; + + +--多店铺分铺 +--2 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": false}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = '[{"value": "", "deposit": ""}]', + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[0].deposit"))), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[1].deposit"))), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 2 and rent_input_way = 2 and cashtype_lsit is null; + +--3 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": false}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = '[{"value": "", "deposit": ""}]', + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[0].deposit"))), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[1].deposit"))), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[2].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[2].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[2].deposit"))), + "$[2].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 3 and rent_input_way = 2 and cashtype_lsit is null; + + + + + + + + + + + + + + ---多店铺合铺 ---多店铺分铺 \ No newline at end of file +--10 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": false}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = '[{"value": "", "deposit": ""}]', + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[0].deposit"))), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[1].deposit"))), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[2].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[2].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[2].deposit"))), + "$[2].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[3].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[3].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[3].deposit"))), + "$[3].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[4].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[4].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[4].deposit"))), + "$[4].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[5].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[5].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[5].deposit"))), + "$[5].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[6].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[6].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[6].deposit"))), + "$[6].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[7].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[7].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[7].deposit"))), + "$[7].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[8].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[8].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[8].deposit"))), + "$[8].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[9].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", true),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[9].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "0", "deposit", json_extract(rent_info,"$[9].deposit"))), + "$[9].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 10 and rent_input_way = 2 and cashtype_lsit is null;