xiatian 1 年之前
父节点
当前提交
c5b694fd68
共有 2 个文件被更改,包括 48 次插入0 次删除
  1. 二进制
      file/subject_info.xlsx
  2. 48 0
      file/临时.txt

二进制
file/subject_info.xlsx


+ 48 - 0
file/临时.txt

@@ -0,0 +1,48 @@
+http://localhost:8008/api/ecs_ques/copy/data?$key=U_C_0_1&$token=9fbbb4fe56d04aafade1b2ed510c754e
+
+
+select k.* from wq_knowledge_system k where k.root_id in(select DISTINCT ss.root_id
+from wq_question_bank_subject t
+left join wq_question_bank b on t.question_bank_id=b.id
+left join wq_question_question_bank f on t.question_bank_id=f.question_bank_id
+left join wq_question q on f.question_id=q.id
+left join wq_question_knowledge_system s on f.question_id=s.question_id
+left join wq_knowledge_system ss on s.knowledge_system_id=ss.id
+where t.subject_id=622 and b.rent_id=811 and b.is_deleted=0
+and q.is_deleted=0 and q.rent_id=811)
+
+
+select DISTINCT f.id,f.subject_name,f.subject_code
+from temp_subject tem
+INNER JOIN wq_subject f on tem.subject_code=f.subject_code
+INNER JOIN wq_question_bank_subject t on f.id=t.subject_id
+where f.is_deleted=0 and f.rent_id=811
+order by f.id
+
+update wq_question INNER JOIN temp_old_data on wq_question.id=temp_old_data.id
+set wq_question.topic= temp_old_data.content;
+
+update wq_question_answer_item INNER JOIN temp_old_data on wq_question_answer_item.id=temp_old_data.id
+set wq_question_answer_item.answer_text= temp_old_data.content;
+
+#必要步骤
+update wq_question INNER JOIN temp_gs on wq_question.id=temp_gs.id
+set wq_question.topic= CONCAT_WS('',temp_gs.content1,temp_gs.content2,temp_gs.content3,temp_gs.content4);
+
+update wq_question INNER JOIN temp_gs on wq_question.id=temp_gs.id
+set wq_question.answer= CONCAT_WS('',temp_gs.content1,temp_gs.content2,temp_gs.content3,temp_gs.content4);
+
+update wq_question_answer_item INNER JOIN temp_gs on wq_question_answer_item.id=temp_gs.id
+set wq_question_answer_item.answer_text= CONCAT_WS('',temp_gs.content1,temp_gs.content2,temp_gs.content3,temp_gs.content4);
+
+#查询wq_question表中question_id!=-1的数据,将有效的question补入wq_question_question_bank。将套题作为单独的题处理
+#insert into wq_question_question_bank (question_bank_id,question_id)
+#select question_bank_id,question_id from temp_childer;
+
+insert into wq_question_question_bank (question_bank_id,question_id)
+select f.question_bank_id,t.id 
+from wq_question t left join wq_question_question_bank f on t.question_id=f.question_id
+where t.question_id!=-1 and t.rent_id=811 
+and f.question_bank_id is not null;
+
+