Răsfoiți Sursa

feature:添加培训学习的 dao 和 model

liuyaqi 3 ani în urmă
părinte
comite
17f8e1eef0
33 a modificat fișierele cu 3879 adăugiri și 0 ștergeri
  1. 417 0
      dao/learning/internal/learning_exam_record.go
  2. 417 0
      dao/learning/internal/learning_learning_record.go
  3. 426 0
      dao/learning/internal/learning_material.go
  4. 426 0
      dao/learning/internal/learning_question.go
  5. 402 0
      dao/learning/internal/learning_question_testpaper.go
  6. 408 0
      dao/learning/internal/learning_skill.go
  7. 402 0
      dao/learning/internal/learning_skill_instrument.go
  8. 420 0
      dao/learning/internal/learning_testpaper.go
  9. 36 0
      dao/learning/learning_exam_record.go
  10. 36 0
      dao/learning/learning_learning_record.go
  11. 36 0
      dao/learning/learning_material.go
  12. 36 0
      dao/learning/learning_question.go
  13. 36 0
      dao/learning/learning_question_testpaper.go
  14. 36 0
      dao/learning/learning_skill.go
  15. 36 0
      dao/learning/learning_skill_instrument.go
  16. 36 0
      dao/learning/learning_testpaper.go
  17. 21 0
      model/learning/internal/learning_exam_record.go
  18. 21 0
      model/learning/internal/learning_learning_record.go
  19. 24 0
      model/learning/internal/learning_material.go
  20. 24 0
      model/learning/internal/learning_question.go
  21. 12 0
      model/learning/internal/learning_question_testpaper.go
  22. 18 0
      model/learning/internal/learning_skill.go
  23. 12 0
      model/learning/internal/learning_skill_instrument.go
  24. 22 0
      model/learning/internal/learning_testpaper.go
  25. 14 0
      model/learning/learning_exam_record.go
  26. 14 0
      model/learning/learning_learning_record.go
  27. 14 0
      model/learning/learning_material.go
  28. 14 0
      model/learning/learning_question.go
  29. 14 0
      model/learning/learning_question_testpaper.go
  30. 14 0
      model/learning/learning_skill.go
  31. 14 0
      model/learning/learning_skill_instrument.go
  32. 14 0
      model/learning/learning_testpaper.go
  33. 7 0
      sql/create.sql

+ 417 - 0
dao/learning/internal/learning_exam_record.go

@@ -0,0 +1,417 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningExamRecordDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningExamRecordDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningExamRecordColumns
+}
+
+// LearningExamRecordColumns defines and stores column names for table learning_exam_record.
+type learningExamRecordColumns struct {
+	Id          string // Id
+	UserId      string // 用户 Id
+	SkillId     string // 技能 Id
+	TestpaperId string // 试卷 Id
+	Status      string // 状态 1 通过 2 未通过
+	CreatedAt   string // 创建时间
+	UpdatedAt   string // 更新时间
+	DeletedAt   string // 删除时间
+}
+
+var (
+	// LearningExamRecord is globally public accessible object for table learning_exam_record operations.
+	LearningExamRecord = LearningExamRecordDao{
+		M:     g.DB("default").Model("learning_exam_record").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_exam_record",
+		Columns: learningExamRecordColumns{
+			Id:          "Id",
+			UserId:      "UserId",
+			SkillId:     "SkillId",
+			TestpaperId: "TestpaperId",
+			Status:      "Status",
+			CreatedAt:   "CreatedAt",
+			UpdatedAt:   "UpdatedAt",
+			DeletedAt:   "DeletedAt",
+		},
+	}
+)
+
+func NewLearningExamRecordDao(tenant string) LearningExamRecordDao {
+	var dao LearningExamRecordDao
+	dao = LearningExamRecordDao{
+		M:     g.DB(tenant).Model("learning_exam_record").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_exam_record",
+		Columns: learningExamRecordColumns{
+			Id:          "Id",
+			UserId:      "UserId",
+			SkillId:     "SkillId",
+			TestpaperId: "TestpaperId",
+			Status:      "Status",
+			CreatedAt:   "CreatedAt",
+			UpdatedAt:   "UpdatedAt",
+			DeletedAt:   "DeletedAt",
+		},
+	}
+	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 *LearningExamRecordDao) Ctx(ctx context.Context) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningExamRecordDao) As(as string) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningExamRecordDao) TX(tx *gdb.TX) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningExamRecordDao) Master() *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningExamRecordDao) Slave() *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningExamRecordDao) Args(args ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningExamRecordDao) LeftJoin(table ...string) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningExamRecordDao) RightJoin(table ...string) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningExamRecordDao) InnerJoin(table ...string) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningExamRecordDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningExamRecordDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningExamRecordDao) Option(option int) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningExamRecordDao) OmitEmpty() *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningExamRecordDao) Filter() *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Filter()}
+}
+
+// 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 *LearningExamRecordDao) Where(where interface{}, args ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningExamRecordDao) WherePri(where interface{}, args ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningExamRecordDao) And(where interface{}, args ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningExamRecordDao) Or(where interface{}, args ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningExamRecordDao) Group(groupBy string) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningExamRecordDao) Order(orderBy ...string) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningExamRecordDao) Limit(limit ...int) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningExamRecordDao) Offset(offset int) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningExamRecordDao) Page(page, limit int) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningExamRecordDao) Batch(batch int) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningExamRecordDao) Cache(duration time.Duration, name ...string) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningExamRecordDao) Data(data ...interface{}) *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningExamRecord.
+// 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 *LearningExamRecordDao) All(where ...interface{}) ([]*model.LearningExamRecord, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningExamRecord
+	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.LearningExamRecord.
+// 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 *LearningExamRecordDao) One(where ...interface{}) (*model.LearningExamRecord, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningExamRecord
+	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 *LearningExamRecordDao) FindOne(where ...interface{}) (*model.LearningExamRecord, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningExamRecord
+	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 *LearningExamRecordDao) FindAll(where ...interface{}) ([]*model.LearningExamRecord, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningExamRecord
+	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 *LearningExamRecordDao) 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 *LearningExamRecordDao) 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 *LearningExamRecordDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningExamRecordDao) Chunk(limit int, callback func(entities []*model.LearningExamRecord, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningExamRecord
+		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 *LearningExamRecordDao) LockUpdate() *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningExamRecordDao) LockShared() *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningExamRecordDao) Unscoped() *LearningExamRecordDao {
+	return &LearningExamRecordDao{M: d.M.Unscoped()}
+}

+ 417 - 0
dao/learning/internal/learning_learning_record.go

@@ -0,0 +1,417 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningLearningRecordDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningLearningRecordDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningLearningRecordColumns
+}
+
+// LearningLearningRecordColumns defines and stores column names for table learning_learning_record.
+type learningLearningRecordColumns struct {
+	Id         string // Id
+	UserId     string // 用户 Id
+	SkillId    string // 技能 Id
+	MaterialId string // 资料 Id
+	Status     string // 状态 1 已学习
+	CreatedAt  string // 创建时间
+	UpdatedAt  string // 更新时间
+	DeletedAt  string // 删除时间
+}
+
+var (
+	// LearningLearningRecord is globally public accessible object for table learning_learning_record operations.
+	LearningLearningRecord = LearningLearningRecordDao{
+		M:     g.DB("default").Model("learning_learning_record").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_learning_record",
+		Columns: learningLearningRecordColumns{
+			Id:         "Id",
+			UserId:     "UserId",
+			SkillId:    "SkillId",
+			MaterialId: "MaterialId",
+			Status:     "Status",
+			CreatedAt:  "CreatedAt",
+			UpdatedAt:  "UpdatedAt",
+			DeletedAt:  "DeletedAt",
+		},
+	}
+)
+
+func NewLearningLearningRecordDao(tenant string) LearningLearningRecordDao {
+	var dao LearningLearningRecordDao
+	dao = LearningLearningRecordDao{
+		M:     g.DB(tenant).Model("learning_learning_record").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_learning_record",
+		Columns: learningLearningRecordColumns{
+			Id:         "Id",
+			UserId:     "UserId",
+			SkillId:    "SkillId",
+			MaterialId: "MaterialId",
+			Status:     "Status",
+			CreatedAt:  "CreatedAt",
+			UpdatedAt:  "UpdatedAt",
+			DeletedAt:  "DeletedAt",
+		},
+	}
+	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 *LearningLearningRecordDao) Ctx(ctx context.Context) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningLearningRecordDao) As(as string) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningLearningRecordDao) TX(tx *gdb.TX) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningLearningRecordDao) Master() *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningLearningRecordDao) Slave() *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningLearningRecordDao) Args(args ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningLearningRecordDao) LeftJoin(table ...string) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningLearningRecordDao) RightJoin(table ...string) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningLearningRecordDao) InnerJoin(table ...string) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningLearningRecordDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningLearningRecordDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningLearningRecordDao) Option(option int) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningLearningRecordDao) OmitEmpty() *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningLearningRecordDao) Filter() *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Filter()}
+}
+
+// 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 *LearningLearningRecordDao) Where(where interface{}, args ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningLearningRecordDao) WherePri(where interface{}, args ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningLearningRecordDao) And(where interface{}, args ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningLearningRecordDao) Or(where interface{}, args ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningLearningRecordDao) Group(groupBy string) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningLearningRecordDao) Order(orderBy ...string) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningLearningRecordDao) Limit(limit ...int) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningLearningRecordDao) Offset(offset int) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningLearningRecordDao) Page(page, limit int) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningLearningRecordDao) Batch(batch int) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningLearningRecordDao) Cache(duration time.Duration, name ...string) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningLearningRecordDao) Data(data ...interface{}) *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningLearningRecord.
+// 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 *LearningLearningRecordDao) All(where ...interface{}) ([]*model.LearningLearningRecord, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningLearningRecord
+	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.LearningLearningRecord.
+// 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 *LearningLearningRecordDao) One(where ...interface{}) (*model.LearningLearningRecord, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningLearningRecord
+	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 *LearningLearningRecordDao) FindOne(where ...interface{}) (*model.LearningLearningRecord, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningLearningRecord
+	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 *LearningLearningRecordDao) FindAll(where ...interface{}) ([]*model.LearningLearningRecord, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningLearningRecord
+	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 *LearningLearningRecordDao) 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 *LearningLearningRecordDao) 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 *LearningLearningRecordDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningLearningRecordDao) Chunk(limit int, callback func(entities []*model.LearningLearningRecord, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningLearningRecord
+		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 *LearningLearningRecordDao) LockUpdate() *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningLearningRecordDao) LockShared() *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningLearningRecordDao) Unscoped() *LearningLearningRecordDao {
+	return &LearningLearningRecordDao{M: d.M.Unscoped()}
+}

+ 426 - 0
dao/learning/internal/learning_material.go

@@ -0,0 +1,426 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningMaterialDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningMaterialDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningMaterialColumns
+}
+
+// LearningMaterialColumns defines and stores column names for table learning_material.
+type learningMaterialColumns struct {
+	Id        string // Id
+	SkillId   string // 技能 Id
+	Name      string // 资料名称
+	Type      string // 资料类型 1 资料 2 视频
+	SortNo    string // 排序
+	Enable    string // 是否启用
+	Content   string // 资料内容
+	Annex     string // 附件路径
+	CreatedAt string // 创建时间
+	UpdatedAt string // 更新时间
+	DeletedAt string // 删除时间
+}
+
+var (
+	// LearningMaterial is globally public accessible object for table learning_material operations.
+	LearningMaterial = LearningMaterialDao{
+		M:     g.DB("default").Model("learning_material").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_material",
+		Columns: learningMaterialColumns{
+			Id:        "Id",
+			SkillId:   "SkillId",
+			Name:      "Name",
+			Type:      "Type",
+			SortNo:    "SortNo",
+			Enable:    "Enable",
+			Content:   "Content",
+			Annex:     "Annex",
+			CreatedAt: "CreatedAt",
+			UpdatedAt: "UpdatedAt",
+			DeletedAt: "DeletedAt",
+		},
+	}
+)
+
+func NewLearningMaterialDao(tenant string) LearningMaterialDao {
+	var dao LearningMaterialDao
+	dao = LearningMaterialDao{
+		M:     g.DB(tenant).Model("learning_material").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_material",
+		Columns: learningMaterialColumns{
+			Id:        "Id",
+			SkillId:   "SkillId",
+			Name:      "Name",
+			Type:      "Type",
+			SortNo:    "SortNo",
+			Enable:    "Enable",
+			Content:   "Content",
+			Annex:     "Annex",
+			CreatedAt: "CreatedAt",
+			UpdatedAt: "UpdatedAt",
+			DeletedAt: "DeletedAt",
+		},
+	}
+	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 *LearningMaterialDao) Ctx(ctx context.Context) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningMaterialDao) As(as string) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningMaterialDao) TX(tx *gdb.TX) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningMaterialDao) Master() *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningMaterialDao) Slave() *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningMaterialDao) Args(args ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningMaterialDao) LeftJoin(table ...string) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningMaterialDao) RightJoin(table ...string) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningMaterialDao) InnerJoin(table ...string) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningMaterialDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningMaterialDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningMaterialDao) Option(option int) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningMaterialDao) OmitEmpty() *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningMaterialDao) Filter() *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Filter()}
+}
+
+// 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 *LearningMaterialDao) Where(where interface{}, args ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningMaterialDao) WherePri(where interface{}, args ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningMaterialDao) And(where interface{}, args ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningMaterialDao) Or(where interface{}, args ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningMaterialDao) Group(groupBy string) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningMaterialDao) Order(orderBy ...string) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningMaterialDao) Limit(limit ...int) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningMaterialDao) Offset(offset int) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningMaterialDao) Page(page, limit int) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningMaterialDao) Batch(batch int) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningMaterialDao) Cache(duration time.Duration, name ...string) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningMaterialDao) Data(data ...interface{}) *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningMaterial.
+// 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 *LearningMaterialDao) All(where ...interface{}) ([]*model.LearningMaterial, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningMaterial
+	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.LearningMaterial.
+// 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 *LearningMaterialDao) One(where ...interface{}) (*model.LearningMaterial, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningMaterial
+	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 *LearningMaterialDao) FindOne(where ...interface{}) (*model.LearningMaterial, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningMaterial
+	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 *LearningMaterialDao) FindAll(where ...interface{}) ([]*model.LearningMaterial, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningMaterial
+	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 *LearningMaterialDao) 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 *LearningMaterialDao) 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 *LearningMaterialDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningMaterialDao) Chunk(limit int, callback func(entities []*model.LearningMaterial, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningMaterial
+		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 *LearningMaterialDao) LockUpdate() *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningMaterialDao) LockShared() *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningMaterialDao) Unscoped() *LearningMaterialDao {
+	return &LearningMaterialDao{M: d.M.Unscoped()}
+}

+ 426 - 0
dao/learning/internal/learning_question.go

@@ -0,0 +1,426 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningQuestionDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningQuestionDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningQuestionColumns
+}
+
+// LearningQuestionColumns defines and stores column names for table learning_question.
+type learningQuestionColumns struct {
+	Id          string // Id
+	SkillId     string // 技能 Id
+	Name        string // 题目名称
+	Type        string // 题型 1 单选 2 多选 3 判断
+	Enable      string // 是否启用
+	Content     string // 题目内容
+	Explanation string // 题目解析
+	OperateBy   string // 操作人
+	CreatedAt   string // 创建时间
+	UpdatedAt   string // 更新时间
+	DeletedAt   string // 删除时间
+}
+
+var (
+	// LearningQuestion is globally public accessible object for table learning_question operations.
+	LearningQuestion = LearningQuestionDao{
+		M:     g.DB("default").Model("learning_question").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_question",
+		Columns: learningQuestionColumns{
+			Id:          "Id",
+			SkillId:     "SkillId",
+			Name:        "Name",
+			Type:        "Type",
+			Enable:      "Enable",
+			Content:     "Content",
+			Explanation: "Explanation",
+			OperateBy:   "OperateBy",
+			CreatedAt:   "CreatedAt",
+			UpdatedAt:   "UpdatedAt",
+			DeletedAt:   "DeletedAt",
+		},
+	}
+)
+
+func NewLearningQuestionDao(tenant string) LearningQuestionDao {
+	var dao LearningQuestionDao
+	dao = LearningQuestionDao{
+		M:     g.DB(tenant).Model("learning_question").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_question",
+		Columns: learningQuestionColumns{
+			Id:          "Id",
+			SkillId:     "SkillId",
+			Name:        "Name",
+			Type:        "Type",
+			Enable:      "Enable",
+			Content:     "Content",
+			Explanation: "Explanation",
+			OperateBy:   "OperateBy",
+			CreatedAt:   "CreatedAt",
+			UpdatedAt:   "UpdatedAt",
+			DeletedAt:   "DeletedAt",
+		},
+	}
+	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 *LearningQuestionDao) Ctx(ctx context.Context) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningQuestionDao) As(as string) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningQuestionDao) TX(tx *gdb.TX) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningQuestionDao) Master() *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningQuestionDao) Slave() *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningQuestionDao) Args(args ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningQuestionDao) LeftJoin(table ...string) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningQuestionDao) RightJoin(table ...string) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningQuestionDao) InnerJoin(table ...string) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningQuestionDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningQuestionDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningQuestionDao) Option(option int) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningQuestionDao) OmitEmpty() *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningQuestionDao) Filter() *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Filter()}
+}
+
+// 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 *LearningQuestionDao) Where(where interface{}, args ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningQuestionDao) WherePri(where interface{}, args ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningQuestionDao) And(where interface{}, args ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningQuestionDao) Or(where interface{}, args ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningQuestionDao) Group(groupBy string) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningQuestionDao) Order(orderBy ...string) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningQuestionDao) Limit(limit ...int) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningQuestionDao) Offset(offset int) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningQuestionDao) Page(page, limit int) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningQuestionDao) Batch(batch int) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningQuestionDao) Cache(duration time.Duration, name ...string) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningQuestionDao) Data(data ...interface{}) *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningQuestion.
+// 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 *LearningQuestionDao) All(where ...interface{}) ([]*model.LearningQuestion, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningQuestion
+	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.LearningQuestion.
+// 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 *LearningQuestionDao) One(where ...interface{}) (*model.LearningQuestion, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningQuestion
+	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 *LearningQuestionDao) FindOne(where ...interface{}) (*model.LearningQuestion, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningQuestion
+	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 *LearningQuestionDao) FindAll(where ...interface{}) ([]*model.LearningQuestion, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningQuestion
+	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 *LearningQuestionDao) 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 *LearningQuestionDao) 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 *LearningQuestionDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningQuestionDao) Chunk(limit int, callback func(entities []*model.LearningQuestion, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningQuestion
+		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 *LearningQuestionDao) LockUpdate() *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningQuestionDao) LockShared() *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningQuestionDao) Unscoped() *LearningQuestionDao {
+	return &LearningQuestionDao{M: d.M.Unscoped()}
+}

+ 402 - 0
dao/learning/internal/learning_question_testpaper.go

@@ -0,0 +1,402 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningQuestionTestpaperDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningQuestionTestpaperDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningQuestionTestpaperColumns
+}
+
+// LearningQuestionTestpaperColumns defines and stores column names for table learning_question_testpaper.
+type learningQuestionTestpaperColumns struct {
+	Id          string // Id
+	QuestionId  string // 题目 Id
+	TestpaperId string // 试卷 Id
+}
+
+var (
+	// LearningQuestionTestpaper is globally public accessible object for table learning_question_testpaper operations.
+	LearningQuestionTestpaper = LearningQuestionTestpaperDao{
+		M:     g.DB("default").Model("learning_question_testpaper").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_question_testpaper",
+		Columns: learningQuestionTestpaperColumns{
+			Id:          "Id",
+			QuestionId:  "QuestionId",
+			TestpaperId: "TestpaperId",
+		},
+	}
+)
+
+func NewLearningQuestionTestpaperDao(tenant string) LearningQuestionTestpaperDao {
+	var dao LearningQuestionTestpaperDao
+	dao = LearningQuestionTestpaperDao{
+		M:     g.DB(tenant).Model("learning_question_testpaper").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_question_testpaper",
+		Columns: learningQuestionTestpaperColumns{
+			Id:          "Id",
+			QuestionId:  "QuestionId",
+			TestpaperId: "TestpaperId",
+		},
+	}
+	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 *LearningQuestionTestpaperDao) Ctx(ctx context.Context) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningQuestionTestpaperDao) As(as string) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningQuestionTestpaperDao) TX(tx *gdb.TX) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningQuestionTestpaperDao) Master() *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningQuestionTestpaperDao) Slave() *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningQuestionTestpaperDao) Args(args ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) LeftJoin(table ...string) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) RightJoin(table ...string) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) InnerJoin(table ...string) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningQuestionTestpaperDao) Option(option int) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningQuestionTestpaperDao) OmitEmpty() *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningQuestionTestpaperDao) Filter() *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Filter()}
+}
+
+// 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 *LearningQuestionTestpaperDao) Where(where interface{}, args ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) WherePri(where interface{}, args ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningQuestionTestpaperDao) And(where interface{}, args ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningQuestionTestpaperDao) Or(where interface{}, args ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningQuestionTestpaperDao) Group(groupBy string) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningQuestionTestpaperDao) Order(orderBy ...string) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) Limit(limit ...int) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningQuestionTestpaperDao) Offset(offset int) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningQuestionTestpaperDao) Page(page, limit int) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningQuestionTestpaperDao) Batch(batch int) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningQuestionTestpaperDao) Cache(duration time.Duration, name ...string) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningQuestionTestpaperDao) Data(data ...interface{}) *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningQuestionTestpaper.
+// 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 *LearningQuestionTestpaperDao) All(where ...interface{}) ([]*model.LearningQuestionTestpaper, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningQuestionTestpaper
+	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.LearningQuestionTestpaper.
+// 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 *LearningQuestionTestpaperDao) One(where ...interface{}) (*model.LearningQuestionTestpaper, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningQuestionTestpaper
+	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 *LearningQuestionTestpaperDao) FindOne(where ...interface{}) (*model.LearningQuestionTestpaper, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningQuestionTestpaper
+	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 *LearningQuestionTestpaperDao) FindAll(where ...interface{}) ([]*model.LearningQuestionTestpaper, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningQuestionTestpaper
+	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 *LearningQuestionTestpaperDao) 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 *LearningQuestionTestpaperDao) 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 *LearningQuestionTestpaperDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningQuestionTestpaperDao) Chunk(limit int, callback func(entities []*model.LearningQuestionTestpaper, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningQuestionTestpaper
+		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 *LearningQuestionTestpaperDao) LockUpdate() *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningQuestionTestpaperDao) LockShared() *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningQuestionTestpaperDao) Unscoped() *LearningQuestionTestpaperDao {
+	return &LearningQuestionTestpaperDao{M: d.M.Unscoped()}
+}

+ 408 - 0
dao/learning/internal/learning_skill.go

@@ -0,0 +1,408 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningSkillDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningSkillDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningSkillColumns
+}
+
+// LearningSkillColumns defines and stores column names for table learning_skill.
+type learningSkillColumns struct {
+	Id        string // Id
+	Name      string // 技能名称
+	CreatedAt string // 创建时间
+	UpdatedAt string // 更新时间
+	DeletedAt string // 删除时间
+}
+
+var (
+	// LearningSkill is globally public accessible object for table learning_skill operations.
+	LearningSkill = LearningSkillDao{
+		M:     g.DB("default").Model("learning_skill").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_skill",
+		Columns: learningSkillColumns{
+			Id:        "Id",
+			Name:      "Name",
+			CreatedAt: "CreatedAt",
+			UpdatedAt: "UpdatedAt",
+			DeletedAt: "DeletedAt",
+		},
+	}
+)
+
+func NewLearningSkillDao(tenant string) LearningSkillDao {
+	var dao LearningSkillDao
+	dao = LearningSkillDao{
+		M:     g.DB(tenant).Model("learning_skill").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_skill",
+		Columns: learningSkillColumns{
+			Id:        "Id",
+			Name:      "Name",
+			CreatedAt: "CreatedAt",
+			UpdatedAt: "UpdatedAt",
+			DeletedAt: "DeletedAt",
+		},
+	}
+	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 *LearningSkillDao) Ctx(ctx context.Context) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningSkillDao) As(as string) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningSkillDao) TX(tx *gdb.TX) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningSkillDao) Master() *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningSkillDao) Slave() *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningSkillDao) Args(args ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningSkillDao) LeftJoin(table ...string) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningSkillDao) RightJoin(table ...string) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningSkillDao) InnerJoin(table ...string) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningSkillDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningSkillDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningSkillDao) Option(option int) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningSkillDao) OmitEmpty() *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningSkillDao) Filter() *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Filter()}
+}
+
+// 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 *LearningSkillDao) Where(where interface{}, args ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningSkillDao) WherePri(where interface{}, args ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningSkillDao) And(where interface{}, args ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningSkillDao) Or(where interface{}, args ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningSkillDao) Group(groupBy string) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningSkillDao) Order(orderBy ...string) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningSkillDao) Limit(limit ...int) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningSkillDao) Offset(offset int) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningSkillDao) Page(page, limit int) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningSkillDao) Batch(batch int) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningSkillDao) Cache(duration time.Duration, name ...string) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningSkillDao) Data(data ...interface{}) *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningSkill.
+// 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 *LearningSkillDao) All(where ...interface{}) ([]*model.LearningSkill, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningSkill
+	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.LearningSkill.
+// 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 *LearningSkillDao) One(where ...interface{}) (*model.LearningSkill, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningSkill
+	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 *LearningSkillDao) FindOne(where ...interface{}) (*model.LearningSkill, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningSkill
+	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 *LearningSkillDao) FindAll(where ...interface{}) ([]*model.LearningSkill, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningSkill
+	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 *LearningSkillDao) 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 *LearningSkillDao) 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 *LearningSkillDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningSkillDao) Chunk(limit int, callback func(entities []*model.LearningSkill, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningSkill
+		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 *LearningSkillDao) LockUpdate() *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningSkillDao) LockShared() *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningSkillDao) Unscoped() *LearningSkillDao {
+	return &LearningSkillDao{M: d.M.Unscoped()}
+}

+ 402 - 0
dao/learning/internal/learning_skill_instrument.go

@@ -0,0 +1,402 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningSkillInstrumentDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningSkillInstrumentDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningSkillInstrumentColumns
+}
+
+// LearningSkillInstrumentColumns defines and stores column names for table learning_skill_instrument.
+type learningSkillInstrumentColumns struct {
+	Id           string // Id
+	SkillId      string // 技能 Id
+	InstrumentId string // 设备 Id
+}
+
+var (
+	// LearningSkillInstrument is globally public accessible object for table learning_skill_instrument operations.
+	LearningSkillInstrument = LearningSkillInstrumentDao{
+		M:     g.DB("default").Model("learning_skill_instrument").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_skill_instrument",
+		Columns: learningSkillInstrumentColumns{
+			Id:           "Id",
+			SkillId:      "SkillId",
+			InstrumentId: "InstrumentId",
+		},
+	}
+)
+
+func NewLearningSkillInstrumentDao(tenant string) LearningSkillInstrumentDao {
+	var dao LearningSkillInstrumentDao
+	dao = LearningSkillInstrumentDao{
+		M:     g.DB(tenant).Model("learning_skill_instrument").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_skill_instrument",
+		Columns: learningSkillInstrumentColumns{
+			Id:           "Id",
+			SkillId:      "SkillId",
+			InstrumentId: "InstrumentId",
+		},
+	}
+	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 *LearningSkillInstrumentDao) Ctx(ctx context.Context) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningSkillInstrumentDao) As(as string) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningSkillInstrumentDao) TX(tx *gdb.TX) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningSkillInstrumentDao) Master() *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningSkillInstrumentDao) Slave() *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningSkillInstrumentDao) Args(args ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningSkillInstrumentDao) LeftJoin(table ...string) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningSkillInstrumentDao) RightJoin(table ...string) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningSkillInstrumentDao) InnerJoin(table ...string) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningSkillInstrumentDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningSkillInstrumentDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningSkillInstrumentDao) Option(option int) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningSkillInstrumentDao) OmitEmpty() *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningSkillInstrumentDao) Filter() *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Filter()}
+}
+
+// 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 *LearningSkillInstrumentDao) Where(where interface{}, args ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningSkillInstrumentDao) WherePri(where interface{}, args ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningSkillInstrumentDao) And(where interface{}, args ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningSkillInstrumentDao) Or(where interface{}, args ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningSkillInstrumentDao) Group(groupBy string) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningSkillInstrumentDao) Order(orderBy ...string) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningSkillInstrumentDao) Limit(limit ...int) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningSkillInstrumentDao) Offset(offset int) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningSkillInstrumentDao) Page(page, limit int) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningSkillInstrumentDao) Batch(batch int) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningSkillInstrumentDao) Cache(duration time.Duration, name ...string) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningSkillInstrumentDao) Data(data ...interface{}) *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningSkillInstrument.
+// 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 *LearningSkillInstrumentDao) All(where ...interface{}) ([]*model.LearningSkillInstrument, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningSkillInstrument
+	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.LearningSkillInstrument.
+// 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 *LearningSkillInstrumentDao) One(where ...interface{}) (*model.LearningSkillInstrument, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningSkillInstrument
+	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 *LearningSkillInstrumentDao) FindOne(where ...interface{}) (*model.LearningSkillInstrument, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningSkillInstrument
+	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 *LearningSkillInstrumentDao) FindAll(where ...interface{}) ([]*model.LearningSkillInstrument, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningSkillInstrument
+	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 *LearningSkillInstrumentDao) 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 *LearningSkillInstrumentDao) 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 *LearningSkillInstrumentDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningSkillInstrumentDao) Chunk(limit int, callback func(entities []*model.LearningSkillInstrument, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningSkillInstrument
+		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 *LearningSkillInstrumentDao) LockUpdate() *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningSkillInstrumentDao) LockShared() *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningSkillInstrumentDao) Unscoped() *LearningSkillInstrumentDao {
+	return &LearningSkillInstrumentDao{M: d.M.Unscoped()}
+}

+ 420 - 0
dao/learning/internal/learning_testpaper.go

@@ -0,0 +1,420 @@
+// ==========================================================================
+// 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 "lims_adapter/model/learning"
+)
+
+// LearningTestpaperDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type LearningTestpaperDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns learningTestpaperColumns
+}
+
+// LearningTestpaperColumns defines and stores column names for table learning_testpaper.
+type learningTestpaperColumns struct {
+	Id        string // Id
+	SkillId   string // 技能 Id
+	Name      string // 试卷名称
+	Enable    string // 是否启用
+	TimeLimit string // 答题时间/分钟
+	PassLimit string // 合格标准/题数
+	CreatedAt string // 创建时间
+	UpdatedAt string // 更新时间
+	DeletedAt string // 删除时间
+}
+
+var (
+	// LearningTestpaper is globally public accessible object for table learning_testpaper operations.
+	LearningTestpaper = LearningTestpaperDao{
+		M:     g.DB("default").Model("learning_testpaper").Safe(),
+		DB:    g.DB("default"),
+		Table: "learning_testpaper",
+		Columns: learningTestpaperColumns{
+			Id:        "Id",
+			SkillId:   "SkillId",
+			Name:      "Name",
+			Enable:    "Enable",
+			TimeLimit: "TimeLimit",
+			PassLimit: "PassLimit",
+			CreatedAt: "CreatedAt",
+			UpdatedAt: "UpdatedAt",
+			DeletedAt: "DeletedAt",
+		},
+	}
+)
+
+func NewLearningTestpaperDao(tenant string) LearningTestpaperDao {
+	var dao LearningTestpaperDao
+	dao = LearningTestpaperDao{
+		M:     g.DB(tenant).Model("learning_testpaper").Safe(),
+		DB:    g.DB(tenant),
+		Table: "learning_testpaper",
+		Columns: learningTestpaperColumns{
+			Id:        "Id",
+			SkillId:   "SkillId",
+			Name:      "Name",
+			Enable:    "Enable",
+			TimeLimit: "TimeLimit",
+			PassLimit: "PassLimit",
+			CreatedAt: "CreatedAt",
+			UpdatedAt: "UpdatedAt",
+			DeletedAt: "DeletedAt",
+		},
+	}
+	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 *LearningTestpaperDao) Ctx(ctx context.Context) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *LearningTestpaperDao) As(as string) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *LearningTestpaperDao) TX(tx *gdb.TX) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *LearningTestpaperDao) Master() *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *LearningTestpaperDao) Slave() *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *LearningTestpaperDao) Args(args ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Args(args...)}
+}
+
+// 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 *LearningTestpaperDao) LeftJoin(table ...string) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.LeftJoin(table...)}
+}
+
+// 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 *LearningTestpaperDao) RightJoin(table ...string) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.RightJoin(table...)}
+}
+
+// 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 *LearningTestpaperDao) InnerJoin(table ...string) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.InnerJoin(table...)}
+}
+
+// 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 *LearningTestpaperDao) Fields(fieldNamesOrMapStruct ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// 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 *LearningTestpaperDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *LearningTestpaperDao) Option(option int) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *LearningTestpaperDao) OmitEmpty() *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *LearningTestpaperDao) Filter() *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Filter()}
+}
+
+// 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 *LearningTestpaperDao) Where(where interface{}, args ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Where(where, args...)}
+}
+
+// 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 *LearningTestpaperDao) WherePri(where interface{}, args ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *LearningTestpaperDao) And(where interface{}, args ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *LearningTestpaperDao) Or(where interface{}, args ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *LearningTestpaperDao) Group(groupBy string) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *LearningTestpaperDao) Order(orderBy ...string) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Order(orderBy...)}
+}
+
+// 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 *LearningTestpaperDao) Limit(limit ...int) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *LearningTestpaperDao) Offset(offset int) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Offset(offset)}
+}
+
+// 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 *LearningTestpaperDao) Page(page, limit int) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *LearningTestpaperDao) Batch(batch int) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Batch(batch)}
+}
+
+// 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 *LearningTestpaperDao) Cache(duration time.Duration, name ...string) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Cache(duration, name...)}
+}
+
+// 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 *LearningTestpaperDao) Data(data ...interface{}) *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.LearningTestpaper.
+// 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 *LearningTestpaperDao) All(where ...interface{}) ([]*model.LearningTestpaper, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningTestpaper
+	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.LearningTestpaper.
+// 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 *LearningTestpaperDao) One(where ...interface{}) (*model.LearningTestpaper, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningTestpaper
+	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 *LearningTestpaperDao) FindOne(where ...interface{}) (*model.LearningTestpaper, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.LearningTestpaper
+	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 *LearningTestpaperDao) FindAll(where ...interface{}) ([]*model.LearningTestpaper, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.LearningTestpaper
+	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 *LearningTestpaperDao) 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 *LearningTestpaperDao) 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 *LearningTestpaperDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *LearningTestpaperDao) Chunk(limit int, callback func(entities []*model.LearningTestpaper, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.LearningTestpaper
+		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 *LearningTestpaperDao) LockUpdate() *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *LearningTestpaperDao) LockShared() *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *LearningTestpaperDao) Unscoped() *LearningTestpaperDao {
+	return &LearningTestpaperDao{M: d.M.Unscoped()}
+}

+ 36 - 0
dao/learning/learning_exam_record.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningExamRecordDao 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 learningExamRecordDao struct {
+	internal.LearningExamRecordDao
+}
+
+var (
+	// LearningExamRecord is globally public accessible object for table learning_exam_record operations.
+	LearningExamRecord = learningExamRecordDao{
+		internal.LearningExamRecord,
+	}
+)
+
+type LearningExamRecordDao struct {
+	internal.LearningExamRecordDao
+}
+
+func NewLearningExamRecordDao(tenant string) *LearningExamRecordDao {
+	dao := internal.NewLearningExamRecordDao(tenant)
+	return &LearningExamRecordDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/learning/learning_learning_record.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningLearningRecordDao 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 learningLearningRecordDao struct {
+	internal.LearningLearningRecordDao
+}
+
+var (
+	// LearningLearningRecord is globally public accessible object for table learning_learning_record operations.
+	LearningLearningRecord = learningLearningRecordDao{
+		internal.LearningLearningRecord,
+	}
+)
+
+type LearningLearningRecordDao struct {
+	internal.LearningLearningRecordDao
+}
+
+func NewLearningLearningRecordDao(tenant string) *LearningLearningRecordDao {
+	dao := internal.NewLearningLearningRecordDao(tenant)
+	return &LearningLearningRecordDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/learning/learning_material.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningMaterialDao 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 learningMaterialDao struct {
+	internal.LearningMaterialDao
+}
+
+var (
+	// LearningMaterial is globally public accessible object for table learning_material operations.
+	LearningMaterial = learningMaterialDao{
+		internal.LearningMaterial,
+	}
+)
+
+type LearningMaterialDao struct {
+	internal.LearningMaterialDao
+}
+
+func NewLearningMaterialDao(tenant string) *LearningMaterialDao {
+	dao := internal.NewLearningMaterialDao(tenant)
+	return &LearningMaterialDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/learning/learning_question.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningQuestionDao 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 learningQuestionDao struct {
+	internal.LearningQuestionDao
+}
+
+var (
+	// LearningQuestion is globally public accessible object for table learning_question operations.
+	LearningQuestion = learningQuestionDao{
+		internal.LearningQuestion,
+	}
+)
+
+type LearningQuestionDao struct {
+	internal.LearningQuestionDao
+}
+
+func NewLearningQuestionDao(tenant string) *LearningQuestionDao {
+	dao := internal.NewLearningQuestionDao(tenant)
+	return &LearningQuestionDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/learning/learning_question_testpaper.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningQuestionTestpaperDao 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 learningQuestionTestpaperDao struct {
+	internal.LearningQuestionTestpaperDao
+}
+
+var (
+	// LearningQuestionTestpaper is globally public accessible object for table learning_question_testpaper operations.
+	LearningQuestionTestpaper = learningQuestionTestpaperDao{
+		internal.LearningQuestionTestpaper,
+	}
+)
+
+type LearningQuestionTestpaperDao struct {
+	internal.LearningQuestionTestpaperDao
+}
+
+func NewLearningQuestionTestpaperDao(tenant string) *LearningQuestionTestpaperDao {
+	dao := internal.NewLearningQuestionTestpaperDao(tenant)
+	return &LearningQuestionTestpaperDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/learning/learning_skill.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningSkillDao 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 learningSkillDao struct {
+	internal.LearningSkillDao
+}
+
+var (
+	// LearningSkill is globally public accessible object for table learning_skill operations.
+	LearningSkill = learningSkillDao{
+		internal.LearningSkill,
+	}
+)
+
+type LearningSkillDao struct {
+	internal.LearningSkillDao
+}
+
+func NewLearningSkillDao(tenant string) *LearningSkillDao {
+	dao := internal.NewLearningSkillDao(tenant)
+	return &LearningSkillDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/learning/learning_skill_instrument.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningSkillInstrumentDao 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 learningSkillInstrumentDao struct {
+	internal.LearningSkillInstrumentDao
+}
+
+var (
+	// LearningSkillInstrument is globally public accessible object for table learning_skill_instrument operations.
+	LearningSkillInstrument = learningSkillInstrumentDao{
+		internal.LearningSkillInstrument,
+	}
+)
+
+type LearningSkillInstrumentDao struct {
+	internal.LearningSkillInstrumentDao
+}
+
+func NewLearningSkillInstrumentDao(tenant string) *LearningSkillInstrumentDao {
+	dao := internal.NewLearningSkillInstrumentDao(tenant)
+	return &LearningSkillInstrumentDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/learning/learning_testpaper.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/learning/internal"
+)
+
+// learningTestpaperDao 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 learningTestpaperDao struct {
+	internal.LearningTestpaperDao
+}
+
+var (
+	// LearningTestpaper is globally public accessible object for table learning_testpaper operations.
+	LearningTestpaper = learningTestpaperDao{
+		internal.LearningTestpaper,
+	}
+)
+
+type LearningTestpaperDao struct {
+	internal.LearningTestpaperDao
+}
+
+func NewLearningTestpaperDao(tenant string) *LearningTestpaperDao {
+	dao := internal.NewLearningTestpaperDao(tenant)
+	return &LearningTestpaperDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 21 - 0
model/learning/internal/learning_exam_record.go

@@ -0,0 +1,21 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// LearningExamRecord is the golang structure for table learning_exam_record.
+type LearningExamRecord struct {
+	Id          int         `orm:"Id,primary"  json:"id"`          // Id
+	UserId      int         `orm:"UserId"      json:"userId"`      // 用户 Id
+	SkillId     int         `orm:"SkillId"     json:"skillId"`     // 技能 Id
+	TestpaperId int         `orm:"TestpaperId" json:"testpaperId"` // 试卷 Id
+	Status      int         `orm:"Status"      json:"status"`      // 状态 1 通过 2 未通过
+	CreatedAt   *gtime.Time `orm:"CreatedAt"   json:"createdAt"`   // 创建时间
+	UpdatedAt   *gtime.Time `orm:"UpdatedAt"   json:"updatedAt"`   // 更新时间
+	DeletedAt   *gtime.Time `orm:"DeletedAt"   json:"deletedAt"`   // 删除时间
+}

+ 21 - 0
model/learning/internal/learning_learning_record.go

@@ -0,0 +1,21 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// LearningLearningRecord is the golang structure for table learning_learning_record.
+type LearningLearningRecord struct {
+	Id         int         `orm:"Id,primary" json:"id"`         // Id
+	UserId     int         `orm:"UserId"     json:"userId"`     // 用户 Id
+	SkillId    int         `orm:"SkillId"    json:"skillId"`    // 技能 Id
+	MaterialId int         `orm:"MaterialId" json:"materialId"` // 资料 Id
+	Status     int         `orm:"Status"     json:"status"`     // 状态 1 已学习
+	CreatedAt  *gtime.Time `orm:"CreatedAt"  json:"createdAt"`  // 创建时间
+	UpdatedAt  *gtime.Time `orm:"UpdatedAt"  json:"updatedAt"`  // 更新时间
+	DeletedAt  *gtime.Time `orm:"DeletedAt"  json:"deletedAt"`  // 删除时间
+}

+ 24 - 0
model/learning/internal/learning_material.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"
+)
+
+// LearningMaterial is the golang structure for table learning_material.
+type LearningMaterial struct {
+	Id        int         `orm:"Id,primary" json:"id"`        // Id
+	SkillId   int         `orm:"SkillId"    json:"skillId"`   // 技能 Id
+	Name      string      `orm:"Name"       json:"name"`      // 资料名称
+	Type      int         `orm:"Type"       json:"type"`      // 资料类型 1 资料 2 视频
+	SortNo    int         `orm:"SortNo"     json:"sortNo"`    // 排序
+	Enable    int         `orm:"Enable"     json:"enable"`    // 是否启用
+	Content   string      `orm:"Content"    json:"content"`   // 资料内容
+	Annex     string      `orm:"Annex"      json:"annex"`     // 附件路径
+	CreatedAt *gtime.Time `orm:"CreatedAt"  json:"createdAt"` // 创建时间
+	UpdatedAt *gtime.Time `orm:"UpdatedAt"  json:"updatedAt"` // 更新时间
+	DeletedAt *gtime.Time `orm:"DeletedAt"  json:"deletedAt"` // 删除时间
+}

+ 24 - 0
model/learning/internal/learning_question.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"
+)
+
+// LearningQuestion is the golang structure for table learning_question.
+type LearningQuestion struct {
+	Id          int         `orm:"Id,primary"  json:"id"`          // Id
+	SkillId     int         `orm:"SkillId"     json:"skillId"`     // 技能 Id
+	Name        string      `orm:"Name"        json:"name"`        // 题目名称
+	Type        int         `orm:"Type"        json:"type"`        // 题型 1 单选 2 多选 3 判断
+	Enable      int         `orm:"Enable"      json:"enable"`      // 是否启用
+	Content     string      `orm:"Content"     json:"content"`     // 题目内容
+	Explanation string      `orm:"Explanation" json:"explanation"` // 题目解析
+	OperateBy   string      `orm:"OperateBy"   json:"operateBy"`   // 操作人
+	CreatedAt   *gtime.Time `orm:"CreatedAt"   json:"createdAt"`   // 创建时间
+	UpdatedAt   *gtime.Time `orm:"UpdatedAt"   json:"updatedAt"`   // 更新时间
+	DeletedAt   *gtime.Time `orm:"DeletedAt"   json:"deletedAt"`   // 删除时间
+}

+ 12 - 0
model/learning/internal/learning_question_testpaper.go

@@ -0,0 +1,12 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+// LearningQuestionTestpaper is the golang structure for table learning_question_testpaper.
+type LearningQuestionTestpaper struct {
+	Id          int `orm:"Id,primary"  json:"id"`          // Id
+	QuestionId  int `orm:"QuestionId"  json:"questionId"`  // 题目 Id
+	TestpaperId int `orm:"TestpaperId" json:"testpaperId"` // 试卷 Id
+}

+ 18 - 0
model/learning/internal/learning_skill.go

@@ -0,0 +1,18 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// LearningSkill is the golang structure for table learning_skill.
+type LearningSkill struct {
+	Id        int         `orm:"Id,primary" json:"id"`        // Id
+	Name      string      `orm:"Name"       json:"name"`      // 技能名称
+	CreatedAt *gtime.Time `orm:"CreatedAt"  json:"createdAt"` // 创建时间
+	UpdatedAt *gtime.Time `orm:"UpdatedAt"  json:"updatedAt"` // 更新时间
+	DeletedAt *gtime.Time `orm:"DeletedAt"  json:"deletedAt"` // 删除时间
+}

+ 12 - 0
model/learning/internal/learning_skill_instrument.go

@@ -0,0 +1,12 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+// LearningSkillInstrument is the golang structure for table learning_skill_instrument.
+type LearningSkillInstrument struct {
+	Id           int `orm:"Id,primary"   json:"id"`           // Id
+	SkillId      int `orm:"SkillId"      json:"skillId"`      // 技能 Id
+	InstrumentId int `orm:"InstrumentId" json:"instrumentId"` // 设备 Id
+}

+ 22 - 0
model/learning/internal/learning_testpaper.go

@@ -0,0 +1,22 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// LearningTestpaper is the golang structure for table learning_testpaper.
+type LearningTestpaper struct {
+	Id        int         `orm:"Id,primary" json:"id"`        // Id
+	SkillId   int         `orm:"SkillId"    json:"skillId"`   // 技能 Id
+	Name      string      `orm:"Name"       json:"name"`      // 试卷名称
+	Enable    int         `orm:"Enable"     json:"enable"`    // 是否启用
+	TimeLimit int         `orm:"TimeLimit"  json:"timeLimit"` // 答题时间/分钟
+	PassLimit int         `orm:"PassLimit"  json:"passLimit"` // 合格标准/题数
+	CreatedAt *gtime.Time `orm:"CreatedAt"  json:"createdAt"` // 创建时间
+	UpdatedAt *gtime.Time `orm:"UpdatedAt"  json:"updatedAt"` // 更新时间
+	DeletedAt *gtime.Time `orm:"DeletedAt"  json:"deletedAt"` // 删除时间
+}

+ 14 - 0
model/learning/learning_exam_record.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningExamRecord is the golang structure for table learning_exam_record.
+type LearningExamRecord internal.LearningExamRecord
+
+// Fill with you ideas below.

+ 14 - 0
model/learning/learning_learning_record.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningLearningRecord is the golang structure for table learning_learning_record.
+type LearningLearningRecord internal.LearningLearningRecord
+
+// Fill with you ideas below.

+ 14 - 0
model/learning/learning_material.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningMaterial is the golang structure for table learning_material.
+type LearningMaterial internal.LearningMaterial
+
+// Fill with you ideas below.

+ 14 - 0
model/learning/learning_question.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningQuestion is the golang structure for table learning_question.
+type LearningQuestion internal.LearningQuestion
+
+// Fill with you ideas below.

+ 14 - 0
model/learning/learning_question_testpaper.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningQuestionTestpaper is the golang structure for table learning_question_testpaper.
+type LearningQuestionTestpaper internal.LearningQuestionTestpaper
+
+// Fill with you ideas below.

+ 14 - 0
model/learning/learning_skill.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningSkill is the golang structure for table learning_skill.
+type LearningSkill internal.LearningSkill
+
+// Fill with you ideas below.

+ 14 - 0
model/learning/learning_skill_instrument.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningSkillInstrument is the golang structure for table learning_skill_instrument.
+type LearningSkillInstrument internal.LearningSkillInstrument
+
+// Fill with you ideas below.

+ 14 - 0
model/learning/learning_testpaper.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package learning
+
+import (
+	"lims_adapter/model/learning/internal"
+)
+
+// LearningTestpaper is the golang structure for table learning_testpaper.
+type LearningTestpaper internal.LearningTestpaper
+
+// Fill with you ideas below.

+ 7 - 0
sql/create.sql

@@ -30,6 +30,7 @@ CREATE TABLE `learning_skill_instrument` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
   `SkillId` int NOT NULL COMMENT '技能 Id',
   `InstrumentId` int NOT NULL COMMENT '设备 Id',
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技能设备绑定表';
 
 
@@ -45,6 +46,7 @@ CREATE TABLE `learning_material` (
   `CreatedAt` datetime COMMENT '创建时间',
   `UpdatedAt` datetime COMMENT '更新时间',
   `DeletedAt` datetime COMMENT '删除时间',
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='资料表';
 
 
@@ -60,6 +62,7 @@ CREATE TABLE `learning_question` (
   `CreatedAt` datetime COMMENT '创建时间',
   `UpdatedAt` datetime COMMENT '更新时间',
   `DeletedAt` datetime COMMENT '删除时间',
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='题目表';
 
 
@@ -73,6 +76,7 @@ CREATE TABLE `learning_testpaper` (
   `CreatedAt` datetime COMMENT '创建时间',
   `UpdatedAt` datetime COMMENT '更新时间',
   `DeletedAt` datetime COMMENT '删除时间',
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='试卷表';
 
 
@@ -80,6 +84,7 @@ CREATE TABLE `learning_question_testpaper` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
   `QuestionId` int NOT NULL COMMENT '题目 Id',
   `TestpaperId` int NOT NULL COMMENT '试卷 Id',
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='题目试卷绑定表';
 
 
@@ -92,6 +97,7 @@ CREATE TABLE `learning_exam_record` (
   `CreatedAt` datetime COMMENT '创建时间',
   `UpdatedAt` datetime COMMENT '更新时间',
   `DeletedAt` datetime COMMENT '删除时间',
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='考试记录表';
 
 
@@ -104,5 +110,6 @@ CREATE TABLE `learning_learning_record` (
   `CreatedAt` datetime COMMENT '创建时间',
   `UpdatedAt` datetime COMMENT '更新时间',
   `DeletedAt` datetime COMMENT '删除时间',
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学习记录表';