Commit d6d8dfdb by 蘑菇🍄

add jnby pomme sql

parent 9a389372
This source diff could not be displayed because it is too large. You can view the blob instead.
drop function if exists clearTempImportData;
drop function if exists clearTempImportData;
-- 创建一个无参的函数
create function clearTempImportData () returns int
-- 设置函数的返回类型
begin-- 函数头
delete from tab_gic_mall_order_copy ;
delete from tab_gic_mall_order_item_copy ;
delete from tab_gic_mall_order_logistics_copy ;
delete from tab_gic_mall_order_process_copy ;
delete from tab_gic_mall_order_refund_consult_copy ;
delete from tab_gic_mall_order_refund_copy ;
delete from tab_gic_mall_order_refund_logistics_copy ;
delete from tab_gic_mall_collection_copy ;
delete from tab_gic_mall_evaluate_copy ;
delete from tab_gic_mall_order_batch_deliver_log_copy ;
-- delete from `3.0`.tab_gic_member_address_copy;
delete from tab_gic_mall_shopping_cart_copy;
RETURN 0;
end;
drop function if exists copyImportDataToProTable;
-- 创建一个无参的函数
create function copyImportDataToProTable () returns int
-- 设置函数的返回类型
begin-- 函数头
insert into tab_gic_mall_order select * from tab_gic_mall_order_copy;
insert into tab_gic_mall_order_item select * from tab_gic_mall_order_item_copy;
insert into tab_gic_mall_order_logistics select * from tab_gic_mall_order_logistics_copy;
insert into tab_gic_mall_order_process select * from tab_gic_mall_order_process_copy;
insert into tab_gic_mall_order_refund_consult select * from tab_gic_mall_order_refund_consult_copy;
insert into tab_gic_mall_order_refund select * from tab_gic_mall_order_refund_copy;
insert into tab_gic_mall_order_refund_logistics select * from tab_gic_mall_order_refund_logistics_copy;
insert into tab_gic_mall_collection select * from tab_gic_mall_collection_copy;
insert into tab_gic_mall_evaluate select * from tab_gic_mall_evaluate_copy;
insert into tab_gic_mall_order_batch_deliver_log select * from tab_gic_mall_order_batch_deliver_log_copy;
insert into tab_gic_mall_shopping_cart select * from tab_gic_mall_shopping_cart_copy;
insert into `gic3.0`.tab_gic_member_address select * from `gic3.0`.tab_gic_member_address_copy;
RETURN 0;
end;
\ No newline at end of file
-- 数据合并
-- 数据合并
insert into tab_gic_mall_order select * from tab_gic_mall_order_copy;
insert into tab_gic_mall_order_item select * from tab_gic_mall_order_item_copy;
insert into tab_gic_mall_order_logistics select * from tab_gic_mall_order_logistics_copy;
insert into tab_gic_mall_order_process select * from tab_gic_mall_order_process_copy;
insert into tab_gic_mall_order_refund_consult select * from tab_gic_mall_order_refund_consult_copy;
insert into tab_gic_mall_order_refund select * from tab_gic_mall_order_refund_copy;
insert into tab_gic_mall_order_refund_logistics select * from tab_gic_mall_order_refund_logistics_copy;
insert into tab_gic_mall_collection select * from tab_gic_mall_collection_copy;
insert into tab_gic_mall_evaluate select * from tab_gic_mall_evaluate_copy;
insert into tab_gic_mall_order_batch_deliver_log select * from tab_gic_mall_order_batch_deliver_log_copy;
insert into tab_gic_mall_shopping_cart select * from tab_gic_mall_shopping_cart_copy;
-- 清除导入的临时数据
delete from tab_gic_mall_order_copy ;
delete from tab_gic_mall_order_item_copy ;
delete from tab_gic_mall_order_logistics_copy ;
delete from tab_gic_mall_order_process_copy ;
delete from tab_gic_mall_order_refund_consult_copy ;
delete from tab_gic_mall_order_refund_copy ;
delete from tab_gic_mall_order_refund_logistics_copy ;
delete from tab_gic_mall_collection_copy ;
delete from tab_gic_mall_evaluate_copy ;
delete from tab_gic_mall_order_batch_deliver_log_copy ;
delete from tab_gic_member_address_copy
delete from tab_gic_mall_shopping_cart_copy
-- 清除全部导入的数据
DELETE FROM tab_gic_mall_order WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order_item WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order_logistics WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order_process WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order_refund_consult WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order_refund WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order_refund_logistics WHERE from_erp = 1;
DELETE FROM tab_gic_mall_collection WHERE from_erp = 1;
DELETE FROM tab_gic_mall_evaluate WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order_batch_deliver_log WHERE from_erp = 1;
DELETE FROM tab_gic_mall_order WHERE member_id ='ff808081671d4dd501673a76508d32ce' AND enterprise_id= 'ff8080816170e8990161f6736b4c6033' and from_erp=1;
DELETE FROM tab_gic_mall_order_item WHERE member_id ='ff808081671d4dd501673a76508d32ce' AND enterprise_id= 'ff8080816170e8990161f6736b4c6033' and from_erp=1;
\ No newline at end of file
alter table tab_gic_mall_order add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_order add erp_order_id varchar(32) default null COMMENT 'erp_order_id';
alter table tab_gic_mall_order_item add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_order_logistics add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_order_process add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_order_refund_consult add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_order_refund add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_order_refund_logistics add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_collection add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_evaluate add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_shopping_cart add from_erp int(1) default 0 COMMENT '是否导入';
alter table tab_gic_mall_order_batch_deliver_log add from_erp int(1) default 0 COMMENT '是否导入';
CREATE TABLE tab_gic_mall_order_copy LIKE tab_gic_mall_order;
CREATE TABLE tab_gic_mall_order_item _copy LIKE tab_gic_mall_order_item;
CREATE TABLE tab_gic_mall_order_logistics _copy LIKE tab_gic_mall_order_logistics;
CREATE TABLE tab_gic_mall_order_process_copy LIKE tab_gic_mall_order_process;
CREATE TABLE tab_gic_mall_order_refund_consult_copy LIKE tab_gic_mall_order_refund_consult;
CREATE TABLE tab_gic_mall_order_refund_copy LIKE tab_gic_mall_order_refund;
CREATE TABLE tab_gic_mall_order_refund_logistics_copy LIKE tab_gic_mall_order_refund_logistics;
CREATE TABLE tab_gic_mall_collection_copy LIKE tab_gic_mall_collection;
CREATE TABLE tab_gic_mall_evaluate_copy LIKE tab_gic_mall_evaluate;
CREATE TABLE tab_gic_member_address_copy LIKE `gic3.0`.tab_gic_member_address
CREATE TABLE tab_gic_mall_shopping_cart_copy LIKE tab_gic_mall_shopping_cart;
CREATE TABLE tab_gic_mall_order_batch_deliver_log_copy LIKE tab_gic_mall_order_batch_deliver_log
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment