标签:
-- 清空数据表 truncate table dsideal_db_bak.t_pro_product; truncate table dsideal_db_bak.t_resource_product_scheme; truncate table dsideal_db_bak.t_resource_info; truncate table dsideal_db_bak.t_resource_base; truncate table dsideal_db_bak.t_sjk_paper_info; truncate table dsideal_db_bak.t_sjk_paper_base; truncate table dsideal_db_bak.t_tk_question_info; truncate table dsideal_db_bak.t_tk_question_base; truncate table dsideal_db_bak.t_tk_question_type; truncate table dsideal_db_bak.t_tk_qt_subject; truncate table dsideal_db_bak.t_base_apptype; truncate table dsideal_db_bak.t_resource_scheme; truncate table dsideal_db_bak.t_resource_structure; truncate table dsideal_db_bak.t_resource_extension; -- ======================================================================================================================================= -- t_pro_product insert into dsideal_db_bak.t_pro_product(product_id,product_id_char,product_name,product_name_other,product_name_english,keye,keyn,remark,stage_id,plat_id,type_id,subclass_id,create_time,enter_em_id,sort_id,subject_id,system_id,platform_id,version_id) select product_id,product_id_char,product_name,product_name_other,product_name_english,keye,keyn,remark,stage_id,plat_id,type_id,subclass_id,create_time,enter_em_id,sort_id,subject_id,system_id,platform_id,version_id from dsideal_db_yun.t_pro_product; -- t_resource_product_scheme insert into dsideal_db_bak.t_resource_product_scheme(id,product_id,product_id_char,scheme_id_char,scheme_id,ts,sort_id,b_use) select id,product_id,product_id_char,scheme_id_char,scheme_id,ts,sort_id,b_use from dsideal_db_yun.t_resource_product_scheme; -- dsideal_db_bak.t_resource_info; insert into dsideal_db_bak.t_resource_info(id,resource_id_int,resource_id_char,resource_title,resource_type_name,resource_format,resource_page,resource_size,resource_size_int,create_time,down_count,file_id,thumb_id,resource_type,structure_id,person_id,person_name,identity_id,group_id,preview_status,scheme_id_int,ts,thumb_status,update_ts,for_urlencoder_url,for_iso_url,width,height,parent_structure_name,release_status,res_type,bk_type,bk_type_name,material_type,m3u8_status,m3u8_url,app_type_id,stage_id,subject_id) select id,resource_id_int,resource_id_char,resource_title,resource_type_name,resource_format,resource_page,resource_size,resource_size_int,create_time,down_count,file_id,thumb_id,resource_type,structure_id,person_id,person_name,identity_id,group_id,preview_status,scheme_id_int,ts,thumb_status,update_ts,for_urlencoder_url,for_iso_url,width,height,parent_structure_name,release_status,res_type,bk_type,bk_type_name,material_type,m3u8_status,m3u8_url,app_type_id,-1,-1 from dsideal_db_yun.t_resource_info; -- dsideal_db_bak.t_resource_base; insert into dsideal_db_bak.t_resource_base(resource_id_int,resource_id_char,resource_title,resource_size,resource_size_int,resource_type,resource_type_name,resource_category,resource_page,create_time,person_name,create_person,b_use,update_logo,ts,source_id,extension,file_id,file_md5,file_sha1,thumb_id,thumb_md5,thumb_sha1,pinyin,product_id,scheme_id_char,scheme_id,structure_code,structure_id_char,structure_id,material_type,is_single,is_old,preview_status,down_count,check_status,check_message,thumb_status,old_file_path,is_multifile,chuli,is_3_2,parent_name,width,height,for_urlencoder_url,for_iso_url,release_status,res_type,bk_type,bk_type_name,m3u8_status,m3u8_url,stage_id,subject_id) select resource_id_int,resource_id_char,resource_title,resource_size,resource_size_int,resource_type,resource_type_name,resource_category,resource_page,create_time,person_name,create_person,b_use,update_logo,ts,source_id,extension,file_id,file_md5,file_sha1,thumb_id,thumb_md5,thumb_sha1,pinyin,product_id,scheme_id_char,scheme_id,structure_code,structure_id_char,structure_id,material_type,is_single,is_old,preview_status,down_count,check_status,check_message,thumb_status,old_file_path,is_multifile,chuli,is_3_2,parent_name,width,height,for_urlencoder_url,for_iso_url,release_status,res_type,bk_type,bk_type_name,m3u8_status,m3u8_url,-1,-1 from dsideal_db_yun.t_resource_base; -- dsideal_db_bak.t_sjk_paper_info; insert into dsideal_db_bak.t_sjk_paper_info(id,paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,down_count,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,group_id,resource_info_id,b_delete,oper_type) select id,paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,down_count,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,group_id,resource_info_id,b_delete,oper_type from dsideal_db_yun.t_sjk_paper_info; -- dsideal_db_bak.t_sjk_paper_base; insert into dsideal_db_bak.t_sjk_paper_base(paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,check_status,check_message,resource_info_id,down_count,old_paper_id,b_delete) select paper_id_int,paper_id_char,paper_name,scheme_id,structure_id,structure_code,question_count,paper_type,person_id,identity_id,create_time,ts,update_ts,json_content,paper_page,preview_status,file_id,for_urlencoder_url,for_iso_url,parent_structure_name,source_id,extension,check_status,check_message,resource_info_id,down_count,-1,b_delete from dsideal_db_yun.t_sjk_paper_base; -- dsideal_db_bak.t_tk_question_info; insert into dsideal_db_bak.t_tk_question_info(id,question_id_char,question_title,question_tips,question_type_id,question_difficult_id,create_person,group_id,down_count,ts,kg_zg,scheme_id_int,structure_id_int,json_question,json_answer,update_ts,structure_path,b_in_paper,paper_id_int,b_delete,oper_type,check_status,check_msg,use_count,sort_id) select id,question_id_char,question_title,question_tips,question_type_id,question_difficult_id,create_person,group_id,down_count,ts,kg_zg,scheme_id_int,structure_id_int,json_question,json_answer,update_ts,structure_path,b_in_paper,paper_id_int,b_delete,oper_type,check_status,check_msg,use_count,sort_id from dsideal_db_yun.t_tk_question_info; -- dsideal_db_bak.t_tk_question_base; insert into dsideal_db_bak.t_tk_question_base(question_id_char,question_title,question_tips,question_type_id,question_type_name,question_difficult_id,question_difficult_name,question_difficult_star,question_answer,create_time,create_person,b_use,source_id,ts,use_count,use_range,kg_zg,file_id,content_md5,doc_path,height,product_id,check_status,check_message,parent_id_char,json_question,json_answer,app_type,update_ok,options_count,subject_id,have_child,knowledgepoint) select question_id_char,question_title,question_tips,question_type_id,question_type_name,question_difficult_id,question_difficult_name,question_difficult_star,question_answer,create_time,create_person,b_use,source_id,ts,use_count,use_range,kg_zg,file_id,‘-1‘,doc_path,height,product_id,check_status,check_message,parent_id_char,json_question,json_answer,app_type,update_ok,options_count,subject_id,have_child,knowledgepoint from dsideal_db_yun.t_tk_question_base; -- dsideal_db_bak.t_tk_question_type; insert into dsideal_db_bak.t_tk_question_type(qt_id,qt_name,create_time,b_use,qt_type) select qt_id,qt_name,create_time,b_use,qt_type from dsideal_db_yun.t_tk_question_type; -- dsideal_db_bak.t_tk_qt_subject; insert into dsideal_db_bak.t_tk_qt_subject(id,stage_id,subject_id,qt_id,sort_id) select id,stage_id,subject_id,qt_id,sort_id from dsideal_db_yun.t_tk_qt_subject; -- dsideal_db_bak.t_base_apptype; insert into dsideal_db_bak.t_base_apptype(app_type_id,app_prime_id,app_type_name,scheme_id,scheme_id_char,b_use,ts) select app_type_id,app_prime_id,app_type_name,scheme_id,scheme_id_char,b_use,ts from dsideal_db_yun.t_base_apptype; -- dsideal_db_bak.t_resource_scheme; insert into dsideal_db_bak.t_resource_scheme(scheme_id,scheme_id_char,scheme_name,stage_id,subject_id,b_use,ts,client_id,type_id,old_version_id,scheme_type) select scheme_id,scheme_id_char,scheme_name,stage_id,subject_id,b_use,ts,client_id,type_id,old_version_id,scheme_type from dsideal_db_yun.t_resource_scheme; -- dsideal_db_bak.t_resource_structure; insert into dsideal_db_bak.t_resource_structure(structure_id,structure_id_char,structure_code,scheme_id_char,scheme_id_int,level,structure_name,sort_id,b_use,is_root,create_time,ts,parent_id,show_type,type_id,node_id,node_code,version_id,stage_id,subject_id,tm_id,stype_id,is_3_2,is_leaf,is_delete) select structure_id,structure_id_char,structure_code,scheme_id_char,scheme_id_int,level,structure_name,sort_id,b_use,is_root,create_time,ts,parent_id,show_type,type_id,node_id,node_code,version_id,stage_id,subject_id,tm_id,stype_id,is_3_2,is_leaf,is_delete from dsideal_db_yun.t_resource_structure; -- dsideal_db_bak.t_resource_extension; insert into dsideal_db_bak.t_resource_extension(extension_id,extension_name,mediatype_id,mediatype_name,thumb_status,preview_status,thumb_id,ts,b_use) select extension_id,extension_name,mediatype_id,mediatype_name,thumb_status,preview_status,thumb_id,ts,b_use from dsideal_db_yun.t_resource_extension; -- ======================================================================================================================================= -- 显示列名 use information_schema; select group_concat(distinct column_name) from columns where table_name=‘t_resource_extension‘ and table_schema=‘dsideal_db_bak‘;
标签:
原文地址:http://www.cnblogs.com/littlehb/p/4329538.html