只留一组数据

dev_e
priest05 4 years ago
parent 684eb4b85f
commit 123a54f600

@ -9,7 +9,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": 15,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -46,7 +46,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 16,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -62,6 +62,10 @@
" return info_tuple\n", " return info_tuple\n",
" # 保存数据\n", " # 保存数据\n",
" def save_outsideSummary_datas(self, outsideSummary):\n", " def save_outsideSummary_datas(self, outsideSummary):\n",
" print('+++ [MyDB] delete from outsideSummary_realtime_datas') \n",
" self.cursor.execute('delete from outsideSummary_realtime_datas') \n",
" self.conn.commit()\n",
" \n",
" sql = 'insert into outsideSummary_realtime_datas(currentConfirmedCount,confirmedCount,suspectedCount,curedCount,deadCount,suspectedIncr,currentConfirmedIncr,confirmedIncr,curedIncr,deadIncr) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)'\n", " sql = 'insert into outsideSummary_realtime_datas(currentConfirmedCount,confirmedCount,suspectedCount,curedCount,deadCount,suspectedIncr,currentConfirmedIncr,confirmedIncr,curedIncr,deadIncr) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)'\n",
" res = self.get_outsideSummary_list_tuple(outsideSummary)\n", " res = self.get_outsideSummary_list_tuple(outsideSummary)\n",
" print('+++ save_outsideSummary_datas, data len: %d' % len(res))\n", " print('+++ save_outsideSummary_datas, data len: %d' % len(res))\n",
@ -85,13 +89,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 17,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"+++ [MyDB] delete from outsideSummary_realtime_datas\n",
"+++ save_outsideSummary_datas, data len: 1\n", "+++ save_outsideSummary_datas, data len: 1\n",
"+++ save_outsideSummary_datas is over.\n" "+++ save_outsideSummary_datas is over.\n"
] ]

Loading…
Cancel
Save