Explorar o código

feature:oms经销商培训

Sun Xinyuan %!s(int64=2) %!d(string=hai) anos
pai
achega
efe547e69a

+ 7 - 7
opms_admin/config/config.toml

@@ -1,11 +1,11 @@
 # 应用系统设置
 [setting]
     logpath = "./log/admin"
-    bind-addr = "127.0.0.1:8888"
+    bind-addr = "192.168.0.106:8888"
     need-advertise-addr = false
-    srv-name = "dashoo.opms.admin-0.0.1"
+    srv-name = "dashoo.opms.admin-0.0.1-sxy"
     env = "dev"
-    websocket-addr = "127.0.0.1:8899"
+    websocket-addr = "192.168.0.106:8899"
 
 [logger.websocket]
     path   = "./log/websocket"
@@ -17,8 +17,8 @@
 
 # 微服务注册中心配置
 [service_registry]
-    registry = "peer2peer" # consul 或 peer2peer
-    server-addr = "127.0.0.1:8500"
+    registry = "consul" # consul 或 peer2peer
+    server-addr = "192.168.0.218:18500"
 
 # 数据库连接
 [database]
@@ -33,7 +33,7 @@
         createdAt = "created_time"
         updatedAt = "updated_time"
         deletedAt = "deleted_time"
-        link = "mysql:root:Bgt5^yhn@tcp(sh-cynosdbmysql-grp-caipe5bm.sql.tencentcdb.com:20185)/opms"
+        link = "mysql:root:Bgt56yhn@@@tcp(192.168.0.218:3306)/opms?loc=Local&parseTime=true"
 
 # token认证设置
 [gtoken]
@@ -60,4 +60,4 @@
     host="hwsmtp.exmail.qq.com"
     port="465"
     user="likai@dashoo.cn"
-    password="LLLkkk0210"
+    password="LLLkkk0210"

+ 682 - 0
opms_parent/app/dao/proj/internal/train_head_office.go

@@ -0,0 +1,682 @@
+// ==========================================================================
+// 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"
+
+	model "dashoo.cn/micro/app/model/proj"
+)
+
+// TrainHeadOfficeDao is the manager for logic model data accessing and custom defined data operations functions management.
+type TrainHeadOfficeDao struct {
+	gmvc.M                         // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
+	C       trainHeadOfficeColumns // 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.
+}
+
+// TrainHeadOfficeColumns defines and stores column names for table train_head_office.
+type trainHeadOfficeColumns struct {
+	Id                     string // 主键
+	TrainTitle             string // 培训主题
+	TrainDate              string // 培训日期
+	TrainConcreteStartTime string // 培训开始时间
+	TrainConcreteEndTime   string // 培训结束时间
+	CreatedBy              string // 创建人
+	CreatedName            string // 创建人
+	CreatedTime            string // 创建时间
+	UpdatedBy              string // 更新人
+	UpdatedName            string // 更新人
+	UpdatedTime            string // 更新时间
+	DeletedTime            string // 删除时间
+}
+
+var (
+	// TrainHeadOffice is globally public accessible object for table train_head_office operations.
+	TrainHeadOffice = TrainHeadOfficeDao{
+		M:     g.DB("default").Model("train_head_office").Safe(),
+		DB:    g.DB("default"),
+		Table: "train_head_office",
+		C: trainHeadOfficeColumns{
+			Id:                     "id",
+			TrainTitle:             "train_title",
+			TrainDate:              "train_date",
+			TrainConcreteStartTime: "train_concrete_start_time",
+			TrainConcreteEndTime:   "train_concrete_end_time",
+			CreatedBy:              "created_by",
+			CreatedName:            "created_name",
+			CreatedTime:            "created_time",
+			UpdatedBy:              "updated_by",
+			UpdatedName:            "updated_name",
+			UpdatedTime:            "updated_time",
+			DeletedTime:            "deleted_time",
+		},
+	}
+)
+
+func NewTrainHeadOfficeDao(tenant string) TrainHeadOfficeDao {
+	var dao TrainHeadOfficeDao
+	dao = TrainHeadOfficeDao{
+		M:     g.DB(tenant).Model("train_head_office").Safe(),
+		DB:    g.DB(tenant),
+		Table: "train_head_office",
+		C: trainHeadOfficeColumns{
+			Id:                     "id",
+			TrainTitle:             "train_title",
+			TrainDate:              "train_date",
+			TrainConcreteStartTime: "train_concrete_start_time",
+			TrainConcreteEndTime:   "train_concrete_end_time",
+			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 *TrainHeadOfficeDao) Ctx(ctx context.Context) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) GetCtx() context.Context {
+	return d.M.GetCtx()
+}
+
+// As sets an alias name for current table.
+func (d *TrainHeadOfficeDao) As(as string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.As(as), Table: d.Table, TableAs: as}
+}
+
+// TX sets the transaction for current operation.
+func (d *TrainHeadOfficeDao) TX(tx *gdb.TX) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Master marks the following operation on master node.
+func (d *TrainHeadOfficeDao) Master() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Slave() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Args sets custom arguments for model operation.
+func (d *TrainHeadOfficeDao) Args(args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Handler(handlers ...gdb.ModelHandler) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) LeftJoin(table ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) RightJoin(table ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) InnerJoin(table ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Fields(fieldNamesOrMapStruct ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) FieldCount(column string, as ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) FieldSum(column string, as ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) FieldMin(column string, as ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) FieldMax(column string, as ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) FieldAvg(column string, as ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Option(option int) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) OmitEmpty() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) OmitEmptyWhere() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) OmitEmptyData() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) OmitNil() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) OmitNilWhere() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) OmitNilData() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Filter() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Where(where interface{}, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WherePri(where interface{}, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Having(having interface{}, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Wheref(format string, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLT builds "column < value" statement.
+func (d *TrainHeadOfficeDao) WhereLT(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLTE builds "column <= value" statement.
+func (d *TrainHeadOfficeDao) WhereLTE(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGT builds "column > value" statement.
+func (d *TrainHeadOfficeDao) WhereGT(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGTE builds "column >= value" statement.
+func (d *TrainHeadOfficeDao) WhereGTE(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereBetween builds "column BETWEEN min AND max" statement.
+func (d *TrainHeadOfficeDao) WhereBetween(column string, min, max interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLike builds "column LIKE like" statement.
+func (d *TrainHeadOfficeDao) WhereLike(column string, like interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereIn builds "column IN (in)" statement.
+func (d *TrainHeadOfficeDao) WhereIn(column string, in interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WhereNull(columns ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
+func (d *TrainHeadOfficeDao) WhereNotBetween(column string, min, max interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotLike builds "column NOT LIKE like" statement.
+func (d *TrainHeadOfficeDao) WhereNotLike(column string, like interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNot builds "column != value" statement.
+func (d *TrainHeadOfficeDao) WhereNot(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotIn builds "column NOT IN (in)" statement.
+func (d *TrainHeadOfficeDao) WhereNotIn(column string, in interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WhereNotNull(columns ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOr adds "OR" condition to the where statement.
+func (d *TrainHeadOfficeDao) WhereOr(where interface{}, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
+func (d *TrainHeadOfficeDao) WhereOrf(format string, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLT builds "column < value" statement in "OR" conditions..
+func (d *TrainHeadOfficeDao) WhereOrLT(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
+func (d *TrainHeadOfficeDao) WhereOrLTE(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGT builds "column > value" statement in "OR" conditions..
+func (d *TrainHeadOfficeDao) WhereOrGT(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
+func (d *TrainHeadOfficeDao) WhereOrGTE(column string, value interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WhereOrBetween(column string, min, max interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
+func (d *TrainHeadOfficeDao) WhereOrLike(column string, like interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
+func (d *TrainHeadOfficeDao) WhereOrIn(column string, in interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WhereOrNull(columns ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WhereOrNotBetween(column string, min, max interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WhereOrNotLike(column string, like interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotIn builds "column NOT IN (in)" statement.
+func (d *TrainHeadOfficeDao) WhereOrNotIn(column string, in interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) WhereOrNotNull(columns ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *TrainHeadOfficeDao) Group(groupBy ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) And(where interface{}, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Or(where interface{}, args ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GroupBy sets the "GROUP BY" statement for the model.
+func (d *TrainHeadOfficeDao) GroupBy(groupBy string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *TrainHeadOfficeDao) Order(orderBy ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
+func (d *TrainHeadOfficeDao) OrderAsc(column string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
+func (d *TrainHeadOfficeDao) OrderDesc(column string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
+func (d *TrainHeadOfficeDao) OrderRandom() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) OrderBy(orderBy string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Limit(limit ...int) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Offset(offset int) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Distinct forces the query to only return distinct results.
+func (d *TrainHeadOfficeDao) Distinct() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Page(page, limit int) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *TrainHeadOfficeDao) Batch(batch int) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Cache(duration time.Duration, name ...string) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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 *TrainHeadOfficeDao) Data(data ...interface{}) *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{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.TrainHeadOffice.
+// 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 *TrainHeadOfficeDao) All(where ...interface{}) ([]*model.TrainHeadOffice, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainHeadOffice
+	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.TrainHeadOffice.
+// 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 *TrainHeadOfficeDao) One(where ...interface{}) (*model.TrainHeadOffice, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainHeadOffice
+	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 *TrainHeadOfficeDao) FindOne(where ...interface{}) (*model.TrainHeadOffice, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainHeadOffice
+	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 *TrainHeadOfficeDao) FindAll(where ...interface{}) ([]*model.TrainHeadOffice, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainHeadOffice
+	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 *TrainHeadOfficeDao) 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 *TrainHeadOfficeDao) 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 *TrainHeadOfficeDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *TrainHeadOfficeDao) Chunk(limit int, callback func(entities []*model.TrainHeadOffice, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.TrainHeadOffice
+		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 *TrainHeadOfficeDao) LockUpdate() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *TrainHeadOfficeDao) LockShared() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *TrainHeadOfficeDao) Unscoped() *TrainHeadOfficeDao {
+	return &TrainHeadOfficeDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
+}

+ 679 - 0
opms_parent/app/dao/proj/internal/train_head_office_feedback.go

@@ -0,0 +1,679 @@
+// ==========================================================================
+// 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"
+
+	model "dashoo.cn/micro/app/model/proj"
+)
+
+// TrainHeadOfficeFeedbackDao is the manager for logic model data accessing and custom defined data operations functions management.
+type TrainHeadOfficeFeedbackDao struct {
+	gmvc.M                                 // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
+	C       trainHeadOfficeFeedbackColumns // 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.
+}
+
+// TrainHeadOfficeFeedbackColumns defines and stores column names for table train_head_office_feedback.
+type trainHeadOfficeFeedbackColumns struct {
+	Id          string // 主键
+	TrainId     string // 工单id
+	SaleId      string // 销售工程师id
+	SaleName    string // 销售工程师姓名
+	CreatedBy   string // 创建人
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新人
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
+}
+
+var (
+	// TrainHeadOfficeFeedback is globally public accessible object for table train_head_office_feedback operations.
+	TrainHeadOfficeFeedback = TrainHeadOfficeFeedbackDao{
+		M:     g.DB("default").Model("train_head_office_feedback").Safe(),
+		DB:    g.DB("default"),
+		Table: "train_head_office_feedback",
+		C: trainHeadOfficeFeedbackColumns{
+			Id:          "id",
+			TrainId:     "train_id",
+			SaleId:      "sale_id",
+			SaleName:    "sale_name",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+)
+
+func NewTrainHeadOfficeFeedbackDao(tenant string) TrainHeadOfficeFeedbackDao {
+	var dao TrainHeadOfficeFeedbackDao
+	dao = TrainHeadOfficeFeedbackDao{
+		M:     g.DB(tenant).Model("train_head_office_feedback").Safe(),
+		DB:    g.DB(tenant),
+		Table: "train_head_office_feedback",
+		C: trainHeadOfficeFeedbackColumns{
+			Id:          "id",
+			TrainId:     "train_id",
+			SaleId:      "sale_id",
+			SaleName:    "sale_name",
+			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 *TrainHeadOfficeFeedbackDao) Ctx(ctx context.Context) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) GetCtx() context.Context {
+	return d.M.GetCtx()
+}
+
+// As sets an alias name for current table.
+func (d *TrainHeadOfficeFeedbackDao) As(as string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.As(as), Table: d.Table, TableAs: as}
+}
+
+// TX sets the transaction for current operation.
+func (d *TrainHeadOfficeFeedbackDao) TX(tx *gdb.TX) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Master marks the following operation on master node.
+func (d *TrainHeadOfficeFeedbackDao) Master() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Slave() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Args sets custom arguments for model operation.
+func (d *TrainHeadOfficeFeedbackDao) Args(args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Handler(handlers ...gdb.ModelHandler) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) LeftJoin(table ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) RightJoin(table ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) InnerJoin(table ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Fields(fieldNamesOrMapStruct ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) FieldCount(column string, as ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) FieldSum(column string, as ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) FieldMin(column string, as ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) FieldMax(column string, as ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) FieldAvg(column string, as ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Option(option int) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) OmitEmpty() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) OmitEmptyWhere() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) OmitEmptyData() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) OmitNil() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) OmitNilWhere() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) OmitNilData() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Filter() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Where(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WherePri(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Having(having interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Wheref(format string, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLT builds "column < value" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereLT(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLTE builds "column <= value" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereLTE(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGT builds "column > value" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereGT(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGTE builds "column >= value" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereGTE(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereBetween builds "column BETWEEN min AND max" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLike builds "column LIKE like" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereLike(column string, like interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereIn builds "column IN (in)" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereIn(column string, in interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WhereNull(columns ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereNotBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotLike builds "column NOT LIKE like" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereNotLike(column string, like interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNot builds "column != value" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereNot(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotIn builds "column NOT IN (in)" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereNotIn(column string, in interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WhereNotNull(columns ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOr adds "OR" condition to the where statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereOr(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
+func (d *TrainHeadOfficeFeedbackDao) WhereOrf(format string, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLT builds "column < value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDao) WhereOrLT(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDao) WhereOrLTE(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGT builds "column > value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDao) WhereOrGT(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDao) WhereOrGTE(column string, value interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WhereOrBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
+func (d *TrainHeadOfficeFeedbackDao) WhereOrLike(column string, like interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
+func (d *TrainHeadOfficeFeedbackDao) WhereOrIn(column string, in interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WhereOrNull(columns ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WhereOrNotBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WhereOrNotLike(column string, like interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotIn builds "column NOT IN (in)" statement.
+func (d *TrainHeadOfficeFeedbackDao) WhereOrNotIn(column string, in interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) WhereOrNotNull(columns ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *TrainHeadOfficeFeedbackDao) Group(groupBy ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) And(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Or(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GroupBy sets the "GROUP BY" statement for the model.
+func (d *TrainHeadOfficeFeedbackDao) GroupBy(groupBy string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *TrainHeadOfficeFeedbackDao) Order(orderBy ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
+func (d *TrainHeadOfficeFeedbackDao) OrderAsc(column string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
+func (d *TrainHeadOfficeFeedbackDao) OrderDesc(column string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
+func (d *TrainHeadOfficeFeedbackDao) OrderRandom() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) OrderBy(orderBy string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Limit(limit ...int) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Offset(offset int) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Distinct forces the query to only return distinct results.
+func (d *TrainHeadOfficeFeedbackDao) Distinct() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Page(page, limit int) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *TrainHeadOfficeFeedbackDao) Batch(batch int) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Cache(duration time.Duration, name ...string) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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 *TrainHeadOfficeFeedbackDao) Data(data ...interface{}) *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{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.TrainHeadOfficeFeedback.
+// 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 *TrainHeadOfficeFeedbackDao) All(where ...interface{}) ([]*model.TrainHeadOfficeFeedback, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainHeadOfficeFeedback
+	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.TrainHeadOfficeFeedback.
+// 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 *TrainHeadOfficeFeedbackDao) One(where ...interface{}) (*model.TrainHeadOfficeFeedback, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainHeadOfficeFeedback
+	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 *TrainHeadOfficeFeedbackDao) FindOne(where ...interface{}) (*model.TrainHeadOfficeFeedback, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainHeadOfficeFeedback
+	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 *TrainHeadOfficeFeedbackDao) FindAll(where ...interface{}) ([]*model.TrainHeadOfficeFeedback, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainHeadOfficeFeedback
+	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 *TrainHeadOfficeFeedbackDao) 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 *TrainHeadOfficeFeedbackDao) 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 *TrainHeadOfficeFeedbackDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *TrainHeadOfficeFeedbackDao) Chunk(limit int, callback func(entities []*model.TrainHeadOfficeFeedback, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.TrainHeadOfficeFeedback
+		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 *TrainHeadOfficeFeedbackDao) LockUpdate() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *TrainHeadOfficeFeedbackDao) LockShared() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *TrainHeadOfficeFeedbackDao) Unscoped() *TrainHeadOfficeFeedbackDao {
+	return &TrainHeadOfficeFeedbackDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
+}

+ 685 - 0
opms_parent/app/dao/proj/internal/train_head_office_feedback_detail.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"
+
+	model "dashoo.cn/micro/app/model/proj"
+)
+
+// TrainHeadOfficeFeedbackDetailDao is the manager for logic model data accessing and custom defined data operations functions management.
+type TrainHeadOfficeFeedbackDetailDao struct {
+	gmvc.M                                       // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
+	C       trainHeadOfficeFeedbackDetailColumns // 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.
+}
+
+// TrainHeadOfficeFeedbackDetailColumns defines and stores column names for table train_head_office_feedback_detail.
+type trainHeadOfficeFeedbackDetailColumns struct {
+	Id                  string // 主键
+	MainId              string // 工单id
+	DistributorId       string // 渠道id
+	DistributorName     string // 渠道名称
+	TrainingPersNum     string // 参训人数
+	DistributorFeedback string // 经销商反馈
+	CreatedBy           string // 创建人
+	CreatedName         string // 创建人
+	CreatedTime         string // 创建时间
+	UpdatedBy           string // 更新人
+	UpdatedName         string // 更新人
+	UpdatedTime         string // 更新时间
+	DeletedTime         string // 删除时间
+}
+
+var (
+	// TrainHeadOfficeFeedbackDetail is globally public accessible object for table train_head_office_feedback_detail operations.
+	TrainHeadOfficeFeedbackDetail = TrainHeadOfficeFeedbackDetailDao{
+		M:     g.DB("default").Model("train_head_office_feedback_detail").Safe(),
+		DB:    g.DB("default"),
+		Table: "train_head_office_feedback_detail",
+		C: trainHeadOfficeFeedbackDetailColumns{
+			Id:                  "id",
+			MainId:              "main_id",
+			DistributorId:       "distributor_id",
+			DistributorName:     "distributor_name",
+			TrainingPersNum:     "training_pers_num",
+			DistributorFeedback: "distributor_feedback",
+			CreatedBy:           "created_by",
+			CreatedName:         "created_name",
+			CreatedTime:         "created_time",
+			UpdatedBy:           "updated_by",
+			UpdatedName:         "updated_name",
+			UpdatedTime:         "updated_time",
+			DeletedTime:         "deleted_time",
+		},
+	}
+)
+
+func NewTrainHeadOfficeFeedbackDetailDao(tenant string) TrainHeadOfficeFeedbackDetailDao {
+	var dao TrainHeadOfficeFeedbackDetailDao
+	dao = TrainHeadOfficeFeedbackDetailDao{
+		M:     g.DB(tenant).Model("train_head_office_feedback_detail").Safe(),
+		DB:    g.DB(tenant),
+		Table: "train_head_office_feedback_detail",
+		C: trainHeadOfficeFeedbackDetailColumns{
+			Id:                  "id",
+			MainId:              "main_id",
+			DistributorId:       "distributor_id",
+			DistributorName:     "distributor_name",
+			TrainingPersNum:     "training_pers_num",
+			DistributorFeedback: "distributor_feedback",
+			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 *TrainHeadOfficeFeedbackDetailDao) Ctx(ctx context.Context) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) GetCtx() context.Context {
+	return d.M.GetCtx()
+}
+
+// As sets an alias name for current table.
+func (d *TrainHeadOfficeFeedbackDetailDao) As(as string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.As(as), Table: d.Table, TableAs: as}
+}
+
+// TX sets the transaction for current operation.
+func (d *TrainHeadOfficeFeedbackDetailDao) TX(tx *gdb.TX) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Master marks the following operation on master node.
+func (d *TrainHeadOfficeFeedbackDetailDao) Master() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Slave() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Args sets custom arguments for model operation.
+func (d *TrainHeadOfficeFeedbackDetailDao) Args(args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Handler(handlers ...gdb.ModelHandler) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) LeftJoin(table ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) RightJoin(table ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) InnerJoin(table ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Fields(fieldNamesOrMapStruct ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) FieldCount(column string, as ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) FieldSum(column string, as ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) FieldMin(column string, as ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) FieldMax(column string, as ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) FieldAvg(column string, as ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Option(option int) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) OmitEmpty() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) OmitEmptyWhere() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) OmitEmptyData() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) OmitNil() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) OmitNilWhere() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) OmitNilData() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Filter() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Where(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WherePri(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Having(having interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Wheref(format string, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLT builds "column < value" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereLT(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLTE builds "column <= value" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereLTE(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGT builds "column > value" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereGT(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereGTE builds "column >= value" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereGTE(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereBetween builds "column BETWEEN min AND max" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereLike builds "column LIKE like" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereLike(column string, like interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereIn builds "column IN (in)" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereIn(column string, in interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WhereNull(columns ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereNotBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotLike builds "column NOT LIKE like" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereNotLike(column string, like interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNot builds "column != value" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereNot(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereNotIn builds "column NOT IN (in)" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereNotIn(column string, in interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WhereNotNull(columns ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOr adds "OR" condition to the where statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOr(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrf(format string, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLT builds "column < value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrLT(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrLTE(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGT builds "column > value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrGT(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrGTE(column string, value interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WhereOrBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrLike(column string, like interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrIn(column string, in interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WhereOrNull(columns ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WhereOrNotBetween(column string, min, max interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WhereOrNotLike(column string, like interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
+}
+
+// WhereOrNotIn builds "column NOT IN (in)" statement.
+func (d *TrainHeadOfficeFeedbackDetailDao) WhereOrNotIn(column string, in interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) WhereOrNotNull(columns ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *TrainHeadOfficeFeedbackDetailDao) Group(groupBy ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) And(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Or(where interface{}, args ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// GroupBy sets the "GROUP BY" statement for the model.
+func (d *TrainHeadOfficeFeedbackDetailDao) GroupBy(groupBy string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *TrainHeadOfficeFeedbackDetailDao) Order(orderBy ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
+func (d *TrainHeadOfficeFeedbackDetailDao) OrderAsc(column string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
+func (d *TrainHeadOfficeFeedbackDetailDao) OrderDesc(column string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
+}
+
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
+func (d *TrainHeadOfficeFeedbackDetailDao) OrderRandom() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) OrderBy(orderBy string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Limit(limit ...int) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Offset(offset int) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Distinct forces the query to only return distinct results.
+func (d *TrainHeadOfficeFeedbackDetailDao) Distinct() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Page(page, limit int) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *TrainHeadOfficeFeedbackDetailDao) Batch(batch int) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Cache(duration time.Duration, name ...string) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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 *TrainHeadOfficeFeedbackDetailDao) Data(data ...interface{}) *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{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.TrainHeadOfficeFeedbackDetail.
+// 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 *TrainHeadOfficeFeedbackDetailDao) All(where ...interface{}) ([]*model.TrainHeadOfficeFeedbackDetail, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainHeadOfficeFeedbackDetail
+	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.TrainHeadOfficeFeedbackDetail.
+// 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 *TrainHeadOfficeFeedbackDetailDao) One(where ...interface{}) (*model.TrainHeadOfficeFeedbackDetail, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainHeadOfficeFeedbackDetail
+	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 *TrainHeadOfficeFeedbackDetailDao) FindOne(where ...interface{}) (*model.TrainHeadOfficeFeedbackDetail, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.TrainHeadOfficeFeedbackDetail
+	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 *TrainHeadOfficeFeedbackDetailDao) FindAll(where ...interface{}) ([]*model.TrainHeadOfficeFeedbackDetail, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.TrainHeadOfficeFeedbackDetail
+	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 *TrainHeadOfficeFeedbackDetailDao) 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 *TrainHeadOfficeFeedbackDetailDao) 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 *TrainHeadOfficeFeedbackDetailDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *TrainHeadOfficeFeedbackDetailDao) Chunk(limit int, callback func(entities []*model.TrainHeadOfficeFeedbackDetail, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.TrainHeadOfficeFeedbackDetail
+		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 *TrainHeadOfficeFeedbackDetailDao) LockUpdate() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *TrainHeadOfficeFeedbackDetailDao) LockShared() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *TrainHeadOfficeFeedbackDetailDao) Unscoped() *TrainHeadOfficeFeedbackDetailDao {
+	return &TrainHeadOfficeFeedbackDetailDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
+}

+ 36 - 0
opms_parent/app/dao/proj/train_head_office.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/proj/internal"
+)
+
+// trainHeadOfficeDao 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 trainHeadOfficeDao struct {
+	internal.TrainHeadOfficeDao
+}
+
+var (
+	// TrainHeadOffice is globally public accessible object for table train_head_office operations.
+	TrainHeadOffice = trainHeadOfficeDao{
+		internal.TrainHeadOffice,
+	}
+)
+
+type TrainHeadOfficeDao struct {
+	internal.TrainHeadOfficeDao
+}
+
+func NewTrainHeadOfficeDao(tenant string) *TrainHeadOfficeDao {
+	dao := internal.NewTrainHeadOfficeDao(tenant)
+	return &TrainHeadOfficeDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
opms_parent/app/dao/proj/train_head_office_feedback.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/proj/internal"
+)
+
+// trainHeadOfficeFeedbackDao 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 trainHeadOfficeFeedbackDao struct {
+	internal.TrainHeadOfficeFeedbackDao
+}
+
+var (
+	// TrainHeadOfficeFeedback is globally public accessible object for table train_head_office_feedback operations.
+	TrainHeadOfficeFeedback = trainHeadOfficeFeedbackDao{
+		internal.TrainHeadOfficeFeedback,
+	}
+)
+
+type TrainHeadOfficeFeedbackDao struct {
+	internal.TrainHeadOfficeFeedbackDao
+}
+
+func NewTrainHeadOfficeFeedbackDao(tenant string) *TrainHeadOfficeFeedbackDao {
+	dao := internal.NewTrainHeadOfficeFeedbackDao(tenant)
+	return &TrainHeadOfficeFeedbackDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
opms_parent/app/dao/proj/train_head_office_feedback_detail.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/proj/internal"
+)
+
+// trainHeadOfficeFeedbackDetailDao 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 trainHeadOfficeFeedbackDetailDao struct {
+	internal.TrainHeadOfficeFeedbackDetailDao
+}
+
+var (
+	// TrainHeadOfficeFeedbackDetail is globally public accessible object for table train_head_office_feedback_detail operations.
+	TrainHeadOfficeFeedbackDetail = trainHeadOfficeFeedbackDetailDao{
+		internal.TrainHeadOfficeFeedbackDetail,
+	}
+)
+
+type TrainHeadOfficeFeedbackDetailDao struct {
+	internal.TrainHeadOfficeFeedbackDetailDao
+}
+
+func NewTrainHeadOfficeFeedbackDetailDao(tenant string) *TrainHeadOfficeFeedbackDetailDao {
+	dao := internal.NewTrainHeadOfficeFeedbackDetailDao(tenant)
+	return &TrainHeadOfficeFeedbackDetailDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 112 - 0
opms_parent/app/handler/proj/train_head_office.go

@@ -0,0 +1,112 @@
+package base
+
+import (
+	"context"
+	"dashoo.cn/common_definition/comm_def"
+	"dashoo.cn/opms_libary/myerrors"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gvalid"
+
+	projModel "dashoo.cn/micro/app/model/proj"
+	projSrv "dashoo.cn/micro/app/service/proj"
+)
+
+type TrainHeadHander struct{}
+
+// GetList 获取列表
+func (p *TrainHeadHander) GetList(ctx context.Context, req *projModel.SearchTrainHeadReq, rsp *comm_def.CommonMsg) error {
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+
+	businessService, err := projSrv.NewtrainHeadService(ctx)
+	if err != nil {
+		return err
+	}
+	total, list, err := businessService.GetList(req)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": list, "total": total}
+	return nil
+}
+
+// 新建培训工单
+func (p *TrainHeadHander) Create(ctx context.Context, req *projModel.CreateTrainHead, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	businessService, err := projSrv.NewtrainHeadService(ctx)
+	if err != nil {
+		return err
+	}
+	err = businessService.Create(req)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p *TrainHeadHander) UpdateById(ctx context.Context, req *projModel.UpdateTrainHead, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	businessService, err := projSrv.NewtrainHeadService(ctx)
+	if err != nil {
+		return err
+	}
+	err = businessService.UpdateById(req)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p *TrainHeadHander) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if len(req.Ids) == 0 {
+		return myerrors.ValidError("id参数有误!")
+	}
+	businessService, err := projSrv.NewtrainHeadService(ctx)
+	if err != nil {
+		return err
+	}
+	err = businessService.DeleteByIds(req.Ids)
+	return err
+}
+func (h *TrainHeadHander) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewtrainHeadService(ctx)
+	if err != nil {
+		return err
+	}
+	rsp.Data, err = businessService.GetEntityById(req.Id)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+func (h *TrainHeadHander) GetDetailById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewtrainHeadService(ctx)
+	if err != nil {
+		return err
+	}
+	rsp.Data, err = businessService.GetDetailById(req.Id)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (h *TrainHeadHander) FeedBackTrain(ctx context.Context, req *projModel.FeedBackTrainReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewtrainHeadService(ctx)
+	if err != nil {
+		return err
+	}
+	err = businessService.FeedBackTrain(req)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 25 - 0
opms_parent/app/model/proj/internal/train_head_office.go

@@ -0,0 +1,25 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// TrainHeadOffice is the golang structure for table train_head_office.
+type TrainHeadOffice struct {
+	Id                     int         `orm:"id,primary"                json:"id"`                     // 主键
+	TrainTitle             string      `orm:"train_title"               json:"trainTitle"`             // 培训主题
+	TrainDate              *gtime.Time `orm:"train_date"                json:"trainDate"`              // 培训日期
+	TrainConcreteStartTime *gtime.Time `orm:"train_concrete_start_time" json:"trainConcreteStartTime"` // 培训开始时间
+	TrainConcreteEndTime   *gtime.Time `orm:"train_concrete_end_time"   json:"trainConcreteEndTime"`   // 培训结束时间
+	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"`            // 删除时间
+}

+ 24 - 0
opms_parent/app/model/proj/internal/train_head_office_feedback.go

@@ -0,0 +1,24 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// TrainHeadOfficeFeedback is the golang structure for table train_head_office_feedback.
+type TrainHeadOfficeFeedback struct {
+	Id          int         `orm:"id,primary"   json:"id"`          // 主键
+	TrainId     int         `orm:"train_id"     json:"trainId"`     // 工单id
+	SaleId      int         `orm:"sale_id"      json:"saleId"`      // 销售工程师id
+	SaleName    string      `orm:"sale_name"    json:"saleName"`    // 销售工程师姓名
+	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/proj/internal/train_head_office_feedback_detail.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"
+)
+
+// TrainHeadOfficeFeedbackDetail is the golang structure for table train_head_office_feedback_detail.
+type TrainHeadOfficeFeedbackDetail struct {
+	Id                  int         `orm:"id,primary"           json:"id"`                  // 主键
+	MainId              int         `orm:"main_id"              json:"mainId"`              // 工单id
+	DistributorId       int         `orm:"distributor_id"       json:"distributorId"`       // 渠道id
+	DistributorName     string      `orm:"distributor_name"     json:"distributorName"`     // 渠道名称
+	TrainingPersNum     int         `orm:"training_pers_num"    json:"trainingPersNum"`     // 参训人数
+	DistributorFeedback string      `orm:"distributor_feedback" json:"distributorFeedback"` // 经销商反馈
+	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"`         // 删除时间
+}

+ 115 - 0
opms_parent/app/model/proj/train_head_office.go

@@ -0,0 +1,115 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+	"dashoo.cn/opms_libary/request"
+	"github.com/gogf/gf/os/gtime"
+)
+
+// TrainHeadOffice is the golang structure for table train_head_office.
+type TrainHeadOffice internal.TrainHeadOffice
+
+// Fill with you ideas below.
+
+type SearchTrainHeadReq struct {
+	request.PageReq
+	TrainTitle             string      `json:"trainTitle"`             // 培训主题
+	TrainStartDate         *gtime.Time `json:"trainStartDate"`         // 培训开始日期
+	TrainEndDate           *gtime.Time `json:"trainEndDate"`           // 培训结束日期
+	TrainConcreteStartTime *gtime.Time `json:"trainConcreteStartTime"` // 培训开始时间
+	TrainConcreteEndTime   *gtime.Time `json:"trainConcreteEndTime"`   // 培训结束时间
+}
+type SearchTrainHeadRes struct {
+	Id                     int         `json:"id"`                     // 主键
+	TrainTitle             string      `json:"trainTitle"`             // 培训主题
+	TrainDate              *gtime.Time `json:"trainDate"`              // 培训日期
+	TrainConcreteStartTime *gtime.Time `json:"trainConcreteStartTime"` // 培训开始时间
+	TrainConcreteEndTime   *gtime.Time `json:"trainConcreteEndTime"`   // 培训结束时间
+	CreatedTime            *gtime.Time `json:"createdTime"`            // 创建时间
+}
+type TrainHeadDetail struct {
+	Id                     int               `json:"id"`                     // 主键
+	TrainTitle             string            `json:"trainTitle"`             // 培训主题
+	TrainDate              *gtime.Time       `json:"trainDate"`              // 培训日期
+	TrainConcreteStartTime *gtime.Time       `json:"trainConcreteStartTime"` // 培训开始时间
+	TrainConcreteEndTime   *gtime.Time       `json:"trainConcreteEndTime"`   // 培训结束时间
+	FeedbackList           []*FeedbackDetail `json:"feedbackList"`
+}
+
+type TrainHeadDetailForFeedBack struct {
+	Id                     int                  `json:"id"`                     // 主键
+	TrainTitle             string               `json:"trainTitle"`             // 培训主题
+	TrainDate              *gtime.Time          `json:"trainDate"`              // 培训日期
+	TrainConcreteStartTime *gtime.Time          `json:"trainConcreteStartTime"` // 培训开始时间
+	TrainConcreteEndTime   *gtime.Time          `json:"trainConcreteEndTime"`   // 培训结束时间
+	FeedbackDetailList     []*FeedbackDetailRes `json:"feedbackDetailList"`
+}
+type FeedbackDetailRes struct {
+	Id                  int    `json:"id"`                  // 主键
+	SaleId              int    `json:"saleId"`              // 销售工程师id
+	SaleName            string `json:"saleName"`            // 销售工程师姓名
+	DistributorId       int    `json:"distributorId"`       // 渠道id
+	DistributorName     string `json:"distributorName"`     // 渠道名称
+	TrainingPersNum     int    `json:"trainingPersNum"`     // 参训人数
+	DistributorFeedback string `json:"distributorFeedback"` // 经销商反馈
+}
+
+type CreateTrainHead struct {
+	TrainTitle             string            `json:"trainTitle"`             // 培训主题
+	TrainDate              *gtime.Time       `json:"trainDate"`              // 培训日期
+	TrainConcreteStartTime *gtime.Time       `json:"trainConcreteStartTime"` // 培训开始时间
+	TrainConcreteEndTime   *gtime.Time       `json:"trainConcreteEndTime"`   // 培训结束时间
+	FeedbackList           []*CreateFeedback `json:"feedbackList"`
+}
+type UpdateTrainHead struct {
+	Id                     int               `json:"id"`                     // 主键
+	TrainTitle             string            `json:"trainTitle"`             // 培训主题
+	TrainDate              *gtime.Time       `json:"trainDate"`              // 培训日期
+	TrainConcreteStartTime *gtime.Time       `json:"trainConcreteStartTime"` // 培训开始时间
+	TrainConcreteEndTime   *gtime.Time       `json:"trainConcreteEndTime"`   // 培训结束时间
+	FeedbackList           []*UpdateFeedback `json:"feedbackList"`
+}
+type CreateFeedback struct {
+	Sale            Sale           `json:"sale"`            // 销售工程师id
+	DistributorList []*Distributor `json:"distributorList"` // 渠道
+
+}
+type Sale struct {
+	SaleId   int    `json:"saleId"`   // 销售工程师id
+	SaleName string `json:"saleName"` // 销售工程师姓名
+
+}
+type Distributor struct {
+	Id              int    `json:"id"`              // 主键
+	MainId          int    `json:"mainId"`          // 工单id
+	DistributorId   int    `json:"distributorId"`   // 渠道id
+	DistributorName string `json:"distributorName"` // 渠道名称
+}
+type UpdateFeedback struct {
+	Id              int            `json:"id"`              // 主键
+	TrainId         int            `json:"trainId"`         // 工单id
+	Sale            Sale           `json:"sale"`            // 销售工程师id
+	DistributorList []*Distributor `json:"distributorList"` // 渠道
+	Operate         string         `json:"operate"`
+}
+type FeedbackDetail struct {
+	Id                  int            `json:"id"`                  // 主键
+	TrainId             int            `json:"trainId"`             // 工单id
+	SaleId              int            `json:"saleId"`              // 销售工程师id
+	SaleName            string         `json:"saleName"`            // 销售工程师姓名
+	DistributorList     []*Distributor `json:"distributorList"`     // 渠道
+	TrainingPersNum     int            `json:"trainingPersNum"`     // 参训人数
+	DistributorFeedback string         `json:"distributorFeedback"` // 经销商反馈
+}
+type FeedBackTrainReq struct {
+	FeedBackTrainList []*FeedBackTrain `json:"feedBackTrainList"`
+}
+type FeedBackTrain struct {
+	Id                  int    `json:"id"`                  // 主键
+	TrainingPersNum     int    `json:"trainingPersNum"`     // 参训人数
+	DistributorFeedback string `json:"distributorFeedback"` // 经销商反馈
+}

+ 14 - 0
opms_parent/app/model/proj/train_head_office_feedback.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+)
+
+// TrainHeadOfficeFeedback is the golang structure for table train_head_office_feedback.
+type TrainHeadOfficeFeedback internal.TrainHeadOfficeFeedback
+
+// Fill with you ideas below.

+ 14 - 0
opms_parent/app/model/proj/train_head_office_feedback_detail.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+)
+
+// TrainHeadOfficeFeedbackDetail is the golang structure for table train_head_office_feedback_detail.
+type TrainHeadOfficeFeedbackDetail internal.TrainHeadOfficeFeedbackDetail
+
+// Fill with you ideas below.

+ 314 - 0
opms_parent/app/service/proj/train_head_office.go

@@ -0,0 +1,314 @@
+package proj
+
+import (
+	"context"
+	projDao "dashoo.cn/micro/app/dao/proj"
+	model "dashoo.cn/micro/app/model/proj"
+	"dashoo.cn/micro/app/service"
+	"dashoo.cn/opms_libary/myerrors"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/os/gtime"
+)
+
+type trainHeadService struct {
+	*service.ContextService
+	Dao       *projDao.TrainHeadOfficeDao
+	FeedDao   *projDao.TrainHeadOfficeFeedbackDao
+	DetailDao *projDao.TrainHeadOfficeFeedbackDetailDao
+}
+
+func NewtrainHeadService(ctx context.Context) (svc *trainHeadService, err error) {
+	svc = new(trainHeadService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = projDao.NewTrainHeadOfficeDao(svc.Tenant)
+	svc.FeedDao = projDao.NewTrainHeadOfficeFeedbackDao(svc.Tenant)
+	svc.DetailDao = projDao.NewTrainHeadOfficeFeedbackDetailDao(svc.Tenant)
+
+	return svc, nil
+}
+
+func (s *trainHeadService) GetList(req *model.SearchTrainHeadReq) (total int, list []*model.SearchTrainHeadRes, err error) {
+	db := s.Dao.Ctx(s.Ctx)
+
+	if req.TrainTitle != "" {
+		db = db.WhereLike(s.Dao.C.TrainTitle, "%"+req.TrainTitle+"%")
+	}
+	//if req.TrainStartDate != nil {
+	//	db = db.Where("train_date >=?", req.TrainStartDate)
+	//}
+	//if req.TrainEndDate != nil {
+	//	db = db.Where("train_date <=?", req.TrainEndDate)
+	//}
+
+	total, err = db.Count()
+	if err != nil {
+		return 0, nil, err
+	}
+
+	err = db.OrderDesc(s.Dao.C.CreatedTime).Page(req.GetPage()).Scan(&list)
+	//if err != nil && err != sql.ErrNoRows {
+	if err != nil {
+
+		return 0, nil, err
+	}
+	return total, list, nil
+}
+
+func (s *trainHeadService) GetEntityById(id int64) (detail *model.TrainHeadDetail, err error) {
+
+	err = s.Dao.WherePri(id).Scan(&detail)
+
+	if err == sql.ErrNoRows {
+		return nil, myerrors.TipsError("工单不存在")
+	}
+	if err != nil {
+		return nil, err
+	}
+	settingList := make([]*model.FeedbackDetail, 0)
+	err = s.FeedDao.Where(s.FeedDao.C.TrainId, id).Scan(&settingList)
+
+	detail.FeedbackList = settingList
+	for _, feedbackDetail := range settingList {
+		Distributor := make([]*model.Distributor, 0)
+		err = s.DetailDao.Where(s.DetailDao.C.MainId, feedbackDetail.Id).Scan(&Distributor)
+		if err != nil {
+			return nil, myerrors.TipsError("工单查询失败,请稍后重试")
+		}
+		feedbackDetail.DistributorList = Distributor
+
+	}
+	if err != nil {
+		return nil, myerrors.TipsError("工单查询失败,请稍后重试")
+	}
+	return detail, nil
+}
+
+func (s *trainHeadService) GetDetailById(id int64) (detail *model.TrainHeadDetailForFeedBack, err error) {
+
+	err = s.Dao.WherePri(id).Scan(&detail)
+
+	if err == sql.ErrNoRows {
+		return nil, myerrors.TipsError("工单不存在")
+	}
+	if err != nil {
+		return nil, err
+	}
+	settingList := make([]*model.FeedbackDetailRes, 0)
+	err = s.DetailDao.As("fd").LeftJoin("train_head_office_feedback as f", "f.id = fd.main_id").Where("f.train_id", id).
+		Fields("fd.*,f.sale_id,f.sale_name").
+		Scan(&settingList)
+	if err != nil {
+		return nil, myerrors.TipsError("工单查询失败,请稍后重试")
+	}
+	detail.FeedbackDetailList = settingList
+
+	return detail, nil
+}
+
+func (s *trainHeadService) Create(req *model.CreateTrainHead) (err error) {
+
+	ent := model.TrainHeadOffice{
+		Id:                     0,
+		TrainTitle:             req.TrainTitle,
+		TrainDate:              req.TrainDate,
+		TrainConcreteStartTime: req.TrainConcreteStartTime,
+		TrainConcreteEndTime:   req.TrainConcreteEndTime,
+		CreatedBy:              s.GetCxtUserId(),
+		CreatedName:            s.GetCxtUserName(),
+		CreatedTime:            gtime.Now(),
+	}
+	//service.SetCreatedInfo(ent, s.GetCxtUserId(), s.GetCxtUserName())
+
+	e := s.Dao.Transaction(s.Ctx, func(ctx context.Context, tx *gdb.TX) error {
+		id, err := s.Dao.TX(tx).InsertAndGetId(ent)
+		if err != nil {
+			return myerrors.TipsError("提取方案创建失败,请联系管理员")
+		}
+		//CreateSetting := make([]*model.TrainHeadOfficeFeedback, 0)
+		DetailList := make([]*model.TrainHeadOfficeFeedbackDetail, 0)
+		for _, feedBack := range req.FeedbackList {
+			TrainHeadSetting := model.TrainHeadOfficeFeedback{
+				TrainId:     int(id),
+				SaleId:      feedBack.Sale.SaleId,
+				SaleName:    feedBack.Sale.SaleName,
+				CreatedBy:   s.GetCxtUserId(),
+				CreatedName: s.GetCxtUserName(),
+				CreatedTime: gtime.Now(),
+			}
+			//CreateSetting = append(CreateSetting, &TrainHeadSetting)
+			settingId, err := s.FeedDao.TX(tx).InsertAndGetId(TrainHeadSetting)
+			if err != nil {
+				return myerrors.TipsError("提取方案创建失败,请联系管理员")
+			}
+			for _, Dis := range feedBack.DistributorList {
+				detail := model.TrainHeadOfficeFeedbackDetail{
+					MainId:          int(settingId),
+					DistributorId:   Dis.DistributorId,
+					DistributorName: Dis.DistributorName,
+					CreatedBy:       s.GetCxtUserId(),
+					CreatedName:     s.GetCxtUserName(),
+					CreatedTime:     gtime.Now(),
+				}
+				DetailList = append(DetailList, &detail)
+
+			}
+			_, err = s.DetailDao.TX(tx).Insert(DetailList)
+			if err != nil {
+				return myerrors.TipsError("提取方案创建失败,请联系管理员")
+			}
+
+		}
+
+		if err != nil {
+			return myerrors.TipsError("提取方案创建失败,请联系管理员")
+		}
+		return nil
+	})
+
+	return e
+}
+
+func (s *trainHeadService) UpdateById(req *model.UpdateTrainHead) error {
+
+	ent := model.TrainHeadOffice{}
+	err := s.Dao.WherePri(req.Id).Scan(&ent)
+	if err == sql.ErrNoRows {
+		return myerrors.TipsError("该培训工单不存在")
+	}
+	if err != nil {
+		return err
+	}
+
+	updateMap := g.Map{
+		s.Dao.C.TrainTitle:             req.TrainTitle,
+		s.Dao.C.TrainDate:              req.TrainDate,
+		s.Dao.C.TrainConcreteStartTime: req.TrainConcreteStartTime,
+		s.Dao.C.TrainConcreteEndTime:   req.TrainConcreteEndTime,
+		s.Dao.C.UpdatedBy:              s.GetCxtUserId(),
+		s.Dao.C.UpdatedName:            s.GetCxtUserName(),
+		s.Dao.C.UpdatedTime:            gtime.Now(),
+	}
+	e := s.Dao.Transaction(s.Ctx, func(ctx context.Context, tx *gdb.TX) error {
+		_, err = s.Dao.Ctx(ctx).TX(tx).Data(updateMap).WherePri(req.Id).FieldsEx(service.UpdateFieldEx...).Update()
+		if err != nil {
+			return myerrors.TipsError("修改培训工单失败")
+		}
+		for _, feedBack := range req.FeedbackList {
+			switch feedBack.Operate {
+			case "10":
+				TrainHeadSetting := model.TrainHeadOfficeFeedback{
+					TrainId:     int(req.Id),
+					SaleId:      feedBack.Sale.SaleId,
+					SaleName:    feedBack.Sale.SaleName,
+					CreatedBy:   s.GetCxtUserId(),
+					CreatedName: s.GetCxtUserName(),
+					CreatedTime: gtime.Now(),
+				}
+				//service.SetCreatedInfo(TrainHeadSetting, s.GetCxtUserId(), s.GetCxtUserName())
+				DetailList := make([]*model.TrainHeadOfficeFeedbackDetail, 0)
+				//CreateSetting = append(CreateSetting, &TrainHeadSetting)
+				settingId, err := s.FeedDao.TX(tx).InsertAndGetId(TrainHeadSetting)
+				//CreateSetting := make([]*model.TrainHeadOfficeFeedback, 0)
+				for _, Dis := range feedBack.DistributorList {
+					detail := model.TrainHeadOfficeFeedbackDetail{
+						MainId:          int(settingId),
+						DistributorId:   Dis.DistributorId,
+						DistributorName: Dis.DistributorName,
+						CreatedBy:       s.GetCxtUserId(),
+						CreatedName:     s.GetCxtUserName(),
+						CreatedTime:     gtime.Now(),
+					}
+					//service.SetCreatedInfo(detail, s.GetCxtUserId(), s.GetCxtUserName())
+					DetailList = append(DetailList, &detail)
+
+				}
+				_, err = s.DetailDao.TX(tx).Insert(DetailList)
+				if err != nil {
+					return myerrors.TipsError("培训工单修改失败")
+				}
+
+			case "20":
+
+				_, err = s.FeedDao.Ctx(ctx).TX(tx).Data(g.Map{
+					s.FeedDao.C.SaleId:   feedBack.Sale.SaleId,
+					s.FeedDao.C.SaleName: feedBack.Sale.SaleId,
+					s.Dao.C.UpdatedBy:    s.GetCxtUserId(),
+					s.Dao.C.UpdatedName:  s.GetCxtUserName(),
+					s.Dao.C.UpdatedTime:  gtime.Now(),
+				}).WherePri(feedBack.Id).FieldsEx(service.UpdateFieldEx...).Update()
+				_, err = s.DetailDao.TX(tx).Where(s.DetailDao.C.MainId, feedBack.Id).Delete()
+				if err != nil {
+					return myerrors.TipsError("培训工单修改失败")
+				}
+				DetailList := make([]*model.TrainHeadOfficeFeedbackDetail, 0)
+				for _, Dis := range feedBack.DistributorList {
+					detail := model.TrainHeadOfficeFeedbackDetail{
+						MainId:          int(feedBack.Id),
+						DistributorId:   Dis.DistributorId,
+						DistributorName: Dis.DistributorName,
+						CreatedBy:       s.GetCxtUserId(),
+						CreatedName:     s.GetCxtUserName(),
+						CreatedTime:     gtime.Now(),
+					}
+					DetailList = append(DetailList, &detail)
+
+				}
+				_, err = s.DetailDao.TX(tx).Insert(DetailList)
+
+				if err != nil {
+					return myerrors.TipsError("培训工单修改失败")
+				}
+
+			case "30":
+				_, err := s.FeedDao.Ctx(ctx).TX(tx).WherePri(feedBack.Id).Delete()
+				if err != nil {
+					return myerrors.TipsError("培训工单修改失败")
+				}
+			}
+
+		}
+		return nil
+	})
+
+	return e
+}
+func (s *trainHeadService) FeedBackTrain(req *model.FeedBackTrainReq) error {
+	for _, feedback := range req.FeedBackTrainList {
+		_, err := s.DetailDao.Data(g.Map{
+			s.DetailDao.C.TrainingPersNum:     feedback.TrainingPersNum,
+			s.DetailDao.C.DistributorFeedback: feedback.DistributorFeedback,
+			s.Dao.C.UpdatedBy:                 s.GetCxtUserId(),
+			s.Dao.C.UpdatedName:               s.GetCxtUserName(),
+			s.Dao.C.UpdatedTime:               gtime.Now(),
+		}).FieldsEx(service.UpdateFieldEx...).WherePri(feedback.Id).Update()
+		if err != nil {
+			return myerrors.TipsError("培训工单反馈提交失败,请稍后重试")
+		}
+	}
+
+	return nil
+}
+
+func (s *trainHeadService) DeleteByIds(ids []int64) error {
+	if len(ids) == 0 {
+		return nil
+	}
+	e := s.Dao.Transaction(s.Ctx, func(ctx context.Context, tx *gdb.TX) error {
+		_, err := s.Dao.Ctx(ctx).WhereIn(s.Dao.C.Id, ids).Delete()
+		if err != nil {
+			return myerrors.TipsError("培训工单删除失败,请稍后重试")
+		}
+		_, err = s.FeedDao.Ctx(ctx).TX(tx).WhereIn(s.FeedDao.C.TrainId, ids).Delete()
+		if err != nil {
+			return myerrors.TipsError("培训工单删除失败,请稍后重试")
+		}
+
+		return nil
+	})
+
+	return e
+}

+ 15 - 8
opms_parent/config/config.toml

@@ -1,17 +1,19 @@
 # 应用系统设置
 [setting]
     logpath = "/tmp/log/admin"
-    bind-addr = "127.0.0.1:8889"
+    bind-addr = "192.168.0.106:9981"
     bind-mutipart-addr = "127.0.0.1:9999"
     need-advertise-addr = false
-    srv-name = "dashoo.opms.parent-0.0.1"
+    srv-name = "dashoo.opms.parent-0.0.1-sxy"
     env = "dev"
     swagger = true
 
 # 微服务注册中心配置
 [service_registry]
-    registry = "peer2peer" # consul 或 peer2peer
-    server-addr = "127.0.0.1:8500"
+    registry = "consul" # consul 或 peer2peer
+    server-addr = "192.168.0.218:18500"
+
+
 
 # 数据库连接
 [database]
@@ -21,15 +23,16 @@
         updatedAt = "updated_time"
         deletedAt = "deleted_time"
         link = "mysql:root:Dashoo#190801@ali@tcp(192.168.0.252:3306)/dashoo_crm"
-    [[database.cp5vbwxy]]
+
+[[database.cp5vbwxy]]
         Debug = true
         createdAt = "created_time"
         updatedAt = "updated_time"
         deletedAt = "deleted_time"
-        link = "mysql:root:Bgt5^yhn@tcp(sh-cynosdbmysql-grp-caipe5bm.sql.tencentcdb.com:20185)/opms"
+        link = "mysql:root:Bgt56yhn@@@tcp(192.168.0.218:3306)/opms?loc=Local&parseTime=true"
 
 [micro_srv]
-    auth = "dashoo.opms.admin-0.0.1,127.0.0.1:8888"
+    auth = "dashoo.opms.admin-0.0.1-sxy,192.168.0.106:8888"
     tenant = "default"
 
 
@@ -40,4 +43,8 @@
     app-key="dinguytykawticadfoht"
     app-secret="zPlj4ZpITsUbeq2C0GrwJ78-e8knH_kIeyvznaNQacqtrSb9zbeZcOajgBKdolky"
     aes-key="oUjmeWea8Ow1jsdK4UHoDthy6EMQKq3RGbM2rEeTgnm"
-    token="WaasHsYk8V3wqwN5xRGsCmiiRDB"
+    token="WaasHsYk8V3wqwN5xRGsCmiiRDB"
+
+#[micro_srv]
+#    auth = "dashoo.opms.admin-0.0.1-sxy,192.168.0.106:8888"
+#    tenant = "default"

+ 3 - 2
opms_parent/main.go

@@ -76,6 +76,7 @@ func main() {
 	s.RegisterName("ContractReport", new(contract.ContractReportHandler), "")
 	s.RegisterName("BusinessReport", new(projHandler.BusinessReportHandler), "")
 	s.RegisterName("ProductConsultRecord", new(cust.ProductConsultRecordHandler), "")
+	s.RegisterName("TrainHead", new(projHandler.TrainHeadHander), "")
 
 	// 首页
 	s.RegisterName("Home", new(home.HomeHandler), "")
@@ -135,7 +136,7 @@ func swaggerui() {
 	if !g.Config().GetBool("setting.swagger") {
 		return
 	}
-	glog.Info("start swagger at :18080")
-	glog.Error(http.ListenAndServe(":18080",
+	glog.Info("start swagger at :18079")
+	glog.Error(http.ListenAndServe(":18079",
 		http.FileServer(http.Dir("./swaggerui/"))))
 }