tongce.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. from excel_util import ExcelUtil
  2. from mysql_db import MysqlDB
  3. from itertools import groupby
  4. class TongCe:
  5. """
  6. 同策测试数据清洗
  7. """
  8. # 统计筒体结果
  9. sql_1 = '''
  10. SELECT
  11. a.sub_question_id,
  12. b.sub_question_content,
  13. a.score,
  14. b.sub_option_content,
  15. count(1)
  16. FROM
  17. f_t_daren_score_2 a
  18. LEFT JOIN d_shangju_tiku_02 b ON a. STATUS = b. STATUS = 1
  19. WHERE
  20. a.testcase_id in %s and
  21. a.testcase_id = b.testcase_id
  22. AND a.sub_question_id = b.sub_question_id
  23. AND (
  24. a.score = b.score
  25. OR a.score = b.sub_option_id
  26. )
  27. GROUP BY
  28. b.sub_question_content,
  29. a.score,
  30. b.sub_option_content
  31. '''
  32. # 选项信息
  33. sql_2 = '''
  34. SELECT
  35. b.id as question_id,
  36. b. NAME as question_title,
  37. a.id as sub_question_id,
  38. a. NAME as sub_question_title,
  39. d.id as option_id,
  40. d.content as option_title,
  41. c.id as sub_option_id,
  42. c.content as sub_option_title
  43. FROM
  44. bq_sub_question a
  45. LEFT JOIN bq_question b ON a.father_id = b.id
  46. LEFT JOIN bq_sub_option c ON a.id = c.sub_question_id
  47. LEFT JOIN bq_option d ON c.father_id = d.id
  48. WHERE
  49. FIND_IN_SET(
  50. a.id,
  51. (
  52. SELECT
  53. GROUP_CONCAT(question_ids)
  54. FROM
  55. bq_testcase
  56. WHERE
  57. house_ids = %s
  58. GROUP BY
  59. house_ids
  60. )
  61. )
  62. AND a. STATUS = b. STATUS = c. STATUS = 1
  63. ORDER BY
  64. a.id
  65. '''
  66. # 表
  67. sql_3 = '''
  68. INSERT INTO mvp_page_display_match (
  69. house_id,
  70. question_id,
  71. question_title,
  72. sub_question_id,
  73. sub_question_title,
  74. option_id,
  75. option_content,
  76. sub_option_id,
  77. sub_option_content,
  78. data_item_tab,
  79. data_item_title,
  80. data_item_name,
  81. STATUS,
  82. creator,
  83. created
  84. )
  85. VALUES
  86. (
  87. %s,
  88. %s,
  89. %s,
  90. %s,
  91. %s,
  92. %s,
  93. %s,
  94. %s,
  95. %s,
  96. %s,
  97. %s,
  98. %s,
  99. 1,
  100. 'binren',
  101. now()
  102. )
  103. '''
  104. sql_4 = '''
  105. SELECT
  106. id,
  107. sub_question_id,
  108. sub_option_id,
  109. data_item_name
  110. FROM
  111. mvp_page_display_match
  112. WHERE
  113. STATUS = 1
  114. '''
  115. sql_5 = '''
  116. SELECT
  117. id
  118. FROM
  119. bq_testcase
  120. WHERE
  121. STATUS = 1
  122. AND FIND_IN_SET(
  123. (
  124. SELECT
  125. id
  126. FROM
  127. bq_house
  128. WHERE
  129. STATUS = 1
  130. AND NAME = %s
  131. ),
  132. house_ids
  133. )
  134. '''
  135. sql_6 = '''
  136. insert INTO mvp_page_display_data (
  137. crowd_info_id,
  138. match_id,
  139. page_display_rule_id,
  140. name,
  141. value,
  142. STATUS,
  143. creator,
  144. created
  145. )
  146. VALUES
  147. (%s, %s, %s, %s, %s, 1, 'binren', now())
  148. '''
  149. sql_7 = '''
  150. SELECT
  151. a.testcase_id,
  152. a.uuid,
  153. GROUP_CONCAT(
  154. DISTINCT b.sub_option_content
  155. )
  156. FROM
  157. f_t_daren_score_2 a
  158. LEFT JOIN d_shangju_tiku_02 b ON a.score = b.sub_option_id
  159. WHERE
  160. a.testcase_id IN (84, 85, 86, 87)
  161. AND b.father_id IN (47, 48, 234, 254)
  162. and a.sub_question_id = b.sub_question_id and a.testcase_id = b.testcase_id
  163. GROUP BY
  164. a.testcase_id,
  165. a.uuid
  166. '''
  167. sql_8 = '''
  168. SELECT
  169. a.uuid,
  170. a.title,
  171. a.testcase_id,
  172. b.father_id,
  173. b.father_content,
  174. b.sub_option_id,
  175. b.sub_option_content
  176. FROM
  177. f_t_daren_score_2 a
  178. LEFT JOIN d_shangju_tiku_02 b ON a.score = b.sub_option_id
  179. WHERE
  180. a.testcase_id = b.testcase_id
  181. AND a.sub_question_id = b.sub_question_id
  182. AND a.testcase_id IN (84, 85, 86, 87)
  183. '''
  184. sql_9 = '''
  185. SELECT
  186. x.city
  187. ,x.uuid
  188. ,x.sex
  189. ,x.nld
  190. ,x.zhifuli
  191. ,x.juzhujiegou
  192. ,m.father_content
  193. ,m.father_id
  194. ,m.sub_question_id
  195. ,m.sub_question_content
  196. ,m.sub_option_id
  197. ,m.sub_option_content
  198. ,m.testcase_id
  199. ,m.title
  200. FROM
  201. (
  202. SELECT
  203. e.uuid,
  204. e.sex,
  205. f.nld,
  206. c.zhifuli,
  207. d.city,
  208. w.juzhujiegou
  209. FROM
  210. (
  211. SELECT
  212. a.testcase_id,
  213. a.uuid,
  214. b.sub_option_content AS sex
  215. FROM
  216. f_t_daren_score_2 a
  217. LEFT JOIN d_shangju_tiku_02 b ON (a.score = b.sub_option_id or a.score = b.score)
  218. WHERE
  219. a.testcase_id IN (84, 85, 86, 87)
  220. AND b.father_id = 47
  221. AND a.sub_question_id = b.sub_question_id
  222. AND a.testcase_id = b.testcase_id
  223. GROUP BY
  224. a.testcase_id,
  225. a.uuid
  226. ) e
  227. LEFT JOIN (
  228. SELECT
  229. a.uuid,
  230. b.sub_option_content AS nld
  231. FROM
  232. f_t_daren_score_2 a
  233. LEFT JOIN d_shangju_tiku_02 b ON (a.score = b.sub_option_id or a.score = b.score)
  234. WHERE
  235. a.testcase_id IN (84, 85, 86, 87)
  236. AND b.father_id = 48
  237. AND a.sub_question_id = b.sub_question_id
  238. AND a.testcase_id = b.testcase_id
  239. GROUP BY
  240. a.testcase_id,
  241. a.uuid
  242. ) f ON e.uuid = f.uuid
  243. LEFT JOIN (
  244. SELECT
  245. a.uuid,
  246. b.sub_option_content AS zhifuli
  247. FROM
  248. f_t_daren_score_2 a
  249. LEFT JOIN d_shangju_tiku_02 b ON (a.score = b.sub_option_id or a.score = b.score)
  250. WHERE
  251. a.testcase_id IN (84, 85, 86, 87)
  252. AND b.father_id = 234
  253. AND a.sub_question_id = b.sub_question_id
  254. AND a.testcase_id = b.testcase_id
  255. GROUP BY
  256. a.testcase_id,
  257. a.uuid
  258. ) c ON f.uuid = c.uuid
  259. LEFT JOIN (
  260. SELECT
  261. a.uuid,
  262. b.sub_option_content AS city
  263. FROM
  264. f_t_daren_score_2 a
  265. LEFT JOIN d_shangju_tiku_02 b ON (a.score = b.sub_option_id or a.score = b.score)
  266. WHERE
  267. a.testcase_id IN (84, 85, 86, 87)
  268. AND b.father_id = 254
  269. AND a.sub_question_id = b.sub_question_id
  270. AND a.testcase_id = b.testcase_id
  271. GROUP BY
  272. a.testcase_id,
  273. a.uuid
  274. ) d ON c.uuid = d.uuid
  275. left join (
  276. SELECT
  277. a.uuid,
  278. b.sub_option_content AS juzhujiegou
  279. FROM
  280. f_t_daren_score_2 a
  281. LEFT JOIN d_shangju_tiku_02 b ON (a.score = b.sub_option_id or a.score = b.score)
  282. WHERE
  283. a.testcase_id IN (84, 85, 86, 87)
  284. AND b.father_id = 211
  285. AND a.sub_question_id = b.sub_question_id
  286. AND a.testcase_id = b.testcase_id
  287. GROUP BY
  288. a.testcase_id,
  289. a.uuid
  290. ) w on d.uuid = w.uuid
  291. ) x
  292. LEFT JOIN (
  293. SELECT
  294. a.uuid,
  295. a.title,
  296. a.testcase_id,
  297. b.father_id,
  298. b.father_content,
  299. b.sub_question_id,
  300. b.sub_question_content,
  301. b.sub_option_id,
  302. b.sub_option_content
  303. FROM
  304. f_t_daren_score_2 a
  305. LEFT JOIN d_shangju_tiku_02 b ON a.sub_question_id = b.sub_question_id
  306. WHERE
  307. a.testcase_id = b.testcase_id
  308. AND (a.score = b.sub_option_id or a.score = b.score)
  309. AND a.testcase_id IN (84, 85, 86, 87) and province != '山西省'
  310. ) m ON x.uuid = m.uuid
  311. '''
  312. sql_10 = '''
  313. INSERT INTO f_t_daren_score_2 (
  314. testcase_id,
  315. title,
  316. uuid, score, created, sub_question_id
  317. )
  318. VALUE
  319. (84, '有钱人的生活就是很枯燥的……', %s, %s, %s, %s)
  320. '''
  321. sql_11 = '''
  322. select id, title_type, title_in_page, sub_question_id from mvp_page_display_rule where status = 1
  323. '''
  324. sql_12 = '''
  325. INSERT INTO mvp_page_display_rule (
  326. house_id,
  327. function_id,
  328. title_type,
  329. title_in_page,
  330. sub_question_id,
  331. STATUS,
  332. creator,
  333. created
  334. )
  335. VALUE
  336. (
  337. 67,
  338. 1,
  339. %s,
  340. %s,
  341. %s,
  342. 1,
  343. 'binren',
  344. now()
  345. )
  346. '''
  347. sql_13 = '''
  348. INSERT INTO mvp_crowd_info (
  349. house_id,
  350. pay_ability,
  351. age_area,
  352. city_name,
  353. life_cycle,
  354. STATUS,
  355. creator,
  356. created
  357. )
  358. VALUES
  359. (
  360. 67,
  361. %s,
  362. %s,
  363. %s,
  364. %s,
  365. 1,
  366. 'binren',
  367. now()
  368. )
  369. '''
  370. def __init__(self):
  371. self.shangju_db = MysqlDB('shangju')
  372. self.marketing_db = MysqlDB('bi_report')
  373. self.linshi_db = MysqlDB('linshi', db_type=1)
  374. self.options_info = ExcelUtil('工作表6', 'tongce1.xlsx').read_options_info()
  375. self.table_type_info = ExcelUtil('新增项目数据项类型排序与展示图表类型管理表', 'table_type.xlsx').get_table_type_info()
  376. def close(self):
  377. self.shangju_db.close()
  378. self.linshi_db.close()
  379. self.marketing_db.close()
  380. def get_question_info_from_db(self):
  381. result = self.shangju_db.select(self.sql_2, [67])
  382. insert_data = []
  383. for rt in result:
  384. rt = list(rt)
  385. option_configuration = self.options_info.get('67' + str(rt[6]))
  386. if option_configuration and len(option_configuration) == 4:
  387. rt.insert(0, 67)
  388. rt.extend(option_configuration[0:3])
  389. insert_data.append(rt)
  390. return insert_data
  391. def get_option_match_info(self):
  392. result = self.linshi_db.select(self.sql_4)
  393. return result
  394. # 支付力:376,年龄:29,城市:377,居住结构:395。
  395. sql_14 = '''
  396. select content from bq_sub_option where sub_question_id = %s
  397. '''
  398. def insert_into_mvp_crowd_info(self):
  399. zhifuli = self.shangju_db.select(self.sql_14, [376])
  400. age = self.shangju_db.select(self.sql_14, [29])
  401. city = self.shangju_db.select(self.sql_14, [377])
  402. juzhujiegou = self.shangju_db.select(self.sql_14, [395])
  403. insert_data = []
  404. for zfl in zhifuli:
  405. for a in age:
  406. for cy in city:
  407. for jzjg in juzhujiegou:
  408. insert_data.append([zfl, a, cy, jzjg])
  409. if len(insert_data) > 0:
  410. # self.linshi_db.truncate('mvp_crowd_info')
  411. self.linshi_db.add_some(self.sql_13, insert_data)
  412. sql_15 = '''
  413. select id, pay_ability, age_area, city_name, life_cycle from mvp_crowd_info where status = 1 and house_id = 67
  414. '''
  415. def get_crowd_info(self):
  416. data = self.linshi_db.select(self.sql_15)
  417. return data
  418. def insert_into_rule(self):
  419. option_info = self.options_info
  420. insert_data = []
  421. sub_question_ids = []
  422. for key in option_info.keys():
  423. data = option_info[key]
  424. if data[3] not in sub_question_ids:
  425. insert_data.append([data[0], data[1], data[3]])
  426. sub_question_ids.append(data[3])
  427. if len(insert_data) > 0:
  428. self.linshi_db.truncate('mvp_page_display_rule')
  429. self.linshi_db.add_some(self.sql_12, insert_data)
  430. def get_rule_data_info(self):
  431. data = self.linshi_db.select(self.sql_11)
  432. return data
  433. sql_16 = '''
  434. insert INTO mvp_page_display_data (
  435. crowd_info_id,
  436. match_id,
  437. value,
  438. STATUS,
  439. creator,
  440. created
  441. )
  442. VALUES
  443. (%s, %s, %s, 1, 'binren', now())
  444. '''
  445. def lingdi_data_scores(self):
  446. # 1: 写入mvp_crowd_info
  447. # self.insert_into_mvp_crowd_info()
  448. crowd_info = self.get_crowd_info()
  449. # 2: 写入rule
  450. # self.insert_into_rule()
  451. rule = self.get_rule_data_info()
  452. # 3: 读入答题数据
  453. self.answers = self.marketing_db.select(self.sql_9)
  454. # 4: 写入match信息
  455. match_data = self.get_question_info_from_db()
  456. self.linshi_db.truncate('mvp_page_display_match')
  457. self.linshi_db.add_some(self.sql_3, match_data)
  458. self.match_data_info = self.get_option_match_info()
  459. self.linshi_db.truncate('mvp_page_display_data')
  460. # 筛选写入data的数据
  461. count = 0
  462. no_data_case = []
  463. try:
  464. for ci in crowd_info:
  465. insert_data = []
  466. crowd_info_id = ci[0]
  467. zhifuli = ci[1]
  468. age = ci[2]
  469. city = ci[3]
  470. juzhujiegou = ci[4]
  471. data = self.filter_people(city, age, zhifuli, juzhujiegou)
  472. data.sort(key=lambda obj: obj[0])
  473. for key, questions_data in groupby(data, key=lambda obj: obj[0]):
  474. question_data_list = []
  475. for qd in questions_data:
  476. question_data_list.append([x for x in qd])
  477. rule_id = self.get_rule_id(key, rule)
  478. if rule_id is not None:
  479. question_people = len(question_data_list)
  480. if question_people > 0:
  481. question_data_list.sort(key=lambda obj: obj[3])
  482. for option_name, option_data_1 in groupby(question_data_list, key=lambda obj: obj[3]):
  483. option_data_list = []
  484. for od in option_data_1:
  485. option_data_list.append([x for x in od])
  486. if len(option_data_list) > 0:
  487. match_id = 0
  488. option_name_alias = option_name
  489. option_id = option_data_list[0][2]
  490. for md in self.match_data_info:
  491. if str(md[1]) == str(key) and str(md[2]) == str(option_id):
  492. match_id = md[0]
  493. option_name_alias = md[3]
  494. insert_data.append([crowd_info_id, match_id, rule_id, option_name_alias, len(option_data_list)])
  495. else:
  496. no_data_case.append([zhifuli, city, age, juzhujiegou, option_name])
  497. else:
  498. no_data_case.append([zhifuli, city, age, juzhujiegou, key])
  499. count += len(insert_data)
  500. self.linshi_db.add_some(self.sql_6, insert_data)
  501. # isnert_data_all = []
  502. # quanliang_scores = self.scores()
  503. # for q_s in quanliang_scores:
  504. # rule_id = self.get_rule_id(q_s[0], rule)
  505. # if rule_id:
  506. # for md in self.match_data_info:
  507. # if str(md[1]) == str(q_s[0]) and str(md[2]) == str(q_s[1]):
  508. # match_id = md[0]
  509. # option_name_alias = md[3]
  510. # isnert_data_all.append([5405, match_id, rule_id, option_name_alias, q_s[2]])
  511. # self.linshi_db.add_some(self.sql_6, isnert_data_all)
  512. # count += len(isnert_data_all)
  513. return {'写入库中的数据': count, '无数据': len(no_data_case)}
  514. except Exception as e:
  515. return str(e)
  516. sql_20 = '''
  517. UPDATE mvp_page_display_rule
  518. SET display_type = %s,
  519. display_size = %s
  520. WHERE
  521. title_in_page = %s
  522. '''
  523. def table_type_insert(self):
  524. for data in self.table_type_info:
  525. self.linshi_db.update(self.sql_20, data)
  526. def get_rule_id(self, sub_question_id, rule):
  527. for re in rule:
  528. if str(re[3]) == str(sub_question_id):
  529. return re[0]
  530. def filter_people(self, city, age, zhifuli, juzhujiegou):
  531. result = []
  532. for answer in self.answers:
  533. if answer[0] == city and answer[3] == age and answer[4] == zhifuli and answer[5] == juzhujiegou:
  534. # 子题id, 子题题目,子选项id,子选项题目
  535. if answer[8] is not None and answer[9] is not None and answer[12] is not None and answer[13]:
  536. result.append([answer[8], answer[9], answer[10], answer[11]])
  537. return result
  538. def get_testcase_ids_by_house_name(self, house_name):
  539. testcase_ids = self.shangju_db.select(self.sql_5, [house_name])
  540. return testcase_ids
  541. def scores(self):
  542. testcase_ids = self.get_testcase_ids_by_house_name('同策 领地')
  543. db_data = self.marketing_db.select(self.sql_1, [testcase_ids])
  544. answer = []
  545. for data in db_data:
  546. answer.append([data[0], data[2], data[4]])
  547. answer.sort(key=lambda obj: obj[0])
  548. sub_option_score = []
  549. for sub_question_id, others in groupby(answer, key=lambda obj: obj[0]):
  550. others_data = []
  551. for ot in others:
  552. others_data.append([x for x in ot])
  553. sub_question_count = sum([x[2] for x in others_data])
  554. for td in others_data:
  555. sub_option_id = td[1]
  556. sub_option_count = td[2]
  557. rate = int(sub_option_count) / sub_question_count
  558. sub_option_score.append([sub_question_id, sub_option_id, sub_option_count])
  559. return sub_option_score
  560. def tongce(self):
  561. """
  562. tongce测试数据清洗
  563. :return:
  564. """
  565. match_data = self.get_question_info_from_db()
  566. # self.linshi_db.truncate('mvp_page_display_match')
  567. self.linshi_db.add_some(self.sql_3, match_data)
  568. scores = self.scores()
  569. match_data_info = self.get_option_match_info()
  570. dispaly_data = []
  571. for score in scores:
  572. sub_question_id = score[0]
  573. sub_option_id = score[1]
  574. value = score[2]
  575. for mi in match_data_info:
  576. if str(mi[1]) == str(sub_question_id) and str(mi[2]) == str(sub_option_id):
  577. dispaly_data.append([mi[0], value])
  578. if len(dispaly_data) > 0:
  579. self.linshi_db.truncate('mvp_page_display_data')
  580. self.linshi_db.add_some(self.sql_6, dispaly_data)
  581. return {'插入数据条数': len(dispaly_data), 'scores': dispaly_data}
  582. def wenjuanxin_84(self):
  583. excel = ExcelUtil('Sheet1', '84_1500.xlsx')
  584. insert_data = excel.wenjuanxin_84()
  585. self.linshi_db.add_some(self.sql_10, insert_data)
  586. print()
  587. sql_17 = '''
  588. SELECT
  589. id,
  590. uuid,
  591. created,
  592. `status`,
  593. sub_question_id,
  594. testcase_id,
  595. title,
  596. score,
  597. province,
  598. city,
  599. district
  600. FROM
  601. f_t_daren_score_2
  602. WHERE
  603. testcase_id IN (84, 85, 86, 87)
  604. AND sub_question_id = 377
  605. AND score = 2917
  606. AND (
  607. city IN (
  608. '昆明市',
  609. '西安市',
  610. '咸阳市',
  611. '郑州市',
  612. '洛阳市',
  613. '武汉市',
  614. '襄阳市',
  615. '重庆市',
  616. '璧山'
  617. )
  618. OR province IN (
  619. '昆明市',
  620. '西安市',
  621. '咸阳市',
  622. '郑州市',
  623. '洛阳市',
  624. '武汉市',
  625. '襄阳市',
  626. '重庆市',
  627. '璧山'
  628. )
  629. OR district IN (
  630. '昆明市',
  631. '西安市',
  632. '咸阳市',
  633. '郑州市',
  634. '洛阳市',
  635. '武汉市',
  636. '襄阳市',
  637. '重庆市',
  638. '璧山区'
  639. )
  640. )
  641. '''
  642. sql_18 = '''
  643. update f_t_daren_score_2 set score = %s where id = %s
  644. '''
  645. city_info = {
  646. '昆明市': 2918,
  647. '西安市': 2919,
  648. '咸阳市': 2920,
  649. '郑州市': 2921,
  650. '洛阳市': 2922,
  651. '武汉市': 2923,
  652. '襄阳市': 2924,
  653. '重庆市': 2925,
  654. '璧山市': 2926
  655. }
  656. def other_city_clean(self):
  657. update_data = []
  658. need_update_data = self.marketing_db.select(self.sql_17)
  659. for nd in need_update_data:
  660. id = nd[0]
  661. province = nd[8]
  662. city = nd[9]
  663. district = nd[10]
  664. bishan = self.city_info.get(district)
  665. if bishan:
  666. update_data.append([bishan, id])
  667. else:
  668. city_id = self.city_info.get(city)
  669. if city_id:
  670. update_data.append([city_id, id])
  671. else:
  672. province_id = self.city_info.get(province)
  673. if province_id:
  674. update_data.append([province_id, id])
  675. self.marketing_db.add_some(self.sql_18, update_data)
  676. return len(update_data)
  677. sql_19 = '''
  678. select GROUP_CONCAT(id)from f_t_daren_score_2 where testcase_id in (84, 85, 86, 87) and score = 2925 and district = '璧山区'
  679. update f_t_daren_score_2 set score = 2926 where id in (979728,979890,981251,984783,985250,985564,990999)
  680. '''
  681. def chongqin_to_bishan(self):
  682. pass
  683. if __name__ == '__main__':
  684. tongce = TongCe()
  685. match_data = tongce.get_question_info_from_db()
  686. tongce.linshi_db.truncate('mvp_page_display_match')
  687. tongce.linshi_db.add_some(tongce.sql_3, match_data)