-- auto-generated definition
create table platform_bill
(
    bill_id             int auto_increment comment 'id' primary key,
    day_id              varchar(20)                        null comment '账期',
    user_id             bigint                             null comment '关联用户id',
    shop_name           varchar(200)                       null comment '店铺名称',
    type                varchar(10)                        null comment '对账类型 1商户 2骑手 0平台',
    start_money         decimal(24, 6)                     null comment '期初金额',
    revenue             decimal(24, 6)                     null comment '总收入',
    revenue_count       int                                null comment '收入笔数',
    shop_payouts        decimal(24, 6)                     null comment '商家提现金额',
    shop_payouts_rates  decimal(24, 6)                     null comment '商家提现手续费',
    shop_payouts_count  int                                null comment '商家提现笔数',
    rider_payouts       decimal(24, 6)                     null comment '骑手提现',
    rider_payouts_rates decimal(24, 6)                     null comment '骑手提现手续费',
    rider_payouts_count int                                null comment '骑手提现笔数',
    refund_money        decimal(24, 6)                     null comment '退款金额',
    refund_count        decimal(24, 6)                     null comment '退款笔数',
    end_money           decimal(24, 6)                     null comment '期末金额',
    sys_gift_amount     decimal(24, 6)                     null comment '系统赠送金额',
    platform_rates      decimal(24, 6)                     null comment '平台抽成手续费',
    create_time         datetime default CURRENT_TIMESTAMP not null comment '创建时间',
    update_time         datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
    total_income        decimal(24, 6)                     null comment '总收益',
    pay_money           decimal(24, 6)                     null comment '用户支付金额',
    shop_balance        decimal(24, 6)                     null comment '商户余额'
)
comment '对账管理表';

