// ==========================================================================
// 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"
)

// TaskProcedureQualityDataTestInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
type TaskProcedureQualityDataTestInfoDao 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 TaskProcedureQualityDataTestInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
}

// TaskProcedureQualityDataTestInfoColumns defines and stores column names for table task_procedure_quality_data_test_info.
type TaskProcedureQualityDataTestInfoColumns struct {
	TpqId                   string //
	TaskBaseId              string // 任务id(对应task_base_info表id字段)
	QualityTestUrl          string // 质检链接
	QualityTestLimitDay     string // 上传质检连接天数限制
	QualityTestReduceRate   string // 上传质检连接超时扣费比率(*100)
	QualityReviseLimitDay   string // 修改质检连接天数限制
	QualityReviseReduseRate string // 修改质检连接超时扣费比率(*100)
	DataTestUrl             string // 数据检测连接
	DataTestLimitDay        string // 上传数据检测连接天数限制
	DataTestReduceRate      string // 上传数据检测连接超时扣费比率(*100)
	DataReviceLimitDay      string // 修改数据检测链接天数限制
	DataReviceReduceRate    string // 修改数据检测链接超时扣费比率(*100)
}

//  taskProcedureQualityDataTestInfoColumns holds the columns for table task_procedure_quality_data_test_info.
var taskProcedureQualityDataTestInfoColumns = TaskProcedureQualityDataTestInfoColumns{
	TpqId:                   "tpq_id",
	TaskBaseId:              "task_base_id",
	QualityTestUrl:          "quality_test_url",
	QualityTestLimitDay:     "quality_test_limit_day",
	QualityTestReduceRate:   "quality_test_reduce_rate",
	QualityReviseLimitDay:   "quality_revise_limit_day",
	QualityReviseReduseRate: "quality_revise_reduse_rate",
	DataTestUrl:             "data_test_url",
	DataTestLimitDay:        "data_test_limit_day",
	DataTestReduceRate:      "data_test_reduce_rate",
	DataReviceLimitDay:      "data_revice_limit_day",
	DataReviceReduceRate:    "data_revice_reduce_rate",
}

// NewTaskProcedureQualityDataTestInfoDao creates and returns a new DAO object for table data access.
func NewTaskProcedureQualityDataTestInfoDao() *TaskProcedureQualityDataTestInfoDao {
	return &TaskProcedureQualityDataTestInfoDao{
		Group:   "default",
		Table:   "task_procedure_quality_data_test_info",
		Columns: taskProcedureQualityDataTestInfoColumns,
	}
}

// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *TaskProcedureQualityDataTestInfoDao) 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 *TaskProcedureQualityDataTestInfoDao) 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 *TaskProcedureQualityDataTestInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
	return dao.Ctx(ctx).Transaction(ctx, f)
}
