Browse Source

mvp: 减少统计范围

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 years ago
parent
commit
86ef9dfef0
1 changed files with 5 additions and 3 deletions
  1. 5 3
      mvp.py

+ 5 - 3
mvp.py

@@ -94,7 +94,7 @@ class Mvp:
     sql_4 = 'select nld from f_t_daren_score_2 group by nld'
 
     # 根据城市,年龄段,人群分类统计答题记录数
-    sql_5 = 'select testcase_id, COUNT(uuid) from f_t_daren_score_2 where uuid in %s group by testcase_id '
+    sql_5 = 'select testcase_id, COUNT(uuid) from f_t_daren_score_2 where uuid in %s and testcase_id > 74 group by testcase_id '
 
     # 根据父选项获取子选项id列表
     sql_6 = '''
@@ -121,7 +121,7 @@ class Mvp:
     '''
 
     # 根据子题id获取包含子题id的测试
-    sql_7 = 'select id from bq_testcase where status = 1 and FIND_IN_SET(%s, question_ids)'
+    sql_7 = 'select id from bq_testcase where status = 1 and id > 74 and FIND_IN_SET(%s, question_ids)'
 
     # 根据子选项id统计答题数
     sql_8 = '''
@@ -137,7 +137,7 @@ class Mvp:
         AND a.testcase_id = b.testcase_id
         WHERE
             b.sub_option_id IN % s
-        AND a.uuid IN % s
+        AND a.uuid IN % s and a.testcase_id > 74
     '''
 
     # 获取一个uuid下答题的子选项id列表
@@ -179,6 +179,7 @@ class Mvp:
             a.score = b.score
             OR a.score = b.sub_option_id
         )
+        and a.testcase_id > 74
         GROUP BY
             a.uuid
     '''
@@ -347,6 +348,7 @@ class Mvp:
             sub_option_ids_1 = people[4]
             testcaseid = people[5]
 
+
             if str(city).find('市') != -1:
                 city = str(city).split('市')[0] + '市'