examples

package
v0.0.0-...-61829c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomerG7DBFieldAndStructFieldRelate = map[string]string{
	"F_customer_id":  "CustomerID",
	"F_g7s_org_code": "G7sOrgCode",
	"F_g7s_user_id":  "G7sUserID",
	"F_create_time":  "CreateTime",
	"F_update_time":  "UpdateTime",
	"F_enabled":      "Enabled",
}
View Source
var CustomerG7StructFieldAndDBFieldRelate = map[string]string{
	"CustomerID": "F_customer_id",
	"G7sOrgCode": "F_g7s_org_code",
	"G7sUserID":  "F_g7s_user_id",
	"CreateTime": "F_create_time",
	"UpdateTime": "F_update_time",
	"Enabled":    "F_enabled",
}
View Source
var DBTable = mysql.NewDBTable()
View Source
var PhysicsDeleteByUniquustomerG7DBFieldAndStructFieldRelate = map[string]string{
	"F_g7s_user_id":  "G7sUserID",
	"F_customer_id":  "CustomerID",
	"F_g7s_org_code": "G7sOrgCode",
	"F_create_time":  "CreateTime",
	"F_update_time":  "UpdateTime",
	"F_enabled":      "Enabled",
}
View Source
var PhysicsDeleteByUniquustomerG7StructFieldAndDBFieldRelate = map[string]string{
	"G7sUserID":  "F_g7s_user_id",
	"CustomerID": "F_customer_id",
	"G7sOrgCode": "F_g7s_org_code",
	"CreateTime": "F_create_time",
	"UpdateTime": "F_update_time",
	"Enabled":    "F_enabled",
}
View Source
var UserDBFieldAndStructFieldRelate = map[string]string{
	"F_id":          "Id",
	"F_phone":       "Phone",
	"F_user_id":     "UserID",
	"F_name":        "Name",
	"F_city_id":     "CityID",
	"F_area_id":     "AreaID",
	"F_enabled":     "Enabled",
	"F_create_time": "CreateTime",
	"F_update_time": "UpdateTime",
}
View Source
var UserStructFieldAndDBFieldRelate = map[string]string{
	"Id":         "F_id",
	"Phone":      "F_phone",
	"UserID":     "F_user_id",
	"Name":       "F_name",
	"CityID":     "F_city_id",
	"AreaID":     "F_area_id",
	"Enabled":    "F_enabled",
	"CreateTime": "F_create_time",
	"UpdateTime": "F_update_time",
}

Functions

This section is empty.

Types

type CustomerG7

type CustomerG7 struct {
	// 客户id
	CustomerID uint64 `` /* 136-byte string literal not displayed */
	// g7s机构
	G7sOrgCode string `json:"orgCode" gorm:"primary_key;column:F_g7s_org_code" sql:"type:varchar(32);not null"`
	// g7s用户id
	G7sUserID string `json:"userID,string" gorm:"primary_key;column:F_g7s_user_id" sql:"type:varchar(32);not null;unique_index:I_user_customer[0]"`
	// 记录创建时间
	CreateTime timelib.MySQLTimestamp `json:"createTime" gorm:"column:F_create_time" sql:"type:bigint(64);not null;index:I_create_time"`
	// 记录更新时间
	UpdateTime timelib.MySQLTimestamp `json:"updateTime" gorm:"column:F_update_time" sql:"type:bigint(64);not null;index:I_update_time"`
	Enabled    enumeration.Bool       `` /* 126-byte string literal not displayed */
}

func (*CustomerG7) Create

func (cg *CustomerG7) Create(db *gorm.DB) error

func (*CustomerG7) CreateOnDuplicateWithUpdateFields

func (cg *CustomerG7) CreateOnDuplicateWithUpdateFields(db *gorm.DB, updateFields []string) error

CreateOnDuplicateWithUpdateFields only update the no unique index field, it return error if updateFields contain unique index field. It doesn't update the Enabled and CreateTime field.

func (CustomerG7) DBField

func (cg CustomerG7) DBField() *CustomerG7DBFieldData

func (*CustomerG7) DeleteByCustomerIDAndG7sOrgCodeAndG7sUserID

func (cg *CustomerG7) DeleteByCustomerIDAndG7sOrgCodeAndG7sUserID(db *gorm.DB) error

func (*CustomerG7) DeleteByG7sUserIDAndCustomerID

func (cg *CustomerG7) DeleteByG7sUserIDAndCustomerID(db *gorm.DB) error

func (*CustomerG7) FetchByCustomerIDAndG7sOrgCodeAndG7sUserID

func (cg *CustomerG7) FetchByCustomerIDAndG7sOrgCodeAndG7sUserID(db *gorm.DB) error

func (*CustomerG7) FetchByCustomerIDAndG7sOrgCodeAndG7sUserIDForUpdate

func (cg *CustomerG7) FetchByCustomerIDAndG7sOrgCodeAndG7sUserIDForUpdate(db *gorm.DB) error

func (*CustomerG7) FetchByG7sUserIDAndCustomerID

func (cg *CustomerG7) FetchByG7sUserIDAndCustomerID(db *gorm.DB) error

func (*CustomerG7) FetchByG7sUserIDAndCustomerIDForUpdate

func (cg *CustomerG7) FetchByG7sUserIDAndCustomerIDForUpdate(db *gorm.DB) error

func (*CustomerG7) SoftDeleteByCustomerIDAndG7sOrgCodeAndG7sUserID

func (cg *CustomerG7) SoftDeleteByCustomerIDAndG7sOrgCodeAndG7sUserID(db *gorm.DB) error

func (*CustomerG7) SoftDeleteByG7sUserIDAndCustomerID

func (cg *CustomerG7) SoftDeleteByG7sUserIDAndCustomerID(db *gorm.DB) error

func (CustomerG7) TableName

func (cg CustomerG7) TableName() string

func (*CustomerG7) UpdateByCustomerIDAndG7sOrgCodeAndG7sUserIDWithMap

func (cg *CustomerG7) UpdateByCustomerIDAndG7sOrgCodeAndG7sUserIDWithMap(db *gorm.DB, updateMap map[string]interface{}) error

func (*CustomerG7) UpdateByCustomerIDAndG7sOrgCodeAndG7sUserIDWithStruct

func (cg *CustomerG7) UpdateByCustomerIDAndG7sOrgCodeAndG7sUserIDWithStruct(db *gorm.DB) error

func (*CustomerG7) UpdateByG7sUserIDAndCustomerIDWithMap

func (cg *CustomerG7) UpdateByG7sUserIDAndCustomerIDWithMap(db *gorm.DB, updateMap map[string]interface{}) error

func (*CustomerG7) UpdateByG7sUserIDAndCustomerIDWithStruct

func (cg *CustomerG7) UpdateByG7sUserIDAndCustomerIDWithStruct(db *gorm.DB) error

type CustomerG7DBFieldData

type CustomerG7DBFieldData struct {
	CustomerID string
	G7sOrgCode string
	G7sUserID  string
	CreateTime string
	UpdateTime string
	Enabled    string
}

func (*CustomerG7DBFieldData) FetchNoneUniqueIndexFields

func (cgdbfd *CustomerG7DBFieldData) FetchNoneUniqueIndexFields() []string

FetchNoneUniqueIndexFields without Enabled and CreateTime field.

type CustomerG7List

type CustomerG7List []CustomerG7

func (*CustomerG7List) BatchFetchByCreateTimeList

func (cgl *CustomerG7List) BatchFetchByCreateTimeList(db *gorm.DB, createTimeList []timelib.MySQLTimestamp) error

func (*CustomerG7List) BatchFetchByCustomerIDList

func (cgl *CustomerG7List) BatchFetchByCustomerIDList(db *gorm.DB, customerIDList []uint64) error

func (*CustomerG7List) BatchFetchByG7sUserIDList

func (cgl *CustomerG7List) BatchFetchByG7sUserIDList(db *gorm.DB, g7sUserIDList []string) error

func (*CustomerG7List) BatchFetchByUpdateTimeList

func (cgl *CustomerG7List) BatchFetchByUpdateTimeList(db *gorm.DB, updateTimeList []timelib.MySQLTimestamp) error

func (*CustomerG7List) FetchByCreateTime

func (cgl *CustomerG7List) FetchByCreateTime(db *gorm.DB, createTime timelib.MySQLTimestamp) error

func (*CustomerG7List) FetchByCustomerID

func (cgl *CustomerG7List) FetchByCustomerID(db *gorm.DB, customerID uint64) error

func (*CustomerG7List) FetchByCustomerIDAndG7sOrgCode

func (cgl *CustomerG7List) FetchByCustomerIDAndG7sOrgCode(db *gorm.DB, customerID uint64, g7sOrgCode string) error

func (*CustomerG7List) FetchByG7sUserID

func (cgl *CustomerG7List) FetchByG7sUserID(db *gorm.DB, g7sUserID string) error

func (*CustomerG7List) FetchByUpdateTime

func (cgl *CustomerG7List) FetchByUpdateTime(db *gorm.DB, updateTime timelib.MySQLTimestamp) error

func (*CustomerG7List) FetchList

func (cgl *CustomerG7List) FetchList(db *gorm.DB, size, offset int32, query ...map[string]interface{}) (int32, error)

type PhysicsDeleteByUniquustomerG7

type PhysicsDeleteByUniquustomerG7 struct {
	// g7s用户id
	G7sUserID string `json:"userID,string" gorm:"primary_key;column:F_g7s_user_id" sql:"type:varchar(32);not null"`
	//// 客户id
	CustomerID uint64 `json:"customerID,string" gorm:"primary_key;column:F_customer_id" sql:"type:bigint(64) unsigned;not null;index:I_customer"`
	// g7s机构
	G7sOrgCode string `json:"orgCode" gorm:"column:F_g7s_org_code" sql:"type:varchar(32);not null;index:I_org_code"`
	// 记录创建时间
	CreateTime timelib.MySQLTimestamp `json:"createTime" gorm:"column:F_create_time" sql:"type:bigint(64);not null;index:I_create_time"`
	// 记录更新时间
	UpdateTime timelib.MySQLTimestamp `json:"updateTime" gorm:"column:F_update_time" sql:"type:bigint(64);not null;index:I_update_time"`
	Enabled    enumeration.Bool       `json:"-" gorm:"primary_key;column:F_enabled" sql:"type:tinyint(8) unsigned;not null;default:1"`
}

func (*PhysicsDeleteByUniquustomerG7) Create

func (pdbug *PhysicsDeleteByUniquustomerG7) Create(db *gorm.DB) error

func (*PhysicsDeleteByUniquustomerG7) CreateOnDuplicateWithUpdateFields

func (pdbug *PhysicsDeleteByUniquustomerG7) CreateOnDuplicateWithUpdateFields(db *gorm.DB, updateFields []string) error

CreateOnDuplicateWithUpdateFields only update the no unique index field, it return error if updateFields contain unique index field. It doesn't update the Enabled and CreateTime field.

func (PhysicsDeleteByUniquustomerG7) DBField

func (*PhysicsDeleteByUniquustomerG7) DeleteByG7sUserIDAndCustomerID

func (pdbug *PhysicsDeleteByUniquustomerG7) DeleteByG7sUserIDAndCustomerID(db *gorm.DB) error

func (*PhysicsDeleteByUniquustomerG7) FetchByG7sUserIDAndCustomerID

func (pdbug *PhysicsDeleteByUniquustomerG7) FetchByG7sUserIDAndCustomerID(db *gorm.DB) error

func (*PhysicsDeleteByUniquustomerG7) FetchByG7sUserIDAndCustomerIDForUpdate

func (pdbug *PhysicsDeleteByUniquustomerG7) FetchByG7sUserIDAndCustomerIDForUpdate(db *gorm.DB) error

func (*PhysicsDeleteByUniquustomerG7) SoftDeleteByG7sUserIDAndCustomerID

func (pdbug *PhysicsDeleteByUniquustomerG7) SoftDeleteByG7sUserIDAndCustomerID(db *gorm.DB) error

func (PhysicsDeleteByUniquustomerG7) TableName

func (pdbug PhysicsDeleteByUniquustomerG7) TableName() string

func (*PhysicsDeleteByUniquustomerG7) UpdateByG7sUserIDAndCustomerIDWithMap

func (pdbug *PhysicsDeleteByUniquustomerG7) UpdateByG7sUserIDAndCustomerIDWithMap(db *gorm.DB, updateMap map[string]interface{}) error

func (*PhysicsDeleteByUniquustomerG7) UpdateByG7sUserIDAndCustomerIDWithStruct

func (pdbug *PhysicsDeleteByUniquustomerG7) UpdateByG7sUserIDAndCustomerIDWithStruct(db *gorm.DB) error

type PhysicsDeleteByUniquustomerG7DBFieldData

type PhysicsDeleteByUniquustomerG7DBFieldData struct {
	G7sUserID  string
	CustomerID string
	G7sOrgCode string
	CreateTime string
	UpdateTime string
	Enabled    string
}

func (*PhysicsDeleteByUniquustomerG7DBFieldData) FetchNoneUniqueIndexFields

func (pdbugdbfd *PhysicsDeleteByUniquustomerG7DBFieldData) FetchNoneUniqueIndexFields() []string

FetchNoneUniqueIndexFields without Enabled and CreateTime field.

type PhysicsDeleteByUniquustomerG7List

type PhysicsDeleteByUniquustomerG7List []PhysicsDeleteByUniquustomerG7

func (*PhysicsDeleteByUniquustomerG7List) BatchFetchByCreateTimeList

func (pdbugl *PhysicsDeleteByUniquustomerG7List) BatchFetchByCreateTimeList(db *gorm.DB, createTimeList []timelib.MySQLTimestamp) error

func (*PhysicsDeleteByUniquustomerG7List) BatchFetchByCustomerIDList

func (pdbugl *PhysicsDeleteByUniquustomerG7List) BatchFetchByCustomerIDList(db *gorm.DB, customerIDList []uint64) error

func (*PhysicsDeleteByUniquustomerG7List) BatchFetchByG7sOrgCodeList

func (pdbugl *PhysicsDeleteByUniquustomerG7List) BatchFetchByG7sOrgCodeList(db *gorm.DB, g7sOrgCodeList []string) error

func (*PhysicsDeleteByUniquustomerG7List) BatchFetchByG7sUserIDList

func (pdbugl *PhysicsDeleteByUniquustomerG7List) BatchFetchByG7sUserIDList(db *gorm.DB, g7sUserIDList []string) error

func (*PhysicsDeleteByUniquustomerG7List) BatchFetchByUpdateTimeList

func (pdbugl *PhysicsDeleteByUniquustomerG7List) BatchFetchByUpdateTimeList(db *gorm.DB, updateTimeList []timelib.MySQLTimestamp) error

func (*PhysicsDeleteByUniquustomerG7List) FetchByCreateTime

func (pdbugl *PhysicsDeleteByUniquustomerG7List) FetchByCreateTime(db *gorm.DB, createTime timelib.MySQLTimestamp) error

func (*PhysicsDeleteByUniquustomerG7List) FetchByCustomerID

func (pdbugl *PhysicsDeleteByUniquustomerG7List) FetchByCustomerID(db *gorm.DB, customerID uint64) error

func (*PhysicsDeleteByUniquustomerG7List) FetchByG7sOrgCode

func (pdbugl *PhysicsDeleteByUniquustomerG7List) FetchByG7sOrgCode(db *gorm.DB, g7sOrgCode string) error

func (*PhysicsDeleteByUniquustomerG7List) FetchByG7sUserID

func (pdbugl *PhysicsDeleteByUniquustomerG7List) FetchByG7sUserID(db *gorm.DB, g7sUserID string) error

func (*PhysicsDeleteByUniquustomerG7List) FetchByUpdateTime

func (pdbugl *PhysicsDeleteByUniquustomerG7List) FetchByUpdateTime(db *gorm.DB, updateTime timelib.MySQLTimestamp) error

func (*PhysicsDeleteByUniquustomerG7List) FetchList

func (pdbugl *PhysicsDeleteByUniquustomerG7List) FetchList(db *gorm.DB, size, offset int32, query ...map[string]interface{}) (int32, error)

type User

type User struct {
	Id uint64 `gorm:"primary_key;column:F_id" sql:"type:bigint(64) unsigned auto_increment;not null" json:"-"`
	////Id1        uint64                 `gorm:"primary_key;column:F_id1" sql:"type:bigint(64) unsigned auto_increment;not null" json:"-"`
	Phone      string                 `gorm:"column:F_phone" sql:"type:varchar(16);not null;unique_index:I_phone" json:"phone"`
	UserID     uint64                 `gorm:"column:F_user_id" sql:"type:bigint(64) unsigned;not null;unique_index:I_user_id" json:"user_id"`
	Name       string                 `gorm:"column:F_name" sql:"type:varchar(32) ;not null;unique_index:I_user_id" json:"name"`
	CityID     uint64                 `gorm:"column:F_city_id" sql:"type:bigint(64) ;not null;index:I_city_id;default:0" json:"city_id"`
	AreaID     int                    `gorm:"column:F_area_id" sql:"type:bigint(64) ;not null;index:I_city_id;default:0" json:"area_id"`
	Enabled    uint8                  `gorm:"column:F_enabled" sql:"type:tinyint(8) unsigned;not null;default:1" json:"-"`
	CreateTime time.Time              `gorm:"column:F_create_time" sql:"type:bigint(64) unsigned;not null;default:0" json:"-"`
	UpdateTime timelib.MySQLTimestamp `gorm:"column:F_update_time" sql:"type:bigint(64) unsigned;not null;default:0" json:"-"`
}

func (*User) Create

func (u *User) Create(db *gorm.DB) error

func (*User) CreateOnDuplicateWithUpdateFields

func (u *User) CreateOnDuplicateWithUpdateFields(db *gorm.DB, updateFields []string) error

CreateOnDuplicateWithUpdateFields only update the no unique index field, it return error if updateFields contain unique index field. It doesn't update the Enabled and CreateTime field.

func (User) DBField

func (u User) DBField() *UserDBFieldData

func (*User) DeleteById

func (u *User) DeleteById(db *gorm.DB) error

func (*User) DeleteByPhone

func (u *User) DeleteByPhone(db *gorm.DB) error

func (*User) DeleteByUserIDAndName

func (u *User) DeleteByUserIDAndName(db *gorm.DB) error

func (*User) FetchById

func (u *User) FetchById(db *gorm.DB) error

func (*User) FetchByIdForUpdate

func (u *User) FetchByIdForUpdate(db *gorm.DB) error

func (*User) FetchByPhone

func (u *User) FetchByPhone(db *gorm.DB) error

func (*User) FetchByPhoneForUpdate

func (u *User) FetchByPhoneForUpdate(db *gorm.DB) error

func (*User) FetchByUserIDAndName

func (u *User) FetchByUserIDAndName(db *gorm.DB) error

func (*User) FetchByUserIDAndNameForUpdate

func (u *User) FetchByUserIDAndNameForUpdate(db *gorm.DB) error

func (*User) SoftDeleteById

func (u *User) SoftDeleteById(db *gorm.DB) error

func (*User) SoftDeleteByPhone

func (u *User) SoftDeleteByPhone(db *gorm.DB) error

func (*User) SoftDeleteByUserIDAndName

func (u *User) SoftDeleteByUserIDAndName(db *gorm.DB) error

func (User) TableName

func (cg User) TableName() string

func (*User) UpdateByIdWithMap

func (u *User) UpdateByIdWithMap(db *gorm.DB, updateMap map[string]interface{}) error

func (*User) UpdateByIdWithStruct

func (u *User) UpdateByIdWithStruct(db *gorm.DB) error

func (*User) UpdateByPhoneWithMap

func (u *User) UpdateByPhoneWithMap(db *gorm.DB, updateMap map[string]interface{}) error

func (*User) UpdateByPhoneWithStruct

func (u *User) UpdateByPhoneWithStruct(db *gorm.DB) error

func (*User) UpdateByUserIDAndNameWithMap

func (u *User) UpdateByUserIDAndNameWithMap(db *gorm.DB, updateMap map[string]interface{}) error

func (*User) UpdateByUserIDAndNameWithStruct

func (u *User) UpdateByUserIDAndNameWithStruct(db *gorm.DB) error

type UserDBFieldData

type UserDBFieldData struct {
	Id         string
	Phone      string
	UserID     string
	Name       string
	CityID     string
	AreaID     string
	Enabled    string
	CreateTime string
	UpdateTime string
}

func (*UserDBFieldData) FetchNoneUniqueIndexFields

func (udbfd *UserDBFieldData) FetchNoneUniqueIndexFields() []string

FetchNoneUniqueIndexFields without Enabled and CreateTime field.

type UserList

type UserList []User

func (*UserList) BatchFetchByCityIDList

func (ul *UserList) BatchFetchByCityIDList(db *gorm.DB, cityIDList []uint64) error

func (*UserList) BatchFetchByIdList

func (ul *UserList) BatchFetchByIdList(db *gorm.DB, idList []uint64) error

func (*UserList) BatchFetchByPhoneList

func (ul *UserList) BatchFetchByPhoneList(db *gorm.DB, phoneList []string) error

func (*UserList) BatchFetchByUserIDList

func (ul *UserList) BatchFetchByUserIDList(db *gorm.DB, userIDList []uint64) error

func (*UserList) FetchByCityID

func (ul *UserList) FetchByCityID(db *gorm.DB, cityID uint64) error

func (*UserList) FetchByCityIDAndAreaID

func (ul *UserList) FetchByCityIDAndAreaID(db *gorm.DB, cityID uint64, areaID int) error

func (*UserList) FetchByUserID

func (ul *UserList) FetchByUserID(db *gorm.DB, userID uint64) error

func (*UserList) FetchList

func (ul *UserList) FetchList(db *gorm.DB, size, offset int32, query ...map[string]interface{}) (int32, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL