wangxingcheng пре 3 година
родитељ
комит
690610e045

+ 36 - 0
opms_parent/app/dao/base/base_distributor.go

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

+ 36 - 0
opms_parent/app/dao/base/base_distributor_contact.go

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

+ 459 - 0
opms_parent/app/dao/base/internal/base_distributor.go

@@ -0,0 +1,459 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model"
+)
+
+// BaseDistributorDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type BaseDistributorDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns baseDistributorColumns
+}
+
+// BaseDistributorColumns defines and stores column names for table base_distributor.
+type baseDistributorColumns struct {
+	Id            string // 主键
+	DistCode      string // 经销商编码
+	DistName      string // 经销商名称
+	AbbrName      string // 助记名
+	DistDesc      string // 经销商说明
+	DistBoss      string // 负责人
+	DistBossPhone string // 负责人电话
+	ProvinceId    string // 所属省份ID
+	ProvinceDesc  string // 所属省份
+	BusinessScope string // 业务范围
+	BelongSaleId  string // 归属销售ID
+	BelongSale    string // 归属销售
+	Capital       string // 注册资金
+	SaleNum       string // 销售人数
+	Remark        string // 备注
+	CreatedBy     string // 创建者
+	CreatedName   string // 创建人
+	CreatedTime   string // 创建时间
+	UpdatedBy     string // 更新者
+	UpdatedName   string // 更新人
+	UpdatedTime   string // 更新时间
+	DeletedTime   string // 删除时间
+}
+
+var (
+	// BaseDistributor is globally public accessible object for table base_distributor operations.
+	BaseDistributor = BaseDistributorDao{
+		M:     g.DB("default").Model("base_distributor").Safe(),
+		DB:    g.DB("default"),
+		Table: "base_distributor",
+		Columns: baseDistributorColumns{
+			Id:            "id",
+			DistCode:      "dist_code",
+			DistName:      "dist_name",
+			AbbrName:      "abbr_name",
+			DistDesc:      "dist_desc",
+			DistBoss:      "dist_boss",
+			DistBossPhone: "dist_boss_phone",
+			ProvinceId:    "province_id",
+			ProvinceDesc:  "province_desc",
+			BusinessScope: "business_scope",
+			BelongSaleId:  "belong_sale_id",
+			BelongSale:    "belong_sale",
+			Capital:       "capital",
+			SaleNum:       "sale_num",
+			Remark:        "remark",
+			CreatedBy:     "created_by",
+			CreatedName:   "created_name",
+			CreatedTime:   "created_time",
+			UpdatedBy:     "updated_by",
+			UpdatedName:   "updated_name",
+			UpdatedTime:   "updated_time",
+			DeletedTime:   "deleted_time",
+		},
+	}
+)
+
+func NewBaseDistributorDao(tenant string) BaseDistributorDao {
+	var dao BaseDistributorDao
+	dao = BaseDistributorDao{
+		M:     g.DB(tenant).Model("base_distributor").Safe(),
+		DB:    g.DB(tenant),
+		Table: "base_distributor",
+		Columns: baseDistributorColumns{
+			Id:            "id",
+			DistCode:      "dist_code",
+			DistName:      "dist_name",
+			AbbrName:      "abbr_name",
+			DistDesc:      "dist_desc",
+			DistBoss:      "dist_boss",
+			DistBossPhone: "dist_boss_phone",
+			ProvinceId:    "province_id",
+			ProvinceDesc:  "province_desc",
+			BusinessScope: "business_scope",
+			BelongSaleId:  "belong_sale_id",
+			BelongSale:    "belong_sale",
+			Capital:       "capital",
+			SaleNum:       "sale_num",
+			Remark:        "remark",
+			CreatedBy:     "created_by",
+			CreatedName:   "created_name",
+			CreatedTime:   "created_time",
+			UpdatedBy:     "updated_by",
+			UpdatedName:   "updated_name",
+			UpdatedTime:   "updated_time",
+			DeletedTime:   "deleted_time",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *BaseDistributorDao) Ctx(ctx context.Context) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *BaseDistributorDao) As(as string) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *BaseDistributorDao) TX(tx *gdb.TX) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *BaseDistributorDao) Master() *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Slave() *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *BaseDistributorDao) Args(args ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) LeftJoin(table ...string) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) RightJoin(table ...string) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) InnerJoin(table ...string) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Fields(fieldNamesOrMapStruct ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *BaseDistributorDao) Option(option int) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) OmitEmpty() *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *BaseDistributorDao) Filter() *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Where(where interface{}, args ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) WherePri(where interface{}, args ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *BaseDistributorDao) And(where interface{}, args ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *BaseDistributorDao) Or(where interface{}, args ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *BaseDistributorDao) Group(groupBy string) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *BaseDistributorDao) Order(orderBy ...string) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Limit(limit ...int) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Offset(offset int) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Page(page, limit int) *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *BaseDistributorDao) Batch(batch int) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Cache(duration time.Duration, name ...string) *BaseDistributorDao {
+	return &BaseDistributorDao{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 *BaseDistributorDao) Data(data ...interface{}) *BaseDistributorDao {
+	return &BaseDistributorDao{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.BaseDistributor.
+// 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 *BaseDistributorDao) All(where ...interface{}) ([]*model.BaseDistributor, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.BaseDistributor
+	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.BaseDistributor.
+// 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 *BaseDistributorDao) One(where ...interface{}) (*model.BaseDistributor, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.BaseDistributor
+	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 *BaseDistributorDao) FindOne(where ...interface{}) (*model.BaseDistributor, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.BaseDistributor
+	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 *BaseDistributorDao) FindAll(where ...interface{}) ([]*model.BaseDistributor, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.BaseDistributor
+	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 *BaseDistributorDao) 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 *BaseDistributorDao) 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 *BaseDistributorDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *BaseDistributorDao) Chunk(limit int, callback func(entities []*model.BaseDistributor, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.BaseDistributor
+		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 *BaseDistributorDao) LockUpdate() *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *BaseDistributorDao) LockShared() *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *BaseDistributorDao) Unscoped() *BaseDistributorDao {
+	return &BaseDistributorDao{M: d.M.Unscoped()}
+}

+ 438 - 0
opms_parent/app/dao/base/internal/base_distributor_contact.go

@@ -0,0 +1,438 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model"
+)
+
+// BaseDistributorContactDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type BaseDistributorContactDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns baseDistributorContactColumns
+}
+
+// BaseDistributorContactColumns defines and stores column names for table base_distributor_contact.
+type baseDistributorContactColumns struct {
+	Id          string // 主键
+	DistId      string // 所属经销商
+	Name        string // 姓名
+	Post        string // 岗位
+	Phone       string // 电话
+	Wechat      string // 微信
+	Mail        string // 邮箱
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
+}
+
+var (
+	// BaseDistributorContact is globally public accessible object for table base_distributor_contact operations.
+	BaseDistributorContact = BaseDistributorContactDao{
+		M:     g.DB("default").Model("base_distributor_contact").Safe(),
+		DB:    g.DB("default"),
+		Table: "base_distributor_contact",
+		Columns: baseDistributorContactColumns{
+			Id:          "id",
+			DistId:      "dist_id",
+			Name:        "name",
+			Post:        "post",
+			Phone:       "phone",
+			Wechat:      "wechat",
+			Mail:        "mail",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+)
+
+func NewBaseDistributorContactDao(tenant string) BaseDistributorContactDao {
+	var dao BaseDistributorContactDao
+	dao = BaseDistributorContactDao{
+		M:     g.DB(tenant).Model("base_distributor_contact").Safe(),
+		DB:    g.DB(tenant),
+		Table: "base_distributor_contact",
+		Columns: baseDistributorContactColumns{
+			Id:          "id",
+			DistId:      "dist_id",
+			Name:        "name",
+			Post:        "post",
+			Phone:       "phone",
+			Wechat:      "wechat",
+			Mail:        "mail",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *BaseDistributorContactDao) Ctx(ctx context.Context) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *BaseDistributorContactDao) As(as string) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *BaseDistributorContactDao) TX(tx *gdb.TX) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *BaseDistributorContactDao) Master() *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Slave() *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *BaseDistributorContactDao) Args(args ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) LeftJoin(table ...string) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) RightJoin(table ...string) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) InnerJoin(table ...string) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Fields(fieldNamesOrMapStruct ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *BaseDistributorContactDao) Option(option int) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) OmitEmpty() *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *BaseDistributorContactDao) Filter() *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Where(where interface{}, args ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) WherePri(where interface{}, args ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *BaseDistributorContactDao) And(where interface{}, args ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *BaseDistributorContactDao) Or(where interface{}, args ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *BaseDistributorContactDao) Group(groupBy string) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *BaseDistributorContactDao) Order(orderBy ...string) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Limit(limit ...int) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Offset(offset int) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Page(page, limit int) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *BaseDistributorContactDao) Batch(batch int) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Cache(duration time.Duration, name ...string) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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 *BaseDistributorContactDao) Data(data ...interface{}) *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{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.BaseDistributorContact.
+// 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 *BaseDistributorContactDao) All(where ...interface{}) ([]*model.BaseDistributorContact, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.BaseDistributorContact
+	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.BaseDistributorContact.
+// 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 *BaseDistributorContactDao) One(where ...interface{}) (*model.BaseDistributorContact, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.BaseDistributorContact
+	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 *BaseDistributorContactDao) FindOne(where ...interface{}) (*model.BaseDistributorContact, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.BaseDistributorContact
+	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 *BaseDistributorContactDao) FindAll(where ...interface{}) ([]*model.BaseDistributorContact, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.BaseDistributorContact
+	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 *BaseDistributorContactDao) 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 *BaseDistributorContactDao) 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 *BaseDistributorContactDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *BaseDistributorContactDao) Chunk(limit int, callback func(entities []*model.BaseDistributorContact, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.BaseDistributorContact
+		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 *BaseDistributorContactDao) LockUpdate() *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *BaseDistributorContactDao) LockShared() *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *BaseDistributorContactDao) Unscoped() *BaseDistributorContactDao {
+	return &BaseDistributorContactDao{M: d.M.Unscoped()}
+}

+ 31 - 0
opms_parent/app/handler/base/distributor.go

@@ -0,0 +1,31 @@
+package base
+
+import (
+	"context"
+
+	"dashoo.cn/common_definition/comm_def"
+	"dashoo.cn/opms_libary/myerrors"
+	"github.com/gogf/gf/frame/g"
+
+	model "dashoo.cn/micro/app/model/base"
+	server "dashoo.cn/micro/app/service/base"
+)
+
+type DistributorHandler struct{}
+
+// GetList 获取列表
+func (p *DistributorHandler) GetList(ctx context.Context, req *model.BaseDistributorSearchReq, rsp *comm_def.CommonMsg) error {
+	distributorServer, err := server.NewDistributorService(ctx)
+	if err != nil {
+		g.Log().Error(err)
+		return err
+	}
+	total, list, err := distributorServer.GetList(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		g.Log().Error(err)
+		return err
+	}
+	rsp.Data = g.Map{"list": list, "total": total}
+	return nil
+}

+ 24 - 0
opms_parent/app/handler/base/district.go

@@ -0,0 +1,24 @@
+package base
+
+import (
+	"context"
+
+	"dashoo.cn/common_definition/comm_def"
+	"github.com/gogf/gf/frame/g"
+
+	server "dashoo.cn/micro/app/service/base"
+)
+
+type DistrictHandler struct{}
+
+//GetList 区域列表
+func (d *DistrictHandler) GetList(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
+	districtServer, err := server.NewDistrictService(ctx)
+	if err != nil {
+		g.Log().Error(err)
+		return err
+	}
+	list := districtServer.ListToTree(int(req.Id))
+	rsp.Data = g.Map{"list": list}
+	return nil
+}

+ 44 - 0
opms_parent/app/model/base/base_distributor.go

@@ -0,0 +1,44 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package base
+
+import (
+	"dashoo.cn/opms_libary/request"
+	"github.com/gogf/gf/os/gtime"
+
+	"dashoo.cn/micro/app/model/base/internal"
+)
+
+// BaseDistributor is the golang structure for table base_distributor.
+type BaseDistributor internal.BaseDistributor
+
+// Fill with you ideas below.
+type BaseDistributorSearchReq struct {
+	DistCode   string `json:"distCode"`   // 经销商code
+	DistName   string `json:"distName"`   // 经销商名称
+	BelongSale string `json:"belongSale"` // 所属经销商
+	ProvinceId int    `json:"provinceId"` //  省份ID
+	request.PageReq
+}
+
+//列表返回字段
+type DistributorRonp struct {
+	Id            int         `orm:"id,primary"      json:"id"`            // 主健
+	DistCode      string      `orm:"dist_code"       json:"distCode"`      // 经销商编码
+	DistName      string      `orm:"dist_name"       json:"distName"`      // 经销商名字
+	AbbrName      string      `orm:"abbr_name"       json:"abbrName"`      // 助记名
+	DistBoss      string      `orm:"dist_boss"       json:"distBoss"`      // 负责人
+	DistBossPhone int         `orm:"dist_boss_phone" json:"distBossPhone"` // 负责人电话
+	BelongSale    string      `orm:"belong_sale"     json:"belongSale"`    // 销售
+	ProvinceDesc  string      `orm:"province_desc"   json:"provinceDesc"`  // 省份描述
+	BusinessScope string      `orm:"business_scope"  json:"businessScope"` // 业务范围
+	CreatedName   string      `orm:"created_name"    json:"createdName"`   // 创建人名字
+	CreatedTime   *gtime.Time `orm:"created_time"    json:"createdTime"`   // 创建时间
+	//District      *BaseDistrict `orm:"with:id=province_id"`
+	//*Contanct
+}
+type Contanct struct {
+	Name string `json:"name"` // 销售名
+}

+ 14 - 0
opms_parent/app/model/base/base_distributor_contact.go

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

+ 13 - 0
opms_parent/app/model/base/base_district.go

@@ -5,6 +5,8 @@
 package base
 
 import (
+	"dashoo.cn/opms_libary/request"
+
 	"dashoo.cn/micro/app/model/base/internal"
 )
 
@@ -12,3 +14,14 @@ import (
 type BaseDistrict internal.BaseDistrict
 
 // Fill with you ideas below.
+type BaseDistrictSearchReq struct {
+	Id int `json:"id"` //  省份ID
+	request.PageReq
+}
+
+type T struct {
+	Id       int    `json:"id"`
+	ParentId int    `json:"parentId"`
+	DistName string `json:"distName" `
+	Children []*T   `json:"children"`
+}

+ 35 - 0
opms_parent/app/model/base/internal/base_distributor.go

@@ -0,0 +1,35 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// BaseDistributor is the golang structure for table base_distributor.
+type BaseDistributor struct {
+	Id            int         `orm:"id,primary"      json:"id"`            // 主键
+	DistCode      string      `orm:"dist_code"       json:"distCode"`      // 经销商编码
+	DistName      string      `orm:"dist_name"       json:"distName"`      // 经销商名称
+	AbbrName      string      `orm:"abbr_name"       json:"abbrName"`      // 助记名
+	DistDesc      string      `orm:"dist_desc"       json:"distDesc"`      // 经销商说明
+	DistBoss      string      `orm:"dist_boss"       json:"distBoss"`      // 负责人
+	DistBossPhone string      `orm:"dist_boss_phone" json:"distBossPhone"` // 负责人电话
+	ProvinceId    int         `orm:"province_id"     json:"provinceId"`    // 所属省份ID
+	ProvinceDesc  string      `orm:"province_desc"   json:"provinceDesc"`  // 所属省份
+	BusinessScope string      `orm:"business_scope"  json:"businessScope"` // 业务范围
+	BelongSaleId  int         `orm:"belong_sale_id"  json:"belongSaleId"`  // 归属销售ID
+	BelongSale    string      `orm:"belong_sale"     json:"belongSale"`    // 归属销售
+	Capital       float64     `orm:"capital"         json:"capital"`       // 注册资金
+	SaleNum       int         `orm:"sale_num"        json:"saleNum"`       // 销售人数
+	Remark        string      `orm:"remark"          json:"remark"`        // 备注
+	CreatedBy     int         `orm:"created_by"      json:"createdBy"`     // 创建者
+	CreatedName   string      `orm:"created_name"    json:"createdName"`   // 创建人
+	CreatedTime   *gtime.Time `orm:"created_time"    json:"createdTime"`   // 创建时间
+	UpdatedBy     int         `orm:"updated_by"      json:"updatedBy"`     // 更新者
+	UpdatedName   string      `orm:"updated_name"    json:"updatedName"`   // 更新人
+	UpdatedTime   *gtime.Time `orm:"updated_time"    json:"updatedTime"`   // 更新时间
+	DeletedTime   *gtime.Time `orm:"deleted_time"    json:"deletedTime"`   // 删除时间
+}

+ 28 - 0
opms_parent/app/model/base/internal/base_distributor_contact.go

@@ -0,0 +1,28 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// BaseDistributorContact is the golang structure for table base_distributor_contact.
+type BaseDistributorContact struct {
+	Id          int         `orm:"id,primary"   json:"id"`          // 主键
+	DistId      int         `orm:"dist_id"      json:"distId"`      // 所属经销商
+	Name        string      `orm:"name"         json:"name"`        // 姓名
+	Post        string      `orm:"post"         json:"post"`        // 岗位
+	Phone       string      `orm:"phone"        json:"phone"`       // 电话
+	Wechat      string      `orm:"wechat"       json:"wechat"`      // 微信
+	Mail        string      `orm:"mail"         json:"mail"`        // 邮箱
+	Remark      string      `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+}

+ 57 - 0
opms_parent/app/service/base/base_distributor.go

@@ -0,0 +1,57 @@
+package base
+
+import (
+	"context"
+
+	"github.com/gogf/gf/errors/gerror"
+	"github.com/gogf/gf/frame/g"
+
+	"dashoo.cn/micro/app/dao/base"
+	model "dashoo.cn/micro/app/model/base"
+	"dashoo.cn/micro/app/service"
+)
+
+type distributorService struct {
+	*service.ContextService
+
+	Dao *base.BaseDistributorDao
+}
+
+func NewDistributorService(ctx context.Context) (svc *distributorService, err error) {
+	svc = new(distributorService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = base.NewBaseDistributorDao(svc.Tenant)
+	return svc, nil
+}
+
+//经销商信息列表 distributorList []*model.BaseDistributorRonp
+func (d *distributorService) GetList(req *model.BaseDistributorSearchReq) (total int, distributorList []*model.DistributorRonp, err error) {
+	distributorModel := d.Dao.M
+	if req.DistCode != "" {
+		distributorModel = distributorModel.Where("u.dist_code", req.DistCode)
+	}
+	if req.DistName != "" {
+		distributorModel = distributorModel.Where("dist_name like ?", "%"+req.DistName+"%")
+	}
+	if req.BelongSale != "" {
+		distributorModel = distributorModel.Where("belong_sale like ?", "%"+req.BelongSale+"%")
+	}
+	if req.ProvinceId != 0 {
+		distributorModel = distributorModel.Where("province_id ", req.ProvinceId)
+	}
+	g.Log().Info("搜索条件", req.BelongSale)
+	total, err = distributorModel.Count()
+	if err != nil {
+		g.Log().Error(err)
+		err = gerror.New("获取总行数失败")
+		return
+	}
+	if req.PageNum == 0 {
+		req.PageNum = 1
+	}
+	err = distributorModel.Page(req.PageNum, req.PageSize).Order("id desc").Scan(&distributorList)
+	g.Log().Info("返回列表", distributorList)
+	return
+}

+ 3 - 0
opms_parent/main.go

@@ -17,6 +17,9 @@ func main() {
 	// 创建总服务包
 	s := micro_srv.CreateAndInitService(basePath)
 	s.RegisterName("Product", new(base.ProductHandler), "")
+	s.RegisterName("Distributor", new(base.DistributorHandler), "")
+	s.RegisterName("District", new(base.DistrictHandler), "")
+	s.RegisterName("Customer", new(cust.CustomerHeader), "")
 	s.RegisterName("Customer", new(cust.CustomerHeader), "")
 
 	// 注册服务对象