Browse Source

feature(OMS):OMS销售申请后端代码开发

yanglingling 2 years ago
parent
commit
4cfcfca0ed

+ 706 - 0
opms_parent/app/dao/train/internal/train_sale_apply.go

@@ -0,0 +1,706 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model/train"
+)
+
+// TrainSaleApplyDao is the manager for logic model data accessing and custom defined data operations functions management.
+type TrainSaleApplyDao struct {
+	gmvc.M                        // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
+	C       trainSaleApplyColumns // C is the short type for Columns, which contains all the column names of Table for convenient usage.
+	DB      gdb.DB                // DB is the raw underlying database management object.
+	Table   string                // Table is the underlying table name of the DAO.
+	TableAs string                // TableAs is the underlying table alias name of the DAO.
+}
+
+// TrainSaleApplyColumns defines and stores column names for table train_sale_apply.
+type trainSaleApplyColumns struct {
+	Id                string // 主键
+	DistributorId     string // 渠道ID
+	DistributorName   string // 渠道名称
+	MainProduct       string // 主营产品
+	MainCustomer      string // 主要客户
+	Trainees          string // 参训人员
+	TrainingDate      string // 培训日期
+	SpecificStartTime string // 开始时间
+	SpecificEndTime   string // 结束时间
+	TrainTitle        string // 培训主题
+	InstructorRequire string // 讲师要求
+	FocusPoint        string // 关注要点
+	ApplyType         string // 申请状态(10 未总结 20 总结完成)
+	CreatedBy         string // 创建人
+	CreatedName       string // 创建人
+	CreatedTime       string // 创建时间
+	UpdatedBy         string // 更新人
+	UpdatedName       string // 更新人
+	UpdatedTime       string // 更新时间
+	DeletedTime       string // 删除时间
+}
+
+var (
+	// TrainSaleApply is globally public accessible object for table train_sale_apply operations.
+	TrainSaleApply = TrainSaleApplyDao{
+		M:     g.DB("default").Model("train_sale_apply").Safe(),
+		DB:    g.DB("default"),
+		Table: "train_sale_apply",
+		C: trainSaleApplyColumns{
+			Id:                "id",
+			DistributorId:     "distributor_id",
+			DistributorName:   "distributor_name",
+			MainProduct:       "main_product",
+			MainCustomer:      "main_customer",
+			Trainees:          "trainees",
+			TrainingDate:      "training_date",
+			SpecificStartTime: "specific_start_time",
+			SpecificEndTime:   "specific_end_time",
+			TrainTitle:        "train_title",
+			InstructorRequire: "instructor_require",
+			FocusPoint:        "focus_point",
+			ApplyType:         "apply_type",
+			CreatedBy:         "created_by",
+			CreatedName:       "created_name",
+			CreatedTime:       "created_time",
+			UpdatedBy:         "updated_by",
+			UpdatedName:       "updated_name",
+			UpdatedTime:       "updated_time",
+			DeletedTime:       "deleted_time",
+		},
+	}
+)
+
+func NewTrainSaleApplyDao(tenant string) TrainSaleApplyDao {
+	var dao TrainSaleApplyDao
+	dao = TrainSaleApplyDao{
+		M:     g.DB(tenant).Model("train_sale_apply").Safe(),
+		DB:    g.DB(tenant),
+		Table: "train_sale_apply",
+		C: trainSaleApplyColumns{
+			Id:                "id",
+			DistributorId:     "distributor_id",
+			DistributorName:   "distributor_name",
+			MainProduct:       "main_product",
+			MainCustomer:      "main_customer",
+			Trainees:          "trainees",
+			TrainingDate:      "training_date",
+			SpecificStartTime: "specific_start_time",
+			SpecificEndTime:   "specific_end_time",
+			TrainTitle:        "train_title",
+			InstructorRequire: "instructor_require",
+			FocusPoint:        "focus_point",
+			ApplyType:         "apply_type",
+			CreatedBy:         "created_by",
+			CreatedName:       "created_name",
+			CreatedTime:       "created_time",
+			UpdatedBy:         "updated_by",
+			UpdatedName:       "updated_name",
+			UpdatedTime:       "updated_time",
+			DeletedTime:       "deleted_time",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *TrainSaleApplyDao) Ctx(ctx context.Context) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GetCtx returns the context for current Model.
+// It returns "context.Background() i"s there's no context previously set.
+func (d *TrainSaleApplyDao) GetCtx() context.Context {
+	return d.M.GetCtx()
+}
+
+// As sets an alias name for current table.
+func (d *TrainSaleApplyDao) As(as string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.As(as), Table: d.Table, TableAs: as}
+}
+
+// TX sets the transaction for current operation.
+func (d *TrainSaleApplyDao) TX(tx *gdb.TX) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Master marks the following operation on master node.
+func (d *TrainSaleApplyDao) Master() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Master(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *TrainSaleApplyDao) Slave() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Args sets custom arguments for model operation.
+func (d *TrainSaleApplyDao) Args(args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Args(args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Handler calls each of "handlers" on current Model and returns a new Model.
+// ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
+func (d *TrainSaleApplyDao) Handler(handlers ...gdb.ModelHandler) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Handler(handlers...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *TrainSaleApplyDao) LeftJoin(table ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.LeftJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *TrainSaleApplyDao) RightJoin(table ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.RightJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *TrainSaleApplyDao) InnerJoin(table ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.InnerJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *TrainSaleApplyDao) Fields(fieldNamesOrMapStruct ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Fields(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *TrainSaleApplyDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
+func (d *TrainSaleApplyDao) FieldCount(column string, as ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.FieldCount(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
+func (d *TrainSaleApplyDao) FieldSum(column string, as ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.FieldSum(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
+func (d *TrainSaleApplyDao) FieldMin(column string, as ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.FieldMin(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
+func (d *TrainSaleApplyDao) FieldMax(column string, as ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.FieldMax(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
+func (d *TrainSaleApplyDao) FieldAvg(column string, as ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.FieldAvg(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Option adds extra operation option for the model.
+// Deprecated, use separate operations instead.
+func (d *TrainSaleApplyDao) Option(option int) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Option(option), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *TrainSaleApplyDao) OmitEmpty() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OmitEmpty(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
+// the Where/Having parameters for "empty" values.
+func (d *TrainSaleApplyDao) OmitEmptyWhere() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OmitEmptyWhere(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
+// the Data parameters for "empty" values.
+func (d *TrainSaleApplyDao) OmitEmptyData() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OmitEmptyData(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNil sets optionOmitNil option for the model, which automatically filers
+// the data and where parameters for "nil" values.
+func (d *TrainSaleApplyDao) OmitNil() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OmitNil(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
+// the Where/Having parameters for "nil" values.
+func (d *TrainSaleApplyDao) OmitNilWhere() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OmitNilWhere(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNilData sets optionOmitNilData option for the model, which automatically filers
+// the Data parameters for "nil" values.
+func (d *TrainSaleApplyDao) OmitNilData() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OmitNilData(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+// Note that this function supports only single table operations.
+// Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
+func (d *TrainSaleApplyDao) Filter() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Filter(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *TrainSaleApplyDao) Where(where interface{}, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Where(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *TrainSaleApplyDao) WherePri(where interface{}, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WherePri(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Having sets the having statement for the model.
+// The parameters of this function usage are as the same as function Where.
+// See Where.
+func (d *TrainSaleApplyDao) Having(having interface{}, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Having(having, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Wheref builds condition string using fmt.Sprintf and arguments.
+// Note that if the number of "args" is more than the place holder in "format",
+// the extra "args" will be used as the where condition arguments of the Model.
+func (d *TrainSaleApplyDao) Wheref(format string, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLT builds "column < value" statement.
+func (d *TrainSaleApplyDao) WhereLT(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLTE builds "column <= value" statement.
+func (d *TrainSaleApplyDao) WhereLTE(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGT builds "column > value" statement.
+func (d *TrainSaleApplyDao) WhereGT(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGTE builds "column >= value" statement.
+func (d *TrainSaleApplyDao) WhereGTE(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereBetween builds "column BETWEEN min AND max" statement.
+func (d *TrainSaleApplyDao) WhereBetween(column string, min, max interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLike builds "column LIKE like" statement.
+func (d *TrainSaleApplyDao) WhereLike(column string, like interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereIn builds "column IN (in)" statement.
+func (d *TrainSaleApplyDao) WhereIn(column string, in interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
+func (d *TrainSaleApplyDao) WhereNull(columns ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
+func (d *TrainSaleApplyDao) WhereNotBetween(column string, min, max interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotLike builds "column NOT LIKE like" statement.
+func (d *TrainSaleApplyDao) WhereNotLike(column string, like interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNot builds "column != value" statement.
+func (d *TrainSaleApplyDao) WhereNot(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotIn builds "column NOT IN (in)" statement.
+func (d *TrainSaleApplyDao) WhereNotIn(column string, in interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
+func (d *TrainSaleApplyDao) WhereNotNull(columns ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOr adds "OR" condition to the where statement.
+func (d *TrainSaleApplyDao) WhereOr(where interface{}, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
+func (d *TrainSaleApplyDao) WhereOrf(format string, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLT builds "column < value" statement in "OR" conditions..
+func (d *TrainSaleApplyDao) WhereOrLT(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
+func (d *TrainSaleApplyDao) WhereOrLTE(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGT builds "column > value" statement in "OR" conditions..
+func (d *TrainSaleApplyDao) WhereOrGT(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
+func (d *TrainSaleApplyDao) WhereOrGTE(column string, value interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
+func (d *TrainSaleApplyDao) WhereOrBetween(column string, min, max interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
+func (d *TrainSaleApplyDao) WhereOrLike(column string, like interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
+func (d *TrainSaleApplyDao) WhereOrIn(column string, in interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
+func (d *TrainSaleApplyDao) WhereOrNull(columns ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
+func (d *TrainSaleApplyDao) WhereOrNotBetween(column string, min, max interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
+func (d *TrainSaleApplyDao) WhereOrNotLike(column string, like interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotIn builds "column NOT IN (in)" statement.
+func (d *TrainSaleApplyDao) WhereOrNotIn(column string, in interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
+func (d *TrainSaleApplyDao) WhereOrNotNull(columns ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *TrainSaleApplyDao) Group(groupBy ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Group(groupBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// And adds "AND" condition to the where statement.
+// Deprecated, use Where instead.
+func (d *TrainSaleApplyDao) And(where interface{}, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.And(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Or adds "OR" condition to the where statement.
+// Deprecated, use WhereOr instead.
+func (d *TrainSaleApplyDao) Or(where interface{}, args ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GroupBy sets the "GROUP BY" statement for the model.
+func (d *TrainSaleApplyDao) GroupBy(groupBy string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *TrainSaleApplyDao) Order(orderBy ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
+func (d *TrainSaleApplyDao) OrderAsc(column string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
+func (d *TrainSaleApplyDao) OrderDesc(column string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
+func (d *TrainSaleApplyDao) OrderRandom() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.OrderRandom(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderBy is alias of Model.Order.
+// See Model.Order.
+// Deprecated, use Order instead.
+func (d *TrainSaleApplyDao) OrderBy(orderBy string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Order(orderBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *TrainSaleApplyDao) Limit(limit ...int) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Limit(limit...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *TrainSaleApplyDao) Offset(offset int) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Distinct forces the query to only return distinct results.
+func (d *TrainSaleApplyDao) Distinct() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Distinct(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *TrainSaleApplyDao) Page(page, limit int) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *TrainSaleApplyDao) Batch(batch int) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Batch(batch), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *TrainSaleApplyDao) Cache(duration time.Duration, name ...string) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Cache(duration, name...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *TrainSaleApplyDao) Data(data ...interface{}) *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Data(data...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.TrainSaleApply.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *TrainSaleApplyDao) All(where ...interface{}) ([]*model.TrainSaleApply, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainSaleApply
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.TrainSaleApply.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *TrainSaleApplyDao) One(where ...interface{}) (*model.TrainSaleApply, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainSaleApply
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *TrainSaleApplyDao) FindOne(where ...interface{}) (*model.TrainSaleApply, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainSaleApply
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *TrainSaleApplyDao) FindAll(where ...interface{}) ([]*model.TrainSaleApply, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainSaleApply
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *TrainSaleApplyDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *TrainSaleApplyDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *TrainSaleApplyDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *TrainSaleApplyDao) Chunk(limit int, callback func(entities []*model.TrainSaleApply, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.TrainSaleApply
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *TrainSaleApplyDao) LockUpdate() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *TrainSaleApplyDao) LockShared() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *TrainSaleApplyDao) Unscoped() *TrainSaleApplyDao {
+	return &TrainSaleApplyDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
+}

+ 685 - 0
opms_parent/app/dao/train/internal/train_sale_apply_summary.go

@@ -0,0 +1,685 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model/train"
+)
+
+// TrainSaleApplySummaryDao is the manager for logic model data accessing and custom defined data operations functions management.
+type TrainSaleApplySummaryDao struct {
+	gmvc.M                               // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
+	C       trainSaleApplySummaryColumns // C is the short type for Columns, which contains all the column names of Table for convenient usage.
+	DB      gdb.DB                       // DB is the raw underlying database management object.
+	Table   string                       // Table is the underlying table name of the DAO.
+	TableAs string                       // TableAs is the underlying table alias name of the DAO.
+}
+
+// TrainSaleApplySummaryColumns defines and stores column names for table train_sale_apply_summary.
+type trainSaleApplySummaryColumns struct {
+	Id              string // 主键
+	ApplyId         string // 申请ID
+	ExplainDuration string // 讲解时长
+	QuestionRecord  string // 提问记录
+	TrainingSummary string // 培训效果总结
+	NextStep        string // 下一步工作计划
+	CreatedBy       string // 创建人
+	CreatedName     string // 创建人
+	CreatedTime     string // 创建时间
+	UpdatedBy       string // 更新人
+	UpdatedName     string // 更新人
+	UpdatedTime     string // 更新时间
+	DeletedTime     string // 删除时间
+}
+
+var (
+	// TrainSaleApplySummary is globally public accessible object for table train_sale_apply_summary operations.
+	TrainSaleApplySummary = TrainSaleApplySummaryDao{
+		M:     g.DB("default").Model("train_sale_apply_summary").Safe(),
+		DB:    g.DB("default"),
+		Table: "train_sale_apply_summary",
+		C: trainSaleApplySummaryColumns{
+			Id:              "id",
+			ApplyId:         "apply_id",
+			ExplainDuration: "explain_duration",
+			QuestionRecord:  "question_record",
+			TrainingSummary: "training_summary",
+			NextStep:        "next_step",
+			CreatedBy:       "created_by",
+			CreatedName:     "created_name",
+			CreatedTime:     "created_time",
+			UpdatedBy:       "updated_by",
+			UpdatedName:     "updated_name",
+			UpdatedTime:     "updated_time",
+			DeletedTime:     "deleted_time",
+		},
+	}
+)
+
+func NewTrainSaleApplySummaryDao(tenant string) TrainSaleApplySummaryDao {
+	var dao TrainSaleApplySummaryDao
+	dao = TrainSaleApplySummaryDao{
+		M:     g.DB(tenant).Model("train_sale_apply_summary").Safe(),
+		DB:    g.DB(tenant),
+		Table: "train_sale_apply_summary",
+		C: trainSaleApplySummaryColumns{
+			Id:              "id",
+			ApplyId:         "apply_id",
+			ExplainDuration: "explain_duration",
+			QuestionRecord:  "question_record",
+			TrainingSummary: "training_summary",
+			NextStep:        "next_step",
+			CreatedBy:       "created_by",
+			CreatedName:     "created_name",
+			CreatedTime:     "created_time",
+			UpdatedBy:       "updated_by",
+			UpdatedName:     "updated_name",
+			UpdatedTime:     "updated_time",
+			DeletedTime:     "deleted_time",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *TrainSaleApplySummaryDao) Ctx(ctx context.Context) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GetCtx returns the context for current Model.
+// It returns "context.Background() i"s there's no context previously set.
+func (d *TrainSaleApplySummaryDao) GetCtx() context.Context {
+	return d.M.GetCtx()
+}
+
+// As sets an alias name for current table.
+func (d *TrainSaleApplySummaryDao) As(as string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.As(as), Table: d.Table, TableAs: as}
+}
+
+// TX sets the transaction for current operation.
+func (d *TrainSaleApplySummaryDao) TX(tx *gdb.TX) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Master marks the following operation on master node.
+func (d *TrainSaleApplySummaryDao) Master() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Master(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *TrainSaleApplySummaryDao) Slave() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Args sets custom arguments for model operation.
+func (d *TrainSaleApplySummaryDao) Args(args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Args(args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Handler calls each of "handlers" on current Model and returns a new Model.
+// ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
+func (d *TrainSaleApplySummaryDao) Handler(handlers ...gdb.ModelHandler) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Handler(handlers...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *TrainSaleApplySummaryDao) LeftJoin(table ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.LeftJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *TrainSaleApplySummaryDao) RightJoin(table ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.RightJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *TrainSaleApplySummaryDao) InnerJoin(table ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.InnerJoin(table...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *TrainSaleApplySummaryDao) Fields(fieldNamesOrMapStruct ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Fields(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *TrainSaleApplySummaryDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
+func (d *TrainSaleApplySummaryDao) FieldCount(column string, as ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.FieldCount(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
+func (d *TrainSaleApplySummaryDao) FieldSum(column string, as ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.FieldSum(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
+func (d *TrainSaleApplySummaryDao) FieldMin(column string, as ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.FieldMin(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
+func (d *TrainSaleApplySummaryDao) FieldMax(column string, as ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.FieldMax(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
+func (d *TrainSaleApplySummaryDao) FieldAvg(column string, as ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.FieldAvg(column, as...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Option adds extra operation option for the model.
+// Deprecated, use separate operations instead.
+func (d *TrainSaleApplySummaryDao) Option(option int) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Option(option), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *TrainSaleApplySummaryDao) OmitEmpty() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OmitEmpty(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
+// the Where/Having parameters for "empty" values.
+func (d *TrainSaleApplySummaryDao) OmitEmptyWhere() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OmitEmptyWhere(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
+// the Data parameters for "empty" values.
+func (d *TrainSaleApplySummaryDao) OmitEmptyData() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OmitEmptyData(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNil sets optionOmitNil option for the model, which automatically filers
+// the data and where parameters for "nil" values.
+func (d *TrainSaleApplySummaryDao) OmitNil() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OmitNil(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
+// the Where/Having parameters for "nil" values.
+func (d *TrainSaleApplySummaryDao) OmitNilWhere() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OmitNilWhere(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OmitNilData sets optionOmitNilData option for the model, which automatically filers
+// the Data parameters for "nil" values.
+func (d *TrainSaleApplySummaryDao) OmitNilData() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OmitNilData(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+// Note that this function supports only single table operations.
+// Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
+func (d *TrainSaleApplySummaryDao) Filter() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Filter(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *TrainSaleApplySummaryDao) Where(where interface{}, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Where(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *TrainSaleApplySummaryDao) WherePri(where interface{}, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WherePri(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Having sets the having statement for the model.
+// The parameters of this function usage are as the same as function Where.
+// See Where.
+func (d *TrainSaleApplySummaryDao) Having(having interface{}, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Having(having, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Wheref builds condition string using fmt.Sprintf and arguments.
+// Note that if the number of "args" is more than the place holder in "format",
+// the extra "args" will be used as the where condition arguments of the Model.
+func (d *TrainSaleApplySummaryDao) Wheref(format string, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLT builds "column < value" statement.
+func (d *TrainSaleApplySummaryDao) WhereLT(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLTE builds "column <= value" statement.
+func (d *TrainSaleApplySummaryDao) WhereLTE(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGT builds "column > value" statement.
+func (d *TrainSaleApplySummaryDao) WhereGT(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGTE builds "column >= value" statement.
+func (d *TrainSaleApplySummaryDao) WhereGTE(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereBetween builds "column BETWEEN min AND max" statement.
+func (d *TrainSaleApplySummaryDao) WhereBetween(column string, min, max interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLike builds "column LIKE like" statement.
+func (d *TrainSaleApplySummaryDao) WhereLike(column string, like interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereIn builds "column IN (in)" statement.
+func (d *TrainSaleApplySummaryDao) WhereIn(column string, in interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
+func (d *TrainSaleApplySummaryDao) WhereNull(columns ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
+func (d *TrainSaleApplySummaryDao) WhereNotBetween(column string, min, max interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotLike builds "column NOT LIKE like" statement.
+func (d *TrainSaleApplySummaryDao) WhereNotLike(column string, like interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNot builds "column != value" statement.
+func (d *TrainSaleApplySummaryDao) WhereNot(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotIn builds "column NOT IN (in)" statement.
+func (d *TrainSaleApplySummaryDao) WhereNotIn(column string, in interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
+func (d *TrainSaleApplySummaryDao) WhereNotNull(columns ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOr adds "OR" condition to the where statement.
+func (d *TrainSaleApplySummaryDao) WhereOr(where interface{}, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
+func (d *TrainSaleApplySummaryDao) WhereOrf(format string, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLT builds "column < value" statement in "OR" conditions..
+func (d *TrainSaleApplySummaryDao) WhereOrLT(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
+func (d *TrainSaleApplySummaryDao) WhereOrLTE(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGT builds "column > value" statement in "OR" conditions..
+func (d *TrainSaleApplySummaryDao) WhereOrGT(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
+func (d *TrainSaleApplySummaryDao) WhereOrGTE(column string, value interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
+func (d *TrainSaleApplySummaryDao) WhereOrBetween(column string, min, max interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
+func (d *TrainSaleApplySummaryDao) WhereOrLike(column string, like interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
+func (d *TrainSaleApplySummaryDao) WhereOrIn(column string, in interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
+func (d *TrainSaleApplySummaryDao) WhereOrNull(columns ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
+func (d *TrainSaleApplySummaryDao) WhereOrNotBetween(column string, min, max interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
+func (d *TrainSaleApplySummaryDao) WhereOrNotLike(column string, like interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotIn builds "column NOT IN (in)" statement.
+func (d *TrainSaleApplySummaryDao) WhereOrNotIn(column string, in interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
+func (d *TrainSaleApplySummaryDao) WhereOrNotNull(columns ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *TrainSaleApplySummaryDao) Group(groupBy ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Group(groupBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// And adds "AND" condition to the where statement.
+// Deprecated, use Where instead.
+func (d *TrainSaleApplySummaryDao) And(where interface{}, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.And(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Or adds "OR" condition to the where statement.
+// Deprecated, use WhereOr instead.
+func (d *TrainSaleApplySummaryDao) Or(where interface{}, args ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GroupBy sets the "GROUP BY" statement for the model.
+func (d *TrainSaleApplySummaryDao) GroupBy(groupBy string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *TrainSaleApplySummaryDao) Order(orderBy ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
+func (d *TrainSaleApplySummaryDao) OrderAsc(column string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
+func (d *TrainSaleApplySummaryDao) OrderDesc(column string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
+func (d *TrainSaleApplySummaryDao) OrderRandom() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.OrderRandom(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderBy is alias of Model.Order.
+// See Model.Order.
+// Deprecated, use Order instead.
+func (d *TrainSaleApplySummaryDao) OrderBy(orderBy string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Order(orderBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *TrainSaleApplySummaryDao) Limit(limit ...int) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Limit(limit...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *TrainSaleApplySummaryDao) Offset(offset int) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Distinct forces the query to only return distinct results.
+func (d *TrainSaleApplySummaryDao) Distinct() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Distinct(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *TrainSaleApplySummaryDao) Page(page, limit int) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *TrainSaleApplySummaryDao) Batch(batch int) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Batch(batch), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *TrainSaleApplySummaryDao) Cache(duration time.Duration, name ...string) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Cache(duration, name...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *TrainSaleApplySummaryDao) Data(data ...interface{}) *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Data(data...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.TrainSaleApplySummary.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *TrainSaleApplySummaryDao) All(where ...interface{}) ([]*model.TrainSaleApplySummary, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainSaleApplySummary
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.TrainSaleApplySummary.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *TrainSaleApplySummaryDao) One(where ...interface{}) (*model.TrainSaleApplySummary, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainSaleApplySummary
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *TrainSaleApplySummaryDao) FindOne(where ...interface{}) (*model.TrainSaleApplySummary, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainSaleApplySummary
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *TrainSaleApplySummaryDao) FindAll(where ...interface{}) ([]*model.TrainSaleApplySummary, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainSaleApplySummary
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *TrainSaleApplySummaryDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *TrainSaleApplySummaryDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *TrainSaleApplySummaryDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *TrainSaleApplySummaryDao) Chunk(limit int, callback func(entities []*model.TrainSaleApplySummary, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.TrainSaleApplySummary
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *TrainSaleApplySummaryDao) LockUpdate() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *TrainSaleApplySummaryDao) LockShared() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *TrainSaleApplySummaryDao) Unscoped() *TrainSaleApplySummaryDao {
+	return &TrainSaleApplySummaryDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
+}

+ 36 - 0
opms_parent/app/dao/train/train_sale_apply.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/train/internal"
+)
+
+// trainSaleApplyDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type trainSaleApplyDao struct {
+	internal.TrainSaleApplyDao
+}
+
+var (
+	// TrainSaleApply is globally public accessible object for table train_sale_apply operations.
+	TrainSaleApply = trainSaleApplyDao{
+		internal.TrainSaleApply,
+	}
+)
+
+type TrainSaleApplyDao struct {
+	internal.TrainSaleApplyDao
+}
+
+func NewTrainSaleApplyDao(tenant string) *TrainSaleApplyDao {
+	dao := internal.NewTrainSaleApplyDao(tenant)
+	return &TrainSaleApplyDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
opms_parent/app/dao/train/train_sale_apply_summary.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/train/internal"
+)
+
+// trainSaleApplySummaryDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type trainSaleApplySummaryDao struct {
+	internal.TrainSaleApplySummaryDao
+}
+
+var (
+	// TrainSaleApplySummary is globally public accessible object for table train_sale_apply_summary operations.
+	TrainSaleApplySummary = trainSaleApplySummaryDao{
+		internal.TrainSaleApplySummary,
+	}
+)
+
+type TrainSaleApplySummaryDao struct {
+	internal.TrainSaleApplySummaryDao
+}
+
+func NewTrainSaleApplySummaryDao(tenant string) *TrainSaleApplySummaryDao {
+	dao := internal.NewTrainSaleApplySummaryDao(tenant)
+	return &TrainSaleApplySummaryDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 81 - 0
opms_parent/app/handler/train/sale_apply.go

@@ -0,0 +1,81 @@
+package train
+
+import (
+	"context"
+	"dashoo.cn/common_definition/comm_def"
+	model "dashoo.cn/micro/app/model/train"
+	service "dashoo.cn/micro/app/service/train"
+	"github.com/gogf/gf/frame/g"
+)
+
+type SaleApplyHandler struct{}
+
+// GetList
+// Swagger:SaleApply 销售申请 获取报表列表
+func (c *SaleApplyHandler) GetList(ctx context.Context, req *model.TrainSaleApplySearchReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplyService(ctx)
+	if err != nil {
+		return err
+	}
+	total, ent, err := s.GetList(ctx, req)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": ent, "total": total}
+	return nil
+}
+
+// GetEntityById
+// Swagger:SaleApply 销售申请 数据详情
+func (c *SaleApplyHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplyService(ctx)
+	if err != nil {
+		return err
+	}
+	ent, err := s.GetEntityById(ctx, req.Id)
+	if err != nil {
+		return err
+	}
+	rsp.Data = ent
+	return nil
+}
+
+// Create
+// Swagger:SaleApply 销售申请 添加数据
+func (c *SaleApplyHandler) Create(ctx context.Context, req *model.TrainSaleApplyCreateReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplyService(ctx)
+	if err != nil {
+		return err
+	}
+	id, err := s.Create(ctx, req)
+	rsp.Data = g.Map{"list": id}
+	return nil
+}
+
+// UpdateById
+// Swagger:SaleApply 销售申请 更新数据
+func (c *SaleApplyHandler) UpdateById(ctx context.Context, req *model.TrainSaleApplyUpdateReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplyService(ctx)
+	if err != nil {
+		return err
+	}
+	err = s.UpdateById(ctx, req)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// DeleteByIds
+// Swagger:SaleApply 销售申请 删除数据
+func (c *SaleApplyHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplyService(ctx)
+	if err != nil {
+		return err
+	}
+	err = s.DeleteByIds(ctx, req.Ids)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 81 - 0
opms_parent/app/handler/train/sale_apply_summary.go

@@ -0,0 +1,81 @@
+package train
+
+import (
+	"context"
+	"dashoo.cn/common_definition/comm_def"
+	model "dashoo.cn/micro/app/model/train"
+	service "dashoo.cn/micro/app/service/train"
+	"github.com/gogf/gf/frame/g"
+)
+
+type SaleApplySummaryHandler struct{}
+
+// GetList
+// Swagger:SaleApplySummary 销售申请总结 获取报表列表
+func (c *SaleApplySummaryHandler) GetList(ctx context.Context, req *model.TraSaleApplySummarySearchReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplySummaryService(ctx)
+	if err != nil {
+		return err
+	}
+	total, ent, err := s.GetList(ctx, req)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": ent, "total": total}
+	return nil
+}
+
+// GetEntityById
+// Swagger:SaleApplySummary 销售申请总结 数据详情
+func (c *SaleApplySummaryHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplySummaryService(ctx)
+	if err != nil {
+		return err
+	}
+	ent, err := s.GetEntityById(ctx, req.Id)
+	if err != nil {
+		return err
+	}
+	rsp.Data = ent
+	return nil
+}
+
+// Create
+// Swagger:SaleApplySummary 销售申请总结 添加数据
+func (c *SaleApplySummaryHandler) Create(ctx context.Context, req *model.TraSaleApplySummaryCreateReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplySummaryService(ctx)
+	if err != nil {
+		return err
+	}
+	id, err := s.Create(ctx, req)
+	rsp.Data = g.Map{"list": id}
+	return nil
+}
+
+// UpdateById
+// Swagger:SaleApplySummary 销售申请总结 更新数据
+func (c *SaleApplySummaryHandler) UpdateById(ctx context.Context, req *model.TraSaleApplySummaryUpdateReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplySummaryService(ctx)
+	if err != nil {
+		return err
+	}
+	err = s.UpdateById(ctx, req)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// DeleteByIds
+// Swagger:SaleApplySummary 销售申请总结 删除数据
+func (c *SaleApplySummaryHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
+	s, err := service.NewSaleApplySummaryService(ctx)
+	if err != nil {
+		return err
+	}
+	err = s.DeleteByIds(ctx, req.Ids)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 33 - 0
opms_parent/app/model/train/internal/train_sale_apply.go

@@ -0,0 +1,33 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+    "github.com/gogf/gf/os/gtime"
+)
+
+// TrainSaleApply is the golang structure for table train_sale_apply.
+type TrainSaleApply struct {
+    Id                int         `orm:"id,primary"          json:"id"`                // 主键                               
+    DistributorId     int         `orm:"distributor_id"      json:"distributorId"`     // 渠道ID                             
+    DistributorName   string      `orm:"distributor_name"    json:"distributorName"`   // 渠道名称                           
+    MainProduct       string      `orm:"main_product"        json:"mainProduct"`       // 主营产品                           
+    MainCustomer      string      `orm:"main_customer"       json:"mainCustomer"`      // 主要客户                           
+    Trainees          string      `orm:"trainees"            json:"trainees"`          // 参训人员                           
+    TrainingDate      *gtime.Time `orm:"training_date"       json:"trainingDate"`      // 培训日期                           
+    SpecificStartTime *gtime.Time `orm:"specific_start_time" json:"specificStartTime"` // 开始时间                           
+    SpecificEndTime   *gtime.Time `orm:"specific_end_time"   json:"specificEndTime"`   // 结束时间                           
+    TrainTitle        string      `orm:"train_title"         json:"trainTitle"`        // 培训主题                           
+    InstructorRequire string      `orm:"instructor_require"  json:"instructorRequire"` // 讲师要求                           
+    FocusPoint        string      `orm:"focus_point"         json:"focusPoint"`        // 关注要点                           
+    ApplyType         string      `orm:"apply_type"          json:"applyType"`         // 申请状态(10 未总结 20 总结完成)  
+    CreatedBy         int         `orm:"created_by"          json:"createdBy"`         // 创建人                             
+    CreatedName       string      `orm:"created_name"        json:"createdName"`       // 创建人                             
+    CreatedTime       *gtime.Time `orm:"created_time"        json:"createdTime"`       // 创建时间                           
+    UpdatedBy         int         `orm:"updated_by"          json:"updatedBy"`         // 更新人                             
+    UpdatedName       string      `orm:"updated_name"        json:"updatedName"`       // 更新人                             
+    UpdatedTime       *gtime.Time `orm:"updated_time"        json:"updatedTime"`       // 更新时间                           
+    DeletedTime       *gtime.Time `orm:"deleted_time"        json:"deletedTime"`       // 删除时间                           
+}

+ 26 - 0
opms_parent/app/model/train/internal/train_sale_apply_summary.go

@@ -0,0 +1,26 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+    "github.com/gogf/gf/os/gtime"
+)
+
+// TrainSaleApplySummary is the golang structure for table train_sale_apply_summary.
+type TrainSaleApplySummary struct {
+    Id              int         `orm:"id,primary"       json:"id"`              // 主键            
+    ApplyId         int         `orm:"apply_id"         json:"applyId"`         // 申请ID          
+    ExplainDuration string      `orm:"explain_duration" json:"explainDuration"` // 讲解时长        
+    QuestionRecord  string      `orm:"question_record"  json:"questionRecord"`  // 提问记录        
+    TrainingSummary string      `orm:"training_summary" json:"trainingSummary"` // 培训效果总结    
+    NextStep        string      `orm:"next_step"        json:"nextStep"`        // 下一步工作计划  
+    CreatedBy       int         `orm:"created_by"       json:"createdBy"`       // 创建人          
+    CreatedName     string      `orm:"created_name"     json:"createdName"`     // 创建人          
+    CreatedTime     *gtime.Time `orm:"created_time"     json:"createdTime"`     // 创建时间        
+    UpdatedBy       int         `orm:"updated_by"       json:"updatedBy"`       // 更新人          
+    UpdatedName     string      `orm:"updated_name"     json:"updatedName"`     // 更新人          
+    UpdatedTime     *gtime.Time `orm:"updated_time"     json:"updatedTime"`     // 更新时间        
+    DeletedTime     *gtime.Time `orm:"deleted_time"     json:"deletedTime"`     // 删除时间        
+}

+ 68 - 0
opms_parent/app/model/train/train_sale_apply.go

@@ -0,0 +1,68 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/train/internal"
+	"dashoo.cn/opms_libary/request"
+	"github.com/gogf/gf/os/gtime"
+)
+
+// TrainSaleApply is the golang structure for table train_sale_apply.
+type TrainSaleApply internal.TrainSaleApply
+
+// Fill with you ideas below.
+
+type TrainSaleApplySearchReq struct {
+	request.PageReq
+	DistributorId int    `json:"distributorId"` // 渠道ID
+	MainProduct   string `json:"mainProduct"`   // 主营产品
+}
+
+type TrainSaleApplyRes struct {
+	Id                int         `json:"id"`                // 主键
+	DistributorId     int         `json:"distributorId"`     // 渠道ID
+	DistributorName   string      `json:"distributorName"`   // 渠道名称
+	MainProduct       string      `json:"mainProduct"`       // 主营产品
+	MainCustomer      string      `json:"mainCustomer"`      // 主要客户
+	Trainees          string      `json:"trainees"`          // 参训人员
+	TrainingDate      *gtime.Time `json:"trainingDate"`      // 培训日期
+	SpecificStartTime *gtime.Time `json:"specificStartTime"` // 开始时间
+	SpecificEndTime   *gtime.Time `json:"specificEndTime"`   // 结束时间
+	TrainTitle        string      `json:"trainTitle"`        // 培训主题
+	InstructorRequire string      `json:"instructorRequire"` // 讲师要求
+	FocusPoint        string      `json:"focusPoint"`        // 关注要点
+	ApplyType         string      `json:"applyType"`         // 申请状态(10 未总结 20 总结完成)
+}
+
+type TrainSaleApplyCreateReq struct {
+	DistributorId     int         `json:"distributorId" v:"required|min:1#|渠道不能为空"` // 渠道ID
+	DistributorName   string      `json:"distributorName" v:"required#渠道不能为空"`      // 渠道名称
+	MainProduct       string      `json:"mainProduct" v:"required#渠道名称不能为空"`        // 主营产品
+	MainCustomer      string      `json:"mainCustomer" v:"required#渠道名称不能为空"`       // 主要客户
+	Trainees          string      `json:"trainees" v:"required#渠道名称不能为空"`           // 参训人员
+	TrainingDate      *gtime.Time `json:"trainingDate" v:"required#渠道名称不能为空"`       // 培训日期
+	SpecificStartTime *gtime.Time `json:"specificStartTime" v:"required#开始时间不能为空"`  // 开始时间
+	SpecificEndTime   *gtime.Time `json:"specificEndTime" v:"required#结束时间不能为空"`    // 结束时间
+	TrainTitle        string      `json:"trainTitle" v:"required#渠道名称不能为空"`         // 培训主题
+	InstructorRequire string      `json:"instructorRequire" v:"required#渠道名称不能为空"`  // 讲师要求
+	FocusPoint        string      `json:"focusPoint" v:"required#渠道名称不能为空"`         // 关注要点
+}
+
+type TrainSaleApplyUpdateReq struct {
+	Id                int         `json:"id" v:"required|min:1#|主ID不能为空"`           // 主键
+	DistributorId     int         `json:"distributorId" v:"required|min:1#|渠道不能为空"` // 渠道ID
+	DistributorName   string      `json:"distributorName" v:"required#渠道不能为空"`      // 渠道名称
+	MainProduct       string      `json:"mainProduct" v:"required#渠道名称不能为空"`        // 主营产品
+	MainCustomer      string      `json:"mainCustomer" v:"required#渠道名称不能为空"`       // 主要客户
+	Trainees          string      `json:"trainees" v:"required#渠道名称不能为空"`           // 参训人员
+	TrainingDate      *gtime.Time `json:"trainingDate" v:"required#渠道名称不能为空"`       // 培训日期
+	SpecificStartTime *gtime.Time `json:"specificStartTime" v:"required#开始时间不能为空"`  // 开始时间
+	SpecificEndTime   *gtime.Time `json:"specificEndTime" v:"required#结束时间不能为空"`    // 结束时间
+	TrainTitle        string      `json:"trainTitle" v:"required#渠道名称不能为空"`         // 培训主题
+	InstructorRequire string      `json:"instructorRequire" v:"required#渠道名称不能为空"`  // 讲师要求
+	FocusPoint        string      `json:"focusPoint" v:"required#渠道名称不能为空"`         // 关注要点
+	ApplyType         string      `json:"applyType" v:"required#申请状态不能为空"`          // 申请状态(10 未总结 20 总结完成)
+}

+ 44 - 0
opms_parent/app/model/train/train_sale_apply_summary.go

@@ -0,0 +1,44 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/train/internal"
+)
+
+// TrainSaleApplySummary is the golang structure for table train_sale_apply_summary.
+type TrainSaleApplySummary internal.TrainSaleApplySummary
+
+// Fill with you ideas below.
+
+type TraSaleApplySummarySearchReq struct {
+	ApplyId int `json:"applyId"` // 申请ID
+}
+
+type TraSaleApplySummaryRes struct {
+	Id              int    `json:"id"`              // 主键
+	ApplyId         int    `json:"applyId"`         // 申请ID
+	ExplainDuration string `json:"explainDuration"` // 讲解时长
+	QuestionRecord  string `json:"questionRecord"`  // 提问记录
+	TrainingSummary string `json:"trainingSummary"` // 培训效果总结
+	NextStep        string `json:"nextStep"`        // 下一步工作计划
+}
+
+type TraSaleApplySummaryCreateReq struct {
+	ApplyId         int    `json:"applyId" v:"required|min:1#|申请ID不能为空"`  // 申请ID
+	ExplainDuration string `json:"explainDuration" v:"required#讲解时长为空"`   // 讲解时长
+	QuestionRecord  string `json:"questionRecord" v:"required#提问记录为空"`    // 提问记录
+	TrainingSummary string `json:"trainingSummary" v:"required#培训效果总结为空"` // 培训效果总结
+	NextStep        string `json:"nextStep" v:"required#下一步工作计划为空"`       // 下一步工作计划
+}
+
+type TraSaleApplySummaryUpdateReq struct {
+	Id              int    `json:"id" v:"required|min:1#|主ID不能为空"`        // 主键
+	ApplyId         int    `json:"applyId" v:"required|min:1#|申请ID不能为空"`  // 申请ID
+	ExplainDuration string `json:"explainDuration" v:"required#讲解时长为空"`   // 讲解时长
+	QuestionRecord  string `json:"questionRecord" v:"required#提问记录为空"`    // 提问记录
+	TrainingSummary string `json:"trainingSummary" v:"required#培训效果总结为空"` // 培训效果总结
+	NextStep        string `json:"nextStep" v:"required#下一步工作计划为空"`       // 下一步工作计划
+}

+ 108 - 0
opms_parent/app/service/train/sale_apply.go

@@ -0,0 +1,108 @@
+package train
+
+import (
+	"context"
+	dao "dashoo.cn/micro/app/dao/train"
+	model "dashoo.cn/micro/app/model/train"
+	"dashoo.cn/micro/app/service"
+	"dashoo.cn/opms_libary/myerrors"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gconv"
+)
+
+type SaleApplyService struct {
+	*service.ContextService
+	Dao *dao.TrainSaleApplyDao
+}
+
+func NewSaleApplyService(ctx context.Context) (svc *SaleApplyService, err error) {
+	svc = new(SaleApplyService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = dao.NewTrainSaleApplyDao(svc.Tenant)
+	return svc, nil
+}
+
+// GetList 销售申请信息列表
+func (s *SaleApplyService) GetList(ctx context.Context, req *model.TrainSaleApplySearchReq) (total int, distributorList []*model.TrainSaleApplyRes, err error) {
+	distributorModel := s.Dao.Ctx(ctx).FieldsEx(s.Dao.C.DeletedTime)
+	if req.DistributorId != 0 {
+		distributorModel = distributorModel.Where(s.Dao.C.DistributorId, req.DistributorId)
+	}
+	if req.MainProduct != "" {
+		distributorModel = distributorModel.WhereLike(s.Dao.C.MainProduct, "%"+req.MainProduct+"%")
+	}
+	total, _ = distributorModel.Count()
+	err = distributorModel.Page(req.GetPage()).Order("id desc").Scan(&distributorList)
+	if err != nil {
+		return 0, nil, err
+	}
+	return
+}
+
+// GetEntityById 详情
+func (s *SaleApplyService) GetEntityById(ctx context.Context, id int64) (distributorInfo *model.TrainSaleApplyRes, err error) {
+	err = s.Dao.Ctx(ctx).Where(s.Dao.C.Id, id).Scan(&distributorInfo)
+	if err != nil {
+		return nil, err
+	}
+	return
+}
+
+// Create 销售申请创建
+func (s *SaleApplyService) Create(ctx context.Context, req *model.TrainSaleApplyCreateReq) (lastId int64, err error) {
+	DistributorData := new(model.TrainSaleApply)
+	if err = gconv.Struct(req, DistributorData); err != nil {
+		return 0, err
+	}
+	service.SetCreatedInfo(DistributorData, s.GetCxtUserId(), s.GetCxtUserName())
+	txerr := s.Dao.DB.Transaction(ctx, func(ctx context.Context, tx *gdb.TX) error {
+		DistributorData.ApplyType = "10"
+		lastId, err = tx.InsertAndGetId("train_sale_apply", DistributorData)
+		if err != nil {
+			return err
+		}
+		return err
+	})
+	if txerr != nil {
+		return 0, txerr
+	}
+	return lastId, nil
+}
+
+// UpdateById 修改数据
+func (s *SaleApplyService) UpdateById(ctx context.Context, req *model.TrainSaleApplyUpdateReq) (err error) {
+	ent, err := s.Dao.Ctx(ctx).Where("id = ", req.Id).One()
+	if err != nil {
+		g.Log().Error(err)
+		return
+	}
+	if ent == nil {
+		err = myerrors.TipsError("无修改数据")
+		return
+	}
+	distData := new(model.TrainSaleApply)
+	if err = gconv.Struct(req, distData); err != nil {
+		return
+	}
+	service.SetUpdatedInfo(distData, s.GetCxtUserId(), s.GetCxtUserName())
+	_, err = s.Dao.Ctx(ctx).FieldsEx(s.Dao.C.Id, s.Dao.C.CreatedName, s.Dao.C.CreatedBy, s.Dao.C.CreatedTime).
+		WherePri(s.Dao.C.Id, req.Id).Update(distData)
+	if err != nil {
+		g.Log().Error(err)
+		return
+	}
+	return
+}
+
+// DeleteByIds 删除
+func (s *SaleApplyService) DeleteByIds(ctx context.Context, ids []int64) (err error) {
+	_, err = s.Dao.Ctx(ctx).WhereIn(s.Dao.C.Id, ids).Delete()
+	if err != nil {
+		return err
+	}
+	return
+
+}

+ 109 - 0
opms_parent/app/service/train/sale_apply_summary.go

@@ -0,0 +1,109 @@
+package train
+
+import (
+	"context"
+	dao "dashoo.cn/micro/app/dao/train"
+	model "dashoo.cn/micro/app/model/train"
+	"dashoo.cn/micro/app/service"
+	"dashoo.cn/opms_libary/myerrors"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gconv"
+)
+
+type SaleApplySummaryService struct {
+	*service.ContextService
+	Dao *dao.TrainSaleApplySummaryDao
+}
+
+func NewSaleApplySummaryService(ctx context.Context) (svc *SaleApplySummaryService, err error) {
+	svc = new(SaleApplySummaryService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = dao.NewTrainSaleApplySummaryDao(svc.Tenant)
+	return svc, nil
+}
+
+// GetList 销售申请总结信息列表
+func (s *SaleApplySummaryService) GetList(ctx context.Context, req *model.TraSaleApplySummarySearchReq) (total int, distributorList []*model.TraSaleApplySummaryRes, err error) {
+	distributorModel := s.Dao.FieldsEx(s.Dao.C.DeletedTime)
+	if req.ApplyId != 0 {
+		distributorModel = distributorModel.Where(s.Dao.C.ApplyId, req.ApplyId)
+	}
+	total, _ = distributorModel.Count()
+	err = distributorModel.Order("id desc").Scan(&distributorList)
+	if err != nil {
+		return 0, nil, err
+	}
+	return
+}
+
+// GetEntityById 详情
+func (s *SaleApplySummaryService) GetEntityById(ctx context.Context, id int64) (distributorInfo *model.TraSaleApplySummaryRes, err error) {
+	err = s.Dao.Where(s.Dao.C.Id, id).Scan(&distributorInfo)
+	if err != nil {
+		return nil, err
+	}
+	return
+}
+
+// Create 销售申请总结创建
+func (s *SaleApplySummaryService) Create(ctx context.Context, req *model.TraSaleApplySummaryCreateReq) (lastId int64, err error) {
+	DistributorData := new(model.TrainSaleApplySummary)
+	if err = gconv.Struct(req, DistributorData); err != nil {
+		return 0, err
+	}
+	service.SetCreatedInfo(DistributorData, s.GetCxtUserId(), s.GetCxtUserName())
+	svc, _ := NewSaleApplyService(ctx)
+	txerr := s.Dao.DB.Transaction(ctx, func(ctx context.Context, tx *gdb.TX) error {
+		lastId, err = tx.InsertAndGetId("train_sale_apply_summary", DistributorData)
+		if err != nil {
+			return err
+		}
+		_, err = svc.Dao.Ctx(ctx).TX(tx).WherePri(req.ApplyId).Data(g.Map{svc.Dao.C.ApplyType: "20"}).Update()
+		if err != nil {
+			return err
+		}
+		return err
+	})
+	if txerr != nil {
+		return 0, txerr
+	}
+	return lastId, nil
+}
+
+// UpdateById 修改数据
+func (s *SaleApplySummaryService) UpdateById(ctx context.Context, req *model.TraSaleApplySummaryUpdateReq) (err error) {
+	ent, err := s.Dao.Where("id = ", req.Id).One()
+	if err != nil {
+		g.Log().Error(err)
+		return
+	}
+	if ent == nil {
+		err = myerrors.TipsError("无修改数据")
+		return
+	}
+	distData := new(model.TrainSaleApplySummary)
+	if err = gconv.Struct(req, distData); err != nil {
+		return
+	}
+	service.SetUpdatedInfo(distData, s.GetCxtUserId(), s.GetCxtUserName())
+	_, err = s.Dao.FieldsEx(s.Dao.C.Id, s.Dao.C.CreatedName, s.Dao.C.CreatedBy, s.Dao.C.CreatedTime).
+		WherePri(s.Dao.C.Id, req.Id).Update(distData)
+	if err != nil {
+		g.Log().Error(err)
+		return
+	}
+	return
+}
+
+// DeleteByIds 删除
+func (s *SaleApplySummaryService) DeleteByIds(ctx context.Context, ids []int64) (err error) {
+	_, err = s.Dao.WhereIn(s.Dao.C.Id, ids).Delete()
+	if err != nil {
+		return err
+	}
+	return
+
+}

+ 3 - 0
opms_parent/main.go

@@ -13,6 +13,7 @@ import (
 	"dashoo.cn/micro/app/handler/plat"
 	projHandler "dashoo.cn/micro/app/handler/proj"
 	"dashoo.cn/micro/app/handler/sysreport"
+	"dashoo.cn/micro/app/handler/train"
 	"dashoo.cn/micro/app/handler/work"
 	"dashoo.cn/micro/app/handler/workflow"
 	"dashoo.cn/opms_libary/dynamic"
@@ -76,6 +77,8 @@ func main() {
 	s.RegisterName("ContractReport", new(contract.ContractReportHandler), "")
 	s.RegisterName("BusinessReport", new(projHandler.BusinessReportHandler), "")
 	s.RegisterName("ProductConsultRecord", new(cust.ProductConsultRecordHandler), "")
+	s.RegisterName("SaleApply", new(train.SaleApplyHandler), "")
+	s.RegisterName("SaleApplySummary", new(train.SaleApplySummaryHandler), "")
 
 	// 首页
 	s.RegisterName("Home", new(home.HomeHandler), "")