Commit ddbf9769 by 潘诗林

v5.8.0 dml语句

1 parent af30f053
...@@ -609,4 +609,109 @@ WHERE mpgi.deleted_flag = 'N' ...@@ -609,4 +609,109 @@ WHERE mpgi.deleted_flag = 'N'
AND mpgi.scene_type = 0 AND mpgi.scene_type = 0
AND mgi.deleted_flag = 'N' AND mgi.deleted_flag = 'N'
AND cc.category_name = '权益服务'; AND cc.category_name = '权益服务';
-- 权益
INSERT INTO dj_car_life_merchant_goods_inventory_type_ref (
merchant_goods_id,
package_code,
inventory_type,
merchant_id,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag
)
SELECT
newB.ID,
newB.package_code,
oldA.inventory_type,
oldA.merchant_id,
'system',
NOW(),
'system',
NOW(),
'N'
FROM dj_car_life_merchant_goods_info AS oldB
JOIN dj_car_life_merchant_goods_inventory_type_ref AS oldA ON oldB.id = oldA.merchant_goods_id
JOIN dj_car_life_merchant_goods_info AS newB ON newB.merchant_goods_code = CONCAT(oldB.merchant_goods_code, 'B');
-- 延保
INSERT INTO dj_car_life_merchant_goods_inventory_type_ref (
merchant_goods_id,
package_code,
inventory_type,
merchant_id,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag
)
SELECT
newB.ID,
newB.package_code,
oldA.inventory_type,
oldA.merchant_id,
'system',
NOW(),
'system',
NOW(),
'N'
FROM dj_car_life_merchant_goods_info AS oldB
JOIN dj_car_life_merchant_goods_inventory_type_ref AS oldA ON oldB.id = oldA.merchant_goods_id
JOIN dj_car_life_merchant_goods_info AS newB ON newB.merchant_goods_code = CONCAT(oldB.merchant_goods_code, 'D');
-- 权益
INSERT INTO dj_car_life_merchant_goods_ref (
merchant_goods_id,
package_code,
merchant_id,
merchant_name,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag
)
SELECT
newB.ID,
newB.package_code,
oldA.merchant_id,
oldA.merchant_name,
'system',
NOW(),
'system',
NOW(),
'N'
FROM dj_car_life_merchant_goods_info AS oldB
JOIN dj_car_life_merchant_goods_ref AS oldA ON oldB.id = oldA.merchant_goods_id
JOIN dj_car_life_merchant_goods_info AS newB ON newB.merchant_goods_code = CONCAT(oldB.merchant_goods_code, 'B');
-- 延保
INSERT INTO dj_car_life_merchant_goods_ref (
merchant_goods_id,
package_code,
merchant_id,
merchant_name,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag
)
SELECT
newB.ID,
newB.package_code,
oldA.merchant_id,
oldA.merchant_name,
'system',
NOW(),
'system',
NOW(),
'N'
FROM dj_car_life_merchant_goods_info AS oldB
JOIN dj_car_life_merchant_goods_ref AS oldA ON oldB.id = oldA.merchant_goods_id
JOIN dj_car_life_merchant_goods_info AS newB ON newB.merchant_goods_code = CONCAT(oldB.merchant_goods_code, 'D');
### 潘诗林 -----------------end--------------------- ### 潘诗林 -----------------end---------------------
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!