schedule_tasks/lottery/model/plw.py

34 lines
1.3 KiB
Python

# coding: utf-8
from sqlalchemy import Column, Date, DateTime, Integer, text
from sqlalchemy.dialects.mysql import VARCHAR
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class Plw(Base):
__tablename__ = 'plw'
__table_args__ = {'comment': '排列五统计表'}
id = Column(Integer, primary_key=True)
draw_issue = Column(VARCHAR(25))
draw_date = Column(Date)
draw_code = Column(VARCHAR(10))
ten_thousand = Column(Integer, comment='')
thousand = Column(Integer, comment='')
hundred = Column(Integer, comment='')
ten = Column(Integer, comment='')
one = Column(Integer, comment='')
code_big = Column(Integer)
code_small = Column(Integer)
code_single = Column(Integer)
code_double = Column(Integer)
sum_num = Column(Integer, comment='总和')
sum_ten_one = Column(Integer, comment='十位个位和')
sum_hundred_ten = Column(Integer, comment='百位十位和')
sum_hundred_one = Column(Integer, comment='百位各位和')
sum_first_3 = Column(Integer, comment='前面3位总和')
sum_next_3 = Column(Integer, comment='后面3位总和')
created_at = Column(DateTime, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))