|
|
@@ -0,0 +1,790 @@
|
|
|
+// ==========================================================================
|
|
|
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
|
|
|
+// ==========================================================================
|
|
|
+
|
|
|
+package internal
|
|
|
+
|
|
|
+import (
|
|
|
+ "context"
|
|
|
+ "database/sql"
|
|
|
+ "github.com/gogf/gf/database/gdb"
|
|
|
+ "github.com/gogf/gf/frame/g"
|
|
|
+ "github.com/gogf/gf/frame/gmvc"
|
|
|
+ "time"
|
|
|
+
|
|
|
+ model "dashoo.cn/micro/app/model/contract"
|
|
|
+)
|
|
|
+
|
|
|
+// CtrContractSaleTargetDao is the manager for logic model data accessing and custom defined data operations functions management.
|
|
|
+type CtrContractSaleTargetDao struct {
|
|
|
+ gmvc.M // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
|
|
|
+ C ctrContractSaleTargetColumns // C is the short type for Columns, which contains all the column names of Table for convenient usage.
|
|
|
+ DB gdb.DB // DB is the raw underlying database management object.
|
|
|
+ Table string // Table is the underlying table name of the DAO.
|
|
|
+ TableAs string // TableAs is the underlying table alias name of the DAO.
|
|
|
+}
|
|
|
+
|
|
|
+// CtrContractSaleTargetColumns defines and stores column names for table ctr_contract_sale_target.
|
|
|
+type ctrContractSaleTargetColumns struct {
|
|
|
+ Id string // 主键
|
|
|
+ SaleId string // 归属销售
|
|
|
+ SaleName string // 销售姓名
|
|
|
+ Year string // 年度
|
|
|
+ Plan1 string // 1月计划
|
|
|
+ Complete1 string // 1月达成
|
|
|
+ Plan2 string // 2月计划
|
|
|
+ Complete2 string // 2月达成
|
|
|
+ Plan3 string // 3月计划
|
|
|
+ Complete3 string // 3月达成
|
|
|
+ QuarterPlan1 string // 第一季度计划
|
|
|
+ QuarterComplete1 string // 第一季度达成
|
|
|
+ QuarterCompleteRatio1 string // 第一季度完成率
|
|
|
+ Plan4 string // 4月计划
|
|
|
+ Complete4 string // 4月达成
|
|
|
+ Plan5 string // 5月计划
|
|
|
+ Complete5 string // 5月达成
|
|
|
+ Plan6 string // 6月计划
|
|
|
+ Complete6 string // 6月达成
|
|
|
+ QuarterPlan2 string // 第二季度计划
|
|
|
+ QuarterComplete2 string // 第二季度达成
|
|
|
+ QuarterCompleteRatio2 string // 第二季度完成率
|
|
|
+ Plan7 string // 7月计划
|
|
|
+ Complete7 string // 7月达成
|
|
|
+ Plan8 string // 8月计划
|
|
|
+ Complete8 string // 8月达成
|
|
|
+ Plan9 string // 9月计划
|
|
|
+ Complete9 string // 9月达成
|
|
|
+ QuarterPlan3 string // 第三季度计划
|
|
|
+ QuarterComplete3 string // 第三季度达成
|
|
|
+ QuarterCompleteRatio3 string // 第三季度完成率
|
|
|
+ Plan10 string // 10月计划
|
|
|
+ Complete10 string // 10月达成
|
|
|
+ Plan11 string // 11月计划
|
|
|
+ Complete11 string // 11月达成
|
|
|
+ Plan12 string // 12月计划
|
|
|
+ Complete12 string // 12月达成
|
|
|
+ YearPlan string // 年度计划
|
|
|
+ YearComplete string // 年度达成
|
|
|
+ YearCompleteRatio string // 年度完成率
|
|
|
+ Remark string // 备注
|
|
|
+ CreatedBy string // 创建者
|
|
|
+ CreatedName string // 创建人
|
|
|
+ CreatedTime string // 创建时间
|
|
|
+ UpdatedBy string // 更新者
|
|
|
+ UpdatedName string // 更新人
|
|
|
+ UpdatedTime string // 更新时间
|
|
|
+ DeletedTime string // 删除时间
|
|
|
+}
|
|
|
+
|
|
|
+var (
|
|
|
+ // CtrContractSaleTarget is globally public accessible object for table ctr_contract_sale_target operations.
|
|
|
+ CtrContractSaleTarget = CtrContractSaleTargetDao{
|
|
|
+ M: g.DB("default").Model("ctr_contract_sale_target").Safe(),
|
|
|
+ DB: g.DB("default"),
|
|
|
+ Table: "ctr_contract_sale_target",
|
|
|
+ C: ctrContractSaleTargetColumns{
|
|
|
+ Id: "id",
|
|
|
+ SaleId: "sale_id",
|
|
|
+ SaleName: "sale_name",
|
|
|
+ Year: "year",
|
|
|
+ Plan1: "plan1",
|
|
|
+ Complete1: "complete1",
|
|
|
+ Plan2: "plan2",
|
|
|
+ Complete2: "complete2",
|
|
|
+ Plan3: "plan3",
|
|
|
+ Complete3: "complete3",
|
|
|
+ QuarterPlan1: "quarter_plan1",
|
|
|
+ QuarterComplete1: "quarter_complete1",
|
|
|
+ QuarterCompleteRatio1: "quarter_complete_ratio1",
|
|
|
+ Plan4: "plan4",
|
|
|
+ Complete4: "complete4",
|
|
|
+ Plan5: "plan5",
|
|
|
+ Complete5: "complete5",
|
|
|
+ Plan6: "plan6",
|
|
|
+ Complete6: "complete6",
|
|
|
+ QuarterPlan2: "quarter_plan2",
|
|
|
+ QuarterComplete2: "quarter_complete2",
|
|
|
+ QuarterCompleteRatio2: "quarter_complete_ratio2",
|
|
|
+ Plan7: "plan7",
|
|
|
+ Complete7: "complete7",
|
|
|
+ Plan8: "plan8",
|
|
|
+ Complete8: "complete8",
|
|
|
+ Plan9: "plan9",
|
|
|
+ Complete9: "complete9",
|
|
|
+ QuarterPlan3: "quarter_plan3",
|
|
|
+ QuarterComplete3: "quarter_complete3",
|
|
|
+ QuarterCompleteRatio3: "quarter_complete_ratio3",
|
|
|
+ Plan10: "plan10",
|
|
|
+ Complete10: "complete10",
|
|
|
+ Plan11: "plan11",
|
|
|
+ Complete11: "complete11",
|
|
|
+ Plan12: "plan12",
|
|
|
+ Complete12: "complete12",
|
|
|
+ YearPlan: "year_plan",
|
|
|
+ YearComplete: "year_complete",
|
|
|
+ YearCompleteRatio: "year_complete_ratio",
|
|
|
+ Remark: "remark",
|
|
|
+ CreatedBy: "created_by",
|
|
|
+ CreatedName: "created_name",
|
|
|
+ CreatedTime: "created_time",
|
|
|
+ UpdatedBy: "updated_by",
|
|
|
+ UpdatedName: "updated_name",
|
|
|
+ UpdatedTime: "updated_time",
|
|
|
+ DeletedTime: "deleted_time",
|
|
|
+ },
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
+func NewCtrContractSaleTargetDao(tenant string) CtrContractSaleTargetDao {
|
|
|
+ var dao CtrContractSaleTargetDao
|
|
|
+ dao = CtrContractSaleTargetDao{
|
|
|
+ M: g.DB(tenant).Model("ctr_contract_sale_target").Safe(),
|
|
|
+ DB: g.DB(tenant),
|
|
|
+ Table: "ctr_contract_sale_target",
|
|
|
+ C: ctrContractSaleTargetColumns{
|
|
|
+ Id: "id",
|
|
|
+ SaleId: "sale_id",
|
|
|
+ SaleName: "sale_name",
|
|
|
+ Year: "year",
|
|
|
+ Plan1: "plan1",
|
|
|
+ Complete1: "complete1",
|
|
|
+ Plan2: "plan2",
|
|
|
+ Complete2: "complete2",
|
|
|
+ Plan3: "plan3",
|
|
|
+ Complete3: "complete3",
|
|
|
+ QuarterPlan1: "quarter_plan1",
|
|
|
+ QuarterComplete1: "quarter_complete1",
|
|
|
+ QuarterCompleteRatio1: "quarter_complete_ratio1",
|
|
|
+ Plan4: "plan4",
|
|
|
+ Complete4: "complete4",
|
|
|
+ Plan5: "plan5",
|
|
|
+ Complete5: "complete5",
|
|
|
+ Plan6: "plan6",
|
|
|
+ Complete6: "complete6",
|
|
|
+ QuarterPlan2: "quarter_plan2",
|
|
|
+ QuarterComplete2: "quarter_complete2",
|
|
|
+ QuarterCompleteRatio2: "quarter_complete_ratio2",
|
|
|
+ Plan7: "plan7",
|
|
|
+ Complete7: "complete7",
|
|
|
+ Plan8: "plan8",
|
|
|
+ Complete8: "complete8",
|
|
|
+ Plan9: "plan9",
|
|
|
+ Complete9: "complete9",
|
|
|
+ QuarterPlan3: "quarter_plan3",
|
|
|
+ QuarterComplete3: "quarter_complete3",
|
|
|
+ QuarterCompleteRatio3: "quarter_complete_ratio3",
|
|
|
+ Plan10: "plan10",
|
|
|
+ Complete10: "complete10",
|
|
|
+ Plan11: "plan11",
|
|
|
+ Complete11: "complete11",
|
|
|
+ Plan12: "plan12",
|
|
|
+ Complete12: "complete12",
|
|
|
+ YearPlan: "year_plan",
|
|
|
+ YearComplete: "year_complete",
|
|
|
+ YearCompleteRatio: "year_complete_ratio",
|
|
|
+ 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 *CtrContractSaleTargetDao) Ctx(ctx context.Context) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// GetCtx returns the context for current Model.
|
|
|
+// It returns "context.Background() i"s there's no context previously set.
|
|
|
+func (d *CtrContractSaleTargetDao) GetCtx() context.Context {
|
|
|
+ return d.M.GetCtx()
|
|
|
+}
|
|
|
+
|
|
|
+// As sets an alias name for current table.
|
|
|
+func (d *CtrContractSaleTargetDao) As(as string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.As(as), Table: d.Table, TableAs: as}
|
|
|
+}
|
|
|
+
|
|
|
+// TX sets the transaction for current operation.
|
|
|
+func (d *CtrContractSaleTargetDao) TX(tx *gdb.TX) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Master marks the following operation on master node.
|
|
|
+func (d *CtrContractSaleTargetDao) Master() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Master(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Slave marks the following operation on slave node.
|
|
|
+// Note that it makes sense only if there's any slave node configured.
|
|
|
+func (d *CtrContractSaleTargetDao) Slave() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Args sets custom arguments for model operation.
|
|
|
+func (d *CtrContractSaleTargetDao) Args(args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Args(args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Handler calls each of "handlers" on current Model and returns a new Model.
|
|
|
+// ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
|
|
|
+func (d *CtrContractSaleTargetDao) Handler(handlers ...gdb.ModelHandler) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Handler(handlers...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
|
|
|
+// The parameter <table> can be joined table and its joined condition,
|
|
|
+// and also with its alias name, like:
|
|
|
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
|
|
|
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
|
|
|
+func (d *CtrContractSaleTargetDao) LeftJoin(table ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.LeftJoin(table...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
|
|
|
+// The parameter <table> can be joined table and its joined condition,
|
|
|
+// and also with its alias name, like:
|
|
|
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
|
|
|
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
|
|
|
+func (d *CtrContractSaleTargetDao) RightJoin(table ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.RightJoin(table...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
|
|
|
+// The parameter <table> can be joined table and its joined condition,
|
|
|
+// and also with its alias name, like:
|
|
|
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
|
|
|
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
|
|
|
+func (d *CtrContractSaleTargetDao) InnerJoin(table ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.InnerJoin(table...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
|
|
|
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
|
|
|
+func (d *CtrContractSaleTargetDao) Fields(fieldNamesOrMapStruct ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Fields(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
|
|
|
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
|
|
|
+func (d *CtrContractSaleTargetDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
|
|
|
+func (d *CtrContractSaleTargetDao) FieldCount(column string, as ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.FieldCount(column, as...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
|
|
|
+func (d *CtrContractSaleTargetDao) FieldSum(column string, as ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.FieldSum(column, as...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
|
|
|
+func (d *CtrContractSaleTargetDao) FieldMin(column string, as ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.FieldMin(column, as...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
|
|
|
+func (d *CtrContractSaleTargetDao) FieldMax(column string, as ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.FieldMax(column, as...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
|
|
|
+func (d *CtrContractSaleTargetDao) FieldAvg(column string, as ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.FieldAvg(column, as...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Option adds extra operation option for the model.
|
|
|
+// Deprecated, use separate operations instead.
|
|
|
+func (d *CtrContractSaleTargetDao) Option(option int) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Option(option), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
|
|
|
+// the data and where attributes for empty values.
|
|
|
+func (d *CtrContractSaleTargetDao) OmitEmpty() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OmitEmpty(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
|
|
|
+// the Where/Having parameters for "empty" values.
|
|
|
+func (d *CtrContractSaleTargetDao) OmitEmptyWhere() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OmitEmptyWhere(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
|
|
|
+// the Data parameters for "empty" values.
|
|
|
+func (d *CtrContractSaleTargetDao) OmitEmptyData() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OmitEmptyData(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitNil sets optionOmitNil option for the model, which automatically filers
|
|
|
+// the data and where parameters for "nil" values.
|
|
|
+func (d *CtrContractSaleTargetDao) OmitNil() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OmitNil(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
|
|
|
+// the Where/Having parameters for "nil" values.
|
|
|
+func (d *CtrContractSaleTargetDao) OmitNilWhere() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OmitNilWhere(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitNilData sets optionOmitNilData option for the model, which automatically filers
|
|
|
+// the Data parameters for "nil" values.
|
|
|
+func (d *CtrContractSaleTargetDao) OmitNilData() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OmitNilData(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
|
|
|
+// Note that this function supports only single table operations.
|
|
|
+// Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
|
|
|
+func (d *CtrContractSaleTargetDao) Filter() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Filter(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Where sets the condition statement for the model. The parameter <where> can be type of
|
|
|
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
|
|
|
+// multiple conditions will be joined into where statement using "AND".
|
|
|
+// Eg:
|
|
|
+// Where("uid=10000")
|
|
|
+// Where("uid", 10000)
|
|
|
+// Where("money>? AND name like ?", 99999, "vip_%")
|
|
|
+// Where("uid", 1).Where("name", "john")
|
|
|
+// Where("status IN (?)", g.Slice{1,2,3})
|
|
|
+// Where("age IN(?,?)", 18, 50)
|
|
|
+// Where(User{ Id : 1, UserName : "john"})
|
|
|
+func (d *CtrContractSaleTargetDao) Where(where interface{}, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Where(where, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WherePri does the same logic as M.Where except that if the parameter <where>
|
|
|
+// is a single condition like int/string/float/slice, it treats the condition as the primary
|
|
|
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
|
|
|
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
|
|
|
+// as string "123".
|
|
|
+func (d *CtrContractSaleTargetDao) WherePri(where interface{}, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WherePri(where, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Having sets the having statement for the model.
|
|
|
+// The parameters of this function usage are as the same as function Where.
|
|
|
+// See Where.
|
|
|
+func (d *CtrContractSaleTargetDao) Having(having interface{}, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Having(having, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Wheref builds condition string using fmt.Sprintf and arguments.
|
|
|
+// Note that if the number of "args" is more than the place holder in "format",
|
|
|
+// the extra "args" will be used as the where condition arguments of the Model.
|
|
|
+func (d *CtrContractSaleTargetDao) Wheref(format string, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereLT builds "column < value" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereLT(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereLTE builds "column <= value" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereLTE(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereGT builds "column > value" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereGT(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereGTE builds "column >= value" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereGTE(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereBetween builds "column BETWEEN min AND max" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereBetween(column string, min, max interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereLike builds "column LIKE like" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereLike(column string, like interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereIn builds "column IN (in)" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereIn(column string, in interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereIn(column, in), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereNull(columns ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereNotBetween(column string, min, max interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotLike builds "column NOT LIKE like" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereNotLike(column string, like interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNot builds "column != value" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereNot(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotIn builds "column NOT IN (in)" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereNotIn(column string, in interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereNotNull(columns ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOr adds "OR" condition to the where statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOr(where interface{}, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrf(format string, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrLT builds "column < value" statement in "OR" conditions..
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrLT(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrLTE(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrGT builds "column > value" statement in "OR" conditions..
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrGT(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrGTE(column string, value interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrGTE(column, value), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrBetween(column string, min, max interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrLike(column string, like interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrIn(column string, in interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrIn(column, in), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrNull(columns ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrNull(columns...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrNotBetween(column string, min, max interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrNotLike(column string, like interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotIn builds "column NOT IN (in)" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrNotIn(column string, in interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
|
|
|
+func (d *CtrContractSaleTargetDao) WhereOrNotNull(columns ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Group sets the "GROUP BY" statement for the model.
|
|
|
+func (d *CtrContractSaleTargetDao) Group(groupBy ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Group(groupBy...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// And adds "AND" condition to the where statement.
|
|
|
+// Deprecated, use Where instead.
|
|
|
+func (d *CtrContractSaleTargetDao) And(where interface{}, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.And(where, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Or adds "OR" condition to the where statement.
|
|
|
+// Deprecated, use WhereOr instead.
|
|
|
+func (d *CtrContractSaleTargetDao) Or(where interface{}, args ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// GroupBy sets the "GROUP BY" statement for the model.
|
|
|
+func (d *CtrContractSaleTargetDao) GroupBy(groupBy string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Order sets the "ORDER BY" statement for the model.
|
|
|
+func (d *CtrContractSaleTargetDao) Order(orderBy ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
|
|
|
+func (d *CtrContractSaleTargetDao) OrderAsc(column string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
|
|
|
+func (d *CtrContractSaleTargetDao) OrderDesc(column string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
|
|
|
+func (d *CtrContractSaleTargetDao) OrderRandom() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.OrderRandom(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// OrderBy is alias of Model.Order.
|
|
|
+// See Model.Order.
|
|
|
+// Deprecated, use Order instead.
|
|
|
+func (d *CtrContractSaleTargetDao) OrderBy(orderBy string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Order(orderBy), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Limit sets the "LIMIT" statement for the model.
|
|
|
+// The parameter <limit> can be either one or two number, if passed two number is passed,
|
|
|
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
|
|
|
+// statement.
|
|
|
+func (d *CtrContractSaleTargetDao) Limit(limit ...int) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Limit(limit...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Offset sets the "OFFSET" statement for the model.
|
|
|
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
|
|
|
+func (d *CtrContractSaleTargetDao) Offset(offset int) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Distinct forces the query to only return distinct results.
|
|
|
+func (d *CtrContractSaleTargetDao) Distinct() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Distinct(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Page sets the paging number for the model.
|
|
|
+// The parameter <page> is started from 1 for paging.
|
|
|
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
|
|
|
+func (d *CtrContractSaleTargetDao) Page(page, limit int) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Batch sets the batch operation number for the model.
|
|
|
+func (d *CtrContractSaleTargetDao) Batch(batch int) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Batch(batch), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
|
|
|
+// if there's another same sql request, it just reads and returns the result from cache, it
|
|
|
+// but not committed and executed into the database.
|
|
|
+//
|
|
|
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
|
|
|
+// If the parameter <duration> = 0, which means it never expires.
|
|
|
+// If the parameter <duration> > 0, which means it expires after <duration>.
|
|
|
+//
|
|
|
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
|
|
|
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
|
|
|
+//
|
|
|
+// Note that, the cache feature is disabled if the model is operating on a transaction.
|
|
|
+func (d *CtrContractSaleTargetDao) Cache(duration time.Duration, name ...string) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Cache(duration, name...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Data sets the operation data for the model.
|
|
|
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
|
|
|
+// Eg:
|
|
|
+// Data("uid=10000")
|
|
|
+// Data("uid", 10000)
|
|
|
+// Data(g.Map{"uid": 10000, "name":"john"})
|
|
|
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
|
|
|
+func (d *CtrContractSaleTargetDao) Data(data ...interface{}) *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Data(data...), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// All does "SELECT FROM ..." statement for the model.
|
|
|
+// It retrieves the records from table and returns the result as []*model.CtrContractSaleTarget.
|
|
|
+// 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 *CtrContractSaleTargetDao) All(where ...interface{}) ([]*model.CtrContractSaleTarget, error) {
|
|
|
+ all, err := d.M.All(where...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ var entities []*model.CtrContractSaleTarget
|
|
|
+ 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.CtrContractSaleTarget.
|
|
|
+// 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 *CtrContractSaleTargetDao) One(where ...interface{}) (*model.CtrContractSaleTarget, error) {
|
|
|
+ one, err := d.M.One(where...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ var entity *model.CtrContractSaleTarget
|
|
|
+ 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 *CtrContractSaleTargetDao) FindOne(where ...interface{}) (*model.CtrContractSaleTarget, error) {
|
|
|
+ one, err := d.M.FindOne(where...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ var entity *model.CtrContractSaleTarget
|
|
|
+ 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 *CtrContractSaleTargetDao) FindAll(where ...interface{}) ([]*model.CtrContractSaleTarget, error) {
|
|
|
+ all, err := d.M.FindAll(where...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ var entities []*model.CtrContractSaleTarget
|
|
|
+ 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 *CtrContractSaleTargetDao) 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 *CtrContractSaleTargetDao) 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 *CtrContractSaleTargetDao) Scan(pointer interface{}, where ...interface{}) error {
|
|
|
+ return d.M.Scan(pointer, where...)
|
|
|
+}
|
|
|
+
|
|
|
+// Chunk iterates the table with given size and callback function.
|
|
|
+func (d *CtrContractSaleTargetDao) Chunk(limit int, callback func(entities []*model.CtrContractSaleTarget, err error) bool) {
|
|
|
+ d.M.Chunk(limit, func(result gdb.Result, err error) bool {
|
|
|
+ var entities []*model.CtrContractSaleTarget
|
|
|
+ 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 *CtrContractSaleTargetDao) LockUpdate() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// LockShared sets the lock in share mode for current operation.
|
|
|
+func (d *CtrContractSaleTargetDao) LockShared() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|
|
|
+
|
|
|
+// Unscoped enables/disables the soft deleting feature.
|
|
|
+func (d *CtrContractSaleTargetDao) Unscoped() *CtrContractSaleTargetDao {
|
|
|
+ return &CtrContractSaleTargetDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
|
|
|
+}
|