Browse Source

feature(项目管理):优化逻辑

ZZH-wl 2 years ago
parent
commit
67c761d53e

+ 680 - 0
opms_admin/app/dao/internal/sys_message_log.go

@@ -0,0 +1,680 @@
+// ==========================================================================
+// 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"
+	"github.com/gogf/gf/util/gconv"
+	"time"
+
+	"dashoo.cn/micro/app/model"
+)
+
+// SysMessageLogDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type SysMessageLogDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns sysMessageLogColumns
+}
+
+// SysMessageLogColumns defines and stores column names for table sys_message_log.
+type sysMessageLogColumns struct {
+	Id       string // 主键
+	MsgId    string // 关联消息
+	UserId   string // 关联用户
+	IsRead   string // 是否已读(10否20是)
+	ReadTime string // 已读时间
+}
+
+var (
+	// SysMessageLog is globally public accessible object for table sys_message_log operations.
+	SysMessageLog = SysMessageLogDao{
+		M:     g.DB("default").Model("sys_message_log").Safe(),
+		DB:    g.DB("default"),
+		Table: "sys_message_log",
+		Columns: sysMessageLogColumns{
+			Id:       "id",
+			MsgId:    "msg_id",
+			UserId:   "user_id",
+			IsRead:   "is_read",
+			ReadTime: "read_time",
+		},
+	}
+)
+
+func NewSysMessageLogDao(tenant string) SysMessageLogDao {
+	var dao SysMessageLogDao
+	dao = SysMessageLogDao{
+		M:     g.DB(tenant).Model("sys_message_log").Safe(),
+		DB:    g.DB(tenant),
+		Table: "sys_message_log",
+		Columns: sysMessageLogColumns{
+			Id:       "id",
+			MsgId:    "msg_id",
+			UserId:   "user_id",
+			IsRead:   "is_read",
+			ReadTime: "read_time",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *SysMessageLogDao) Ctx(ctx context.Context) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Ctx(ctx)}
+}
+
+// GetCtx returns the context for current Model.
+// It returns "context.Background() i"s there's no context previously set.
+func (d *SysMessageLogDao) GetCtx() context.Context {
+	return d.M.GetCtx()
+}
+
+// As sets an alias name for current table.
+func (d *SysMessageLogDao) As(as string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *SysMessageLogDao) TX(tx *gdb.TX) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *SysMessageLogDao) Master() *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) Slave() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *SysMessageLogDao) Args(args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Args(args...)}
+}
+
+// Handler calls each of "handlers" on current Model and returns a new Model.
+// ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
+func (d *SysMessageLogDao) Handler(handlers ...gdb.ModelHandler) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Handler(handlers...)}
+}
+
+// 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 *SysMessageLogDao) LeftJoin(table ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) RightJoin(table ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) InnerJoin(table ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) Fields(fieldNamesOrMapStruct ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
+func (d *SysMessageLogDao) FieldCount(column string, as ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.FieldCount(column, as...)}
+}
+
+// FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
+func (d *SysMessageLogDao) FieldSum(column string, as ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.FieldSum(column, as...)}
+}
+
+// FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
+func (d *SysMessageLogDao) FieldMin(column string, as ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.FieldMin(column, as...)}
+}
+
+// FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
+func (d *SysMessageLogDao) FieldMax(column string, as ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.FieldMax(column, as...)}
+}
+
+// FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
+func (d *SysMessageLogDao) FieldAvg(column string, as ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.FieldAvg(column, as...)}
+}
+
+// Option adds extra operation option for the model.
+// Deprecated, use separate operations instead.
+func (d *SysMessageLogDao) Option(option int) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) OmitEmpty() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OmitEmpty()}
+}
+
+// OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
+// the Where/Having parameters for "empty" values.
+func (d *SysMessageLogDao) OmitEmptyWhere() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OmitEmptyWhere()}
+}
+
+// OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
+// the Data parameters for "empty" values.
+func (d *SysMessageLogDao) OmitEmptyData() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OmitEmptyData()}
+}
+
+// OmitNil sets optionOmitNil option for the model, which automatically filers
+// the data and where parameters for "nil" values.
+func (d *SysMessageLogDao) OmitNil() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OmitNil()}
+}
+
+// OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
+// the Where/Having parameters for "nil" values.
+func (d *SysMessageLogDao) OmitNilWhere() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OmitNilWhere()}
+}
+
+// OmitNilData sets optionOmitNilData option for the model, which automatically filers
+// the Data parameters for "nil" values.
+func (d *SysMessageLogDao) OmitNilData() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OmitNilData()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+// Note that this function supports only single table operations.
+// Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
+func (d *SysMessageLogDao) Filter() *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) Where(where interface{}, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) WherePri(where interface{}, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WherePri(where, args...)}
+}
+
+// Having sets the having statement for the model.
+// The parameters of this function usage are as the same as function Where.
+// See Where.
+func (d *SysMessageLogDao) Having(having interface{}, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Having(having, args...)}
+}
+
+// Wheref builds condition string using fmt.Sprintf and arguments.
+// Note that if the number of "args" is more than the place holder in "format",
+// the extra "args" will be used as the where condition arguments of the Model.
+func (d *SysMessageLogDao) Wheref(format string, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Wheref(format, args...)}
+}
+
+// WhereLT builds "column < value" statement.
+func (d *SysMessageLogDao) WhereLT(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereLT(column, value)}
+}
+
+// WhereLTE builds "column <= value" statement.
+func (d *SysMessageLogDao) WhereLTE(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereLTE(column, value)}
+}
+
+// WhereGT builds "column > value" statement.
+func (d *SysMessageLogDao) WhereGT(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereGT(column, value)}
+}
+
+// WhereGTE builds "column >= value" statement.
+func (d *SysMessageLogDao) WhereGTE(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereGTE(column, value)}
+}
+
+// WhereBetween builds "column BETWEEN min AND max" statement.
+func (d *SysMessageLogDao) WhereBetween(column string, min, max interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereBetween(column, min, max)}
+}
+
+// WhereLike builds "column LIKE like" statement.
+func (d *SysMessageLogDao) WhereLike(column string, like interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereLike(column, like)}
+}
+
+// WhereIn builds "column IN (in)" statement.
+func (d *SysMessageLogDao) WhereIn(column string, in interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereIn(column, in)}
+}
+
+// WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
+func (d *SysMessageLogDao) WhereNull(columns ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereNull(columns...)}
+}
+
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
+func (d *SysMessageLogDao) WhereNotBetween(column string, min, max interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereNotBetween(column, min, max)}
+}
+
+// WhereNotLike builds "column NOT LIKE like" statement.
+func (d *SysMessageLogDao) WhereNotLike(column string, like interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereNotLike(column, like)}
+}
+
+// WhereNot builds "column != value" statement.
+func (d *SysMessageLogDao) WhereNot(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereNot(column, value)}
+}
+
+// WhereNotIn builds "column NOT IN (in)" statement.
+func (d *SysMessageLogDao) WhereNotIn(column string, in interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereNotIn(column, in)}
+}
+
+// WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
+func (d *SysMessageLogDao) WhereNotNull(columns ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereNotNull(columns...)}
+}
+
+// WhereOr adds "OR" condition to the where statement.
+func (d *SysMessageLogDao) WhereOr(where interface{}, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOr(where, args...)}
+}
+
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
+func (d *SysMessageLogDao) WhereOrf(format string, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrf(format, args...)}
+}
+
+// WhereOrLT builds "column < value" statement in "OR" conditions..
+func (d *SysMessageLogDao) WhereOrLT(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrLT(column, value)}
+}
+
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
+func (d *SysMessageLogDao) WhereOrLTE(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrLTE(column, value)}
+}
+
+// WhereOrGT builds "column > value" statement in "OR" conditions..
+func (d *SysMessageLogDao) WhereOrGT(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrGT(column, value)}
+}
+
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
+func (d *SysMessageLogDao) WhereOrGTE(column string, value interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrGTE(column, value)}
+}
+
+// WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
+func (d *SysMessageLogDao) WhereOrBetween(column string, min, max interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrBetween(column, min, max)}
+}
+
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
+func (d *SysMessageLogDao) WhereOrLike(column string, like interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrLike(column, like)}
+}
+
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
+func (d *SysMessageLogDao) WhereOrIn(column string, in interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrIn(column, in)}
+}
+
+// WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
+func (d *SysMessageLogDao) WhereOrNull(columns ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrNull(columns...)}
+}
+
+// WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
+func (d *SysMessageLogDao) WhereOrNotBetween(column string, min, max interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrNotBetween(column, min, max)}
+}
+
+// WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
+func (d *SysMessageLogDao) WhereOrNotLike(column string, like interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrNotLike(column, like)}
+}
+
+// WhereOrNotIn builds "column NOT IN (in)" statement.
+func (d *SysMessageLogDao) WhereOrNotIn(column string, in interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrNotIn(column, in)}
+}
+
+// WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
+func (d *SysMessageLogDao) WhereOrNotNull(columns ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.WhereOrNotNull(columns...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *SysMessageLogDao) Group(groupBy ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Group(groupBy...)}
+}
+
+// And adds "AND" condition to the where statement.
+// Deprecated, use Where instead.
+func (d *SysMessageLogDao) And(where interface{}, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+// Deprecated, use WhereOr instead.
+func (d *SysMessageLogDao) Or(where interface{}, args ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Or(where, args...)}
+}
+
+// GroupBy sets the "GROUP BY" statement for the model.
+func (d *SysMessageLogDao) GroupBy(groupBy string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *SysMessageLogDao) Order(orderBy ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Order(orderBy...)}
+}
+
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
+func (d *SysMessageLogDao) OrderAsc(column string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OrderAsc(column)}
+}
+
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
+func (d *SysMessageLogDao) OrderDesc(column string) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OrderDesc(column)}
+}
+
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
+func (d *SysMessageLogDao) OrderRandom() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.OrderRandom()}
+}
+
+// OrderBy is alias of Model.Order.
+// See Model.Order.
+// Deprecated, use Order instead.
+func (d *SysMessageLogDao) OrderBy(orderBy string) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) Limit(limit ...int) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) Offset(offset int) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Offset(offset)}
+}
+
+// Distinct forces the query to only return distinct results.
+func (d *SysMessageLogDao) Distinct() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Distinct()}
+}
+
+// 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 *SysMessageLogDao) Page(page, limit int) *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *SysMessageLogDao) Batch(batch int) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) Cache(duration time.Duration, name ...string) *SysMessageLogDao {
+	return &SysMessageLogDao{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 *SysMessageLogDao) Data(data ...interface{}) *SysMessageLogDao {
+	return &SysMessageLogDao{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.SysMessageLog.
+// 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 *SysMessageLogDao) All(where ...interface{}) ([]*model.SysMessageLog, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysMessageLog
+	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.SysMessageLog.
+// 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 *SysMessageLogDao) One(where ...interface{}) (*model.SysMessageLog, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysMessageLog
+	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 *SysMessageLogDao) FindOne(where ...interface{}) (*model.SysMessageLog, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysMessageLog
+	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 *SysMessageLogDao) FindAll(where ...interface{}) ([]*model.SysMessageLog, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysMessageLog
+	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 *SysMessageLogDao) 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 *SysMessageLogDao) 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 *SysMessageLogDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *SysMessageLogDao) Chunk(limit int, callback func(entities []*model.SysMessageLog, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.SysMessageLog
+		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 *SysMessageLogDao) LockUpdate() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *SysMessageLogDao) LockShared() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *SysMessageLogDao) Unscoped() *SysMessageLogDao {
+	return &SysMessageLogDao{M: d.M.Unscoped()}
+}
+
+// DataScope enables the DataScope feature.
+func (d *SysMessageLogDao) DataScope(userCol ...string) *SysMessageLogDao {
+	ctx := d.GetCtx().Value("contextService")
+	dataScope := gconv.Map(ctx)["dataScope"].(g.Map)
+	if dataScope != nil {
+		if userIds, ok := dataScope["userIds"]; ok {
+			column := "created_by"
+			if len(userCol) == 1 {
+				column = userCol[0]
+			}
+			delete(dataScope, "userIds")
+			dataScope[column] = userIds
+		}
+		return &SysMessageLogDao{M: d.M.Where(dataScope)}
+	}
+	return d
+}

+ 36 - 0
opms_admin/app/dao/sys_message_log.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/internal"
+)
+
+// sysMessageLogDao 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 sysMessageLogDao struct {
+	internal.SysMessageLogDao
+}
+
+var (
+	// SysMessageLog is globally public accessible object for table sys_message_log operations.
+	SysMessageLog = sysMessageLogDao{
+		internal.SysMessageLog,
+	}
+)
+
+type SysMessageLogDao struct {
+	internal.SysMessageLogDao
+}
+
+func NewSysMessageLogDao(tenant string) *SysMessageLogDao {
+	dao := internal.NewSysMessageLogDao(tenant)
+	return &SysMessageLogDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 18 - 0
opms_admin/app/model/internal/sys_message_log.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"
+)
+
+// SysMessageLog is the golang structure for table sys_message_log.
+type SysMessageLog struct {
+	Id       int         `orm:"id,primary" json:"id"`       // 主键
+	MsgId    int         `orm:"msg_id"     json:"msgId"`    // 关联消息
+	UserId   int         `orm:"user_id"    json:"userId"`   // 关联用户
+	IsRead   string      `orm:"is_read"    json:"isRead"`   // 是否已读(10否20是)
+	ReadTime *gtime.Time `orm:"read_time"  json:"readTime"` // 已读时间
+}

+ 14 - 0
opms_admin/app/model/sys_message_log.go

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

+ 21 - 25
opms_parent/app/service/proj/business.go

@@ -315,7 +315,7 @@ func (p *businessService) DeleteByIds(ids []int64) (err error) {
 
 // BusinessTransfer 项目转移
 func (p *businessService) BusinessTransfer(req *model.BusinessTransferReq) error {
-	business, err := p.Dao.WherePri(req.Id).Where(p.Dao.Columns.ApproStatus, ApprovalNotSubmit).One()
+	business, err := p.Dao.WherePri(req.Id).WhereNot(p.Dao.Columns.ApproStatus, ApprovalWaiting).One()
 	if err != nil {
 		return err
 	}
@@ -429,8 +429,6 @@ func (p *businessService) BusinessTransferNotify(flow *workflowModel.PlatWorkflo
 		data[p.Dao.Columns.ApproStatus] = ApprovalRejection
 	}
 	if msg.ProcessType == "finish" && msg.Result == "agree" {
-		data[p.Dao.Columns.NboType] = StatusReserve
-		data[p.Dao.Columns.ApproStatus] = ApprovalOK
 		// 从项目动态内获取变更信息
 		var transferDynamics model.ProjBusinessDynamics
 		dynamicsDao := projDao.NewProjBusinessDynamicsDao(p.Tenant).Where(projDao.ProjBusinessDynamics.Columns.BusId, business.Id)
@@ -442,12 +440,14 @@ func (p *businessService) BusinessTransferNotify(flow *workflowModel.PlatWorkflo
 		data[p.Dao.Columns.SaleId] = changeData["saleId"]
 		data[p.Dao.Columns.SaleName] = changeData["saleName"]
 		data[p.Dao.Columns.Remark] = changeData["remark"]
-
+		data[p.Dao.Columns.ApproStatus] = ApprovalOK
 	}
 
 	// 项目修改
 	_, err = p.Dao.WherePri(business.Id).Data(data).Update()
-
+	if err != nil {
+		return err
+	}
 	// 添加项目动态
 	dynamics := model.ProjBusinessDynamics{
 		BusId:   business.Id,
@@ -462,7 +462,7 @@ func (p *businessService) BusinessTransferNotify(flow *workflowModel.PlatWorkflo
 
 // BusinessGradation 项目调级
 func (p *businessService) BusinessGradation(busId int, nboType, busType string) (*model.ProjBusiness, error) {
-	business, err := p.Dao.WherePri(busId).Where(p.Dao.Columns.ApproStatus, ApprovalNotSubmit).One()
+	business, err := p.Dao.WherePri(busId).WhereNot(p.Dao.Columns.ApproStatus, ApprovalWaiting).One()
 	if err != nil {
 		return nil, err
 	}
@@ -626,19 +626,16 @@ func (p *businessService) BusinessUpgradeNotify(flow *workflowModel.PlatWorkflow
 		if err != nil {
 			return err
 		}
-
-		data = utils.MapKeySnakeCamelCase(gconv.Map(transferDynamics.OpnContent), "snake")
-		delete(data, "orig_nbo_type")
-		delete(data, "updated_by")
-		delete(data, "updated_name")
-		delete(data, "updated_time")
-		data[p.Dao.Columns.NboType] = StatusReserve
+		updateData := new(model.BusinessUpgradeReq)
+		data = gconv.Map(gconv.Struct(transferDynamics.OpnContent, updateData))
 		data[p.Dao.Columns.ApproStatus] = ApprovalOK
 	}
 
 	// 项目修改
 	_, err = p.Dao.WherePri(business.Id).Data(data).Update()
-
+	if err != nil {
+		return err
+	}
 	// 添加项目动态
 	dynamics := model.ProjBusinessDynamics{
 		BusId:   business.Id,
@@ -775,8 +772,6 @@ func (p *businessService) BusinessDowngradeNotify(flow *workflowModel.PlatWorkfl
 		data[p.Dao.Columns.ApproStatus] = ApprovalRejection
 	}
 	if msg.ProcessType == "finish" && msg.Result == "agree" {
-		data[p.Dao.Columns.NboType] = StatusReserve
-		data[p.Dao.Columns.ApproStatus] = ApprovalOK
 		// 从项目动态内获取变更信息
 		transferDynamics := new(model.ProjBusinessDynamics)
 		dynamicsDao := projDao.NewProjBusinessDynamicsDao(p.Tenant).Where(projDao.ProjBusinessDynamics.Columns.BusId, business.Id)
@@ -784,17 +779,16 @@ func (p *businessService) BusinessDowngradeNotify(flow *workflowModel.PlatWorkfl
 		if err != nil {
 			return err
 		}
-		changeData := gconv.Map(transferDynamics.OpnContent)
-		data[p.Dao.Columns.NboType] = changeData["nboType"]
-		data[p.Dao.Columns.TechnicalSupportName] = changeData["technicalSupportName"]
-		data[p.Dao.Columns.TechnicalSupportContent] = changeData["technicalSupportContent"]
-		data[p.Dao.Columns.TechnicalSupportTime] = changeData["technicalSupportTime"]
-		data[p.Dao.Columns.Remark] = changeData["remark"]
+		updateData := new(model.BusinessDowngradeReq)
+		data = gconv.Map(gconv.Struct(transferDynamics.OpnContent, updateData))
+		data[p.Dao.Columns.ApproStatus] = ApprovalOK
 	}
 
 	// 项目修改
 	_, err = p.Dao.WherePri(business.Id).Data(data).Update()
-
+	if err != nil {
+		return err
+	}
 	// 添加项目动态
 	dynamics := model.ProjBusinessDynamics{
 		BusId:   business.Id,
@@ -903,7 +897,7 @@ func (p *businessService) CreateProjBusinessDynamics(tx *gdb.TX, dynamics model.
 
 // ConvertToReserve 转为储备项目
 func (p *businessService) ConvertToReserve(req *model.BusinessToReserveReq) error {
-	business, err := p.Dao.WherePri(req.Id).Where(p.Dao.Columns.ApproStatus, ApprovalNotSubmit).One()
+	business, err := p.Dao.WherePri(req.Id).WhereNot(p.Dao.Columns.ApproStatus, ApprovalWaiting).One()
 	if err != nil {
 		return err
 	}
@@ -1003,7 +997,9 @@ func (p *businessService) ConvertToReserveNotify(flow *workflowModel.PlatWorkflo
 
 	// 项目修改
 	_, err = p.Dao.WherePri(business.Id).Data(data).Update()
-
+	if err != nil {
+		return err
+	}
 	// 添加项目动态
 	dynamics := model.ProjBusinessDynamics{
 		BusId:   business.Id,