// ==========================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================

package internal

import (
	"context"
	"github.com/gogf/gf/database/gdb"
	"github.com/gogf/gf/frame/g"
)

// OrderDeliveryInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
type OrderDeliveryInfoDao struct {
	Table   string          // Table is the underlying table name of the DAO.
	Group   string          // Group is the database configuration group name of current DAO.
	Columns OrderDeliveryInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
}

// OrderDeliveryInfoColumns defines and stores column names for table order_delivery_info.
type OrderDeliveryInfoColumns struct {
	OrderDeliveryId   string // 执行补充信息                             
    OrderId           string // 订单id                                   
    OrderAddressee    string // 收货人                                   
    OrderPhone        string // 订单所填手机号                           
    RegionCode        string // 区域码                                   
    OrderAddress      string // 订单地址                                 
    LogisticsCompany  string // 物流公司                                 
    TrackingNum       string // 物流单号                                 
    CreatedAt         string // 创建时间                                 
    ConfirmTime       string // 确认收获时间                             
    DeliveryTime      string // 发货时间                                 
    DeliveryStatus    string // 发货状态   1是未发货，2是已发货 3已收货
}

//  orderDeliveryInfoColumns holds the columns for table order_delivery_info.
var orderDeliveryInfoColumns = OrderDeliveryInfoColumns{
	OrderDeliveryId:  "order_delivery_id",  
            OrderId:          "order_id",           
            OrderAddressee:   "order_addressee",    
            OrderPhone:       "order_phone",        
            RegionCode:       "region_code",        
            OrderAddress:     "order_address",      
            LogisticsCompany: "logistics_company",  
            TrackingNum:      "tracking_num",       
            CreatedAt:        "created_at",         
            ConfirmTime:      "confirm_time",       
            DeliveryTime:     "delivery_time",      
            DeliveryStatus:   "delivery_status",
}

// NewOrderDeliveryInfoDao creates and returns a new DAO object for table data access.
func NewOrderDeliveryInfoDao() *OrderDeliveryInfoDao {
	return &OrderDeliveryInfoDao{
		Group:   "default",
		Table:   "order_delivery_info",
		Columns: orderDeliveryInfoColumns,
	}
}

// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *OrderDeliveryInfoDao) DB() gdb.DB {
	return g.DB(dao.Group)
}

// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *OrderDeliveryInfoDao) Ctx(ctx context.Context) *gdb.Model {
	return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
}

// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *OrderDeliveryInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
	return dao.Ctx(ctx).Transaction(ctx, f)
}