Kaynağa Gözat

tongce: 清洗数据sql调整

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 yıl önce
ebeveyn
işleme
07912265ca
1 değiştirilmiş dosya ile 6 ekleme ve 8 silme
  1. 6 8
      tongce.py

+ 6 - 8
tongce.py

@@ -203,8 +203,6 @@ class TongCe:
 			,m.father_id
 			,m.sub_question_id
 			,m.sub_question_content
-			,m.option_tags as option_id
-			,m.father_content as option_content
 			,m.sub_option_id
 			,m.sub_option_content
 			,m.testcase_id
@@ -226,11 +224,11 @@ class TongCe:
 								 b.sub_option_content  AS sex
                             FROM
                                 f_t_daren_score_2 a
-                            LEFT JOIN d_shangju_tiku_02 b ON a.sub_question_id = b.sub_question_id
+                            LEFT JOIN d_shangju_tiku_02 b ON a.score = b.sub_option_id
                             WHERE
                                 a.testcase_id IN (84, 85, 86, 87)
                             AND b.father_id = 47
-                            AND (a.score = b.sub_option_id or a.score = b.score)
+                            AND a.sub_question_id = b.sub_question_id
                             AND a.testcase_id = b.testcase_id
                             GROUP BY
                                 a.testcase_id,
@@ -311,15 +309,15 @@ class TongCe:
                     b.sub_question_id,
                     b.sub_question_content,
                     b.sub_option_id,
-                    b.sub_option_content,
-										b.option_tags
+                    b.sub_option_content
                 FROM
                     f_t_daren_score_2 a
-                LEFT JOIN d_shangju_tiku_02 b ON a.score = b.sub_option_id
+                LEFT JOIN d_shangju_tiku_02 b ON a.sub_question_id = b.sub_question_id
                 WHERE
                     a.testcase_id = b.testcase_id
-                AND a.sub_question_id = b.sub_question_id
+                AND  (a.score = b.sub_option_id or a.score = b.score)
                 AND a.testcase_id IN (84, 85, 86, 87)
+								AND a.sub_question_id = 417
             ) m ON x.uuid = m.uuid
     '''