|
|
@@ -10,6 +10,7 @@ import (
|
|
|
"github.com/gogf/gf/database/gdb"
|
|
|
"github.com/gogf/gf/frame/g"
|
|
|
"github.com/gogf/gf/frame/gmvc"
|
|
|
+ "github.com/gogf/gf/util/gconv"
|
|
|
"time"
|
|
|
|
|
|
model "dashoo.cn/micro/app/model/proj"
|
|
|
@@ -26,50 +27,78 @@ type ProjBusinessDao struct {
|
|
|
|
|
|
// ProjBusinessColumns defines and stores column names for table proj_business.
|
|
|
type projBusinessColumns struct {
|
|
|
- Id string // 主键
|
|
|
- NboCode string // 项目编号
|
|
|
- NboName string // 项目名称
|
|
|
- NboStatus string // 项目状态
|
|
|
- CustId string // 关联客户
|
|
|
- CustName string // 客户名称
|
|
|
- NboType string // 项目类别(A类B类C类)
|
|
|
- NboPhase string // 项目阶段(暂不起用)
|
|
|
- NboSource string // 项目来源
|
|
|
- NboBudget string // 项目预算
|
|
|
- ApproStatus string // 审批状态(10待提交20审批中30审批通过40审批退回60审批拒绝)
|
|
|
- ContactId string // 关联联系人
|
|
|
- ContactName string // 联系人姓名
|
|
|
- ContactPostion string // 联系人岗位
|
|
|
- ContactTelephone string // 联系人电话
|
|
|
- MakerId string // 关联决策人
|
|
|
- MakerName string // 决策人姓名
|
|
|
- MakerPost string // 决策人岗位
|
|
|
- MakerTelephone string // 决策人电话
|
|
|
- SalesModel string // 销售模式(10直销20经销30代理)
|
|
|
- SaleId string // 归属销售
|
|
|
- SaleName string // 销售姓名
|
|
|
- DistributorId string // 经销商/代理商ID
|
|
|
- DistributorName string // 经销商/代理商名称
|
|
|
- ObtainTime string // 获取时间
|
|
|
- FinalFollowTime string // 最后跟进时间
|
|
|
- NextFollowTime string // 下次跟进时间
|
|
|
- PlanPurchaseTime string // 计划采购时间
|
|
|
- EstTransTime string // 预计成交时间
|
|
|
- EstTransPrice string // 预计成交价格
|
|
|
- RiskProfile string // 风险情况
|
|
|
- Difficulty string // 困难点
|
|
|
- Competitor string // 竞争公司
|
|
|
- Intervention string // 介入情况
|
|
|
- DeptId string // 所属部门ID
|
|
|
- DeptName string // 所属部门
|
|
|
- Remark string // 备注
|
|
|
- CreatedBy string // 创建者
|
|
|
- CreatedName string // 创建人
|
|
|
- CreatedTime string // 创建时间
|
|
|
- UpdatedBy string // 更新者
|
|
|
- UpdatedName string // 更新人
|
|
|
- UpdatedTime string // 更新时间
|
|
|
- DeletedTime string // 删除时间
|
|
|
+ Id string // 主键
|
|
|
+ NboCode string // 项目编码
|
|
|
+ NboName string // 项目名称
|
|
|
+ NboStatus string // 项目状态
|
|
|
+ CustId string // 关联客户
|
|
|
+ CustName string // 客户名称
|
|
|
+ CustProvinceId string // 所在省ID
|
|
|
+ CustProvince string // 所在省
|
|
|
+ CustCityId string // 所在市ID
|
|
|
+ CustCity string // 所在市
|
|
|
+ CustRegionId string // 所在区县ID
|
|
|
+ CustRegion string // 所在区县
|
|
|
+ ProductLine string // 产品线
|
|
|
+ NboType string // 项目级别(A 、B 、C 、成交、储备)
|
|
|
+ NboPhase string // 项目阶段(暂不起用)
|
|
|
+ NboSource string // 项目来源
|
|
|
+ NboBudget string // 项目预算
|
|
|
+ ApproStatus string // 审批状态(10待提交20审批中30审批通过40审批退回60审批拒绝)
|
|
|
+ ContactId string // 关联联系人
|
|
|
+ ContactName string // 联系人姓名
|
|
|
+ ContactPostion string // 联系人岗位
|
|
|
+ ContactTelephone string // 联系人电话
|
|
|
+ MakerId string // 关联决策人
|
|
|
+ MakerName string // 决策人姓名
|
|
|
+ MakerDept string // 决策人部门
|
|
|
+ MakerPost string // 决策人岗位
|
|
|
+ MakerTelephone string // 决策人电话
|
|
|
+ SalesModel string // 销售模式(10直销20经销30代理)
|
|
|
+ SaleId string // 归属销售
|
|
|
+ SaleName string // 销售姓名
|
|
|
+ DistributorId string // 经销商/代理商ID
|
|
|
+ DistributorName string // 经销商/代理商名称
|
|
|
+ FilingTime string // 项目备案时间
|
|
|
+ FinalFollowId string // 最新跟进人
|
|
|
+ FinalFollowName string // 最新跟进人名称
|
|
|
+ FinalFollowTime string // 最后跟进时间
|
|
|
+ NextFollowTime string // 下次跟进时间
|
|
|
+ PlanPurchaseTime string // 计划采购时间
|
|
|
+ EstTransTime string // 预计成交时间
|
|
|
+ EstTransPrice string // 预计成交价格
|
|
|
+ RiskProfile string // 风险情况
|
|
|
+ Difficulty string // 困难点
|
|
|
+ Competitor string // 竞争公司
|
|
|
+ Intervention string // 介入情况
|
|
|
+ DeptId string // 所属部门ID
|
|
|
+ DeptName string // 所属部门
|
|
|
+ IsBig string // 是否为大项目
|
|
|
+ TechnicalSupportName string // 技术支持人员
|
|
|
+ TechnicalSupportContent string // 技术支持内容
|
|
|
+ TechnicalSupportTime string // 技术支持时间
|
|
|
+ CustomerSatisfaction string // 客户满意度 (10很满意、20满意、30较满意、40一般、50不满意)
|
|
|
+ ParentReceiver string // 总部对接人
|
|
|
+ NboBudgetTime string // 项目预算期限
|
|
|
+ CapitalSource string // 资金来源
|
|
|
+ ProductSatisfaction string // 产品/方案满足情况
|
|
|
+ PurchasingWay string // 采购方式
|
|
|
+ PurchasingTime string // 采购时间
|
|
|
+ IsAdoptDashoo string // 是否采纳大数技术参数(上传附件)
|
|
|
+ HistoricalTransactionInfo string // 经销商与客户历史成交信息
|
|
|
+ DealerSalesId string // 关联经销商销售
|
|
|
+ DealerSalesName string // 经销商销售人员
|
|
|
+ Accendant string // 维护部门及人员
|
|
|
+ ProjConversionTime string // 项目转化时间
|
|
|
+ ProjConversionReason string // 项目转化原因
|
|
|
+ Remark string // 备注
|
|
|
+ CreatedBy string // 创建者
|
|
|
+ CreatedName string // 创建人
|
|
|
+ CreatedTime string // 创建时间
|
|
|
+ UpdatedBy string // 更新者
|
|
|
+ UpdatedName string // 更新人
|
|
|
+ UpdatedTime string // 更新时间
|
|
|
+ DeletedTime string // 删除时间
|
|
|
}
|
|
|
|
|
|
var (
|
|
|
@@ -79,50 +108,78 @@ var (
|
|
|
DB: g.DB("default"),
|
|
|
Table: "proj_business",
|
|
|
Columns: projBusinessColumns{
|
|
|
- Id: "id",
|
|
|
- NboCode: "nbo_code",
|
|
|
- NboName: "nbo_name",
|
|
|
- NboStatus: "nbo_status",
|
|
|
- CustId: "cust_id",
|
|
|
- CustName: "cust_name",
|
|
|
- NboType: "nbo_type",
|
|
|
- NboPhase: "nbo_phase",
|
|
|
- NboSource: "nbo_source",
|
|
|
- NboBudget: "nbo_budget",
|
|
|
- ApproStatus: "appro_status",
|
|
|
- ContactId: "contact_id",
|
|
|
- ContactName: "contact_name",
|
|
|
- ContactPostion: "contact_postion",
|
|
|
- ContactTelephone: "contact_telephone",
|
|
|
- MakerId: "maker_id",
|
|
|
- MakerName: "maker_name",
|
|
|
- MakerPost: "maker_post",
|
|
|
- MakerTelephone: "maker_telephone",
|
|
|
- SalesModel: "sales_model",
|
|
|
- SaleId: "sale_id",
|
|
|
- SaleName: "sale_name",
|
|
|
- DistributorId: "distributor_id",
|
|
|
- DistributorName: "distributor_name",
|
|
|
- ObtainTime: "obtain_time",
|
|
|
- FinalFollowTime: "final_follow_time",
|
|
|
- NextFollowTime: "next_follow_time",
|
|
|
- PlanPurchaseTime: "plan_purchase_time",
|
|
|
- EstTransTime: "est_trans_time",
|
|
|
- EstTransPrice: "est_trans_price",
|
|
|
- RiskProfile: "risk_profile",
|
|
|
- Difficulty: "difficulty",
|
|
|
- Competitor: "competitor",
|
|
|
- Intervention: "Intervention",
|
|
|
- DeptId: "dept_id",
|
|
|
- DeptName: "dept_name",
|
|
|
- Remark: "remark",
|
|
|
- CreatedBy: "created_by",
|
|
|
- CreatedName: "created_name",
|
|
|
- CreatedTime: "created_time",
|
|
|
- UpdatedBy: "updated_by",
|
|
|
- UpdatedName: "updated_name",
|
|
|
- UpdatedTime: "updated_time",
|
|
|
- DeletedTime: "deleted_time",
|
|
|
+ Id: "id",
|
|
|
+ NboCode: "nbo_code",
|
|
|
+ NboName: "nbo_name",
|
|
|
+ NboStatus: "nbo_status",
|
|
|
+ CustId: "cust_id",
|
|
|
+ CustName: "cust_name",
|
|
|
+ CustProvinceId: "cust_province_id",
|
|
|
+ CustProvince: "cust_province",
|
|
|
+ CustCityId: "cust_city_id",
|
|
|
+ CustCity: "cust_city",
|
|
|
+ CustRegionId: "cust_region_id",
|
|
|
+ CustRegion: "cust_region",
|
|
|
+ ProductLine: "product_line",
|
|
|
+ NboType: "nbo_type",
|
|
|
+ NboPhase: "nbo_phase",
|
|
|
+ NboSource: "nbo_source",
|
|
|
+ NboBudget: "nbo_budget",
|
|
|
+ ApproStatus: "appro_status",
|
|
|
+ ContactId: "contact_id",
|
|
|
+ ContactName: "contact_name",
|
|
|
+ ContactPostion: "contact_postion",
|
|
|
+ ContactTelephone: "contact_telephone",
|
|
|
+ MakerId: "maker_id",
|
|
|
+ MakerName: "maker_name",
|
|
|
+ MakerDept: "maker_dept",
|
|
|
+ MakerPost: "maker_post",
|
|
|
+ MakerTelephone: "maker_telephone",
|
|
|
+ SalesModel: "sales_model",
|
|
|
+ SaleId: "sale_id",
|
|
|
+ SaleName: "sale_name",
|
|
|
+ DistributorId: "distributor_id",
|
|
|
+ DistributorName: "distributor_name",
|
|
|
+ FilingTime: "filing_time",
|
|
|
+ FinalFollowId: "final_follow_id",
|
|
|
+ FinalFollowName: "final_follow_name",
|
|
|
+ FinalFollowTime: "final_follow_time",
|
|
|
+ NextFollowTime: "next_follow_time",
|
|
|
+ PlanPurchaseTime: "plan_purchase_time",
|
|
|
+ EstTransTime: "est_trans_time",
|
|
|
+ EstTransPrice: "est_trans_price",
|
|
|
+ RiskProfile: "risk_profile",
|
|
|
+ Difficulty: "difficulty",
|
|
|
+ Competitor: "competitor",
|
|
|
+ Intervention: "Intervention",
|
|
|
+ DeptId: "dept_id",
|
|
|
+ DeptName: "dept_name",
|
|
|
+ IsBig: "is_big",
|
|
|
+ TechnicalSupportName: "technical_support_name",
|
|
|
+ TechnicalSupportContent: "technical_support_content",
|
|
|
+ TechnicalSupportTime: "technical_support_time",
|
|
|
+ CustomerSatisfaction: "customer_satisfaction",
|
|
|
+ ParentReceiver: "parent_receiver",
|
|
|
+ NboBudgetTime: "nbo_budget_time",
|
|
|
+ CapitalSource: "capital_source",
|
|
|
+ ProductSatisfaction: "product_satisfaction",
|
|
|
+ PurchasingWay: "purchasing_way",
|
|
|
+ PurchasingTime: "purchasing_time",
|
|
|
+ IsAdoptDashoo: "is_adopt_dashoo",
|
|
|
+ HistoricalTransactionInfo: "historical_transaction_info",
|
|
|
+ DealerSalesId: "dealer_sales_id",
|
|
|
+ DealerSalesName: "dealer_sales_name",
|
|
|
+ Accendant: "accendant",
|
|
|
+ ProjConversionTime: "proj_conversion_time",
|
|
|
+ ProjConversionReason: "proj_conversion_reason",
|
|
|
+ Remark: "remark",
|
|
|
+ CreatedBy: "created_by",
|
|
|
+ CreatedName: "created_name",
|
|
|
+ CreatedTime: "created_time",
|
|
|
+ UpdatedBy: "updated_by",
|
|
|
+ UpdatedName: "updated_name",
|
|
|
+ UpdatedTime: "updated_time",
|
|
|
+ DeletedTime: "deleted_time",
|
|
|
},
|
|
|
}
|
|
|
)
|
|
|
@@ -134,50 +191,78 @@ func NewProjBusinessDao(tenant string) ProjBusinessDao {
|
|
|
DB: g.DB(tenant),
|
|
|
Table: "proj_business",
|
|
|
Columns: projBusinessColumns{
|
|
|
- Id: "id",
|
|
|
- NboCode: "nbo_code",
|
|
|
- NboName: "nbo_name",
|
|
|
- NboStatus: "nbo_status",
|
|
|
- CustId: "cust_id",
|
|
|
- CustName: "cust_name",
|
|
|
- NboType: "nbo_type",
|
|
|
- NboPhase: "nbo_phase",
|
|
|
- NboSource: "nbo_source",
|
|
|
- NboBudget: "nbo_budget",
|
|
|
- ApproStatus: "appro_status",
|
|
|
- ContactId: "contact_id",
|
|
|
- ContactName: "contact_name",
|
|
|
- ContactPostion: "contact_postion",
|
|
|
- ContactTelephone: "contact_telephone",
|
|
|
- MakerId: "maker_id",
|
|
|
- MakerName: "maker_name",
|
|
|
- MakerPost: "maker_post",
|
|
|
- MakerTelephone: "maker_telephone",
|
|
|
- SalesModel: "sales_model",
|
|
|
- SaleId: "sale_id",
|
|
|
- SaleName: "sale_name",
|
|
|
- DistributorId: "distributor_id",
|
|
|
- DistributorName: "distributor_name",
|
|
|
- ObtainTime: "obtain_time",
|
|
|
- FinalFollowTime: "final_follow_time",
|
|
|
- NextFollowTime: "next_follow_time",
|
|
|
- PlanPurchaseTime: "plan_purchase_time",
|
|
|
- EstTransTime: "est_trans_time",
|
|
|
- EstTransPrice: "est_trans_price",
|
|
|
- RiskProfile: "risk_profile",
|
|
|
- Difficulty: "difficulty",
|
|
|
- Competitor: "competitor",
|
|
|
- Intervention: "Intervention",
|
|
|
- DeptId: "dept_id",
|
|
|
- DeptName: "dept_name",
|
|
|
- Remark: "remark",
|
|
|
- CreatedBy: "created_by",
|
|
|
- CreatedName: "created_name",
|
|
|
- CreatedTime: "created_time",
|
|
|
- UpdatedBy: "updated_by",
|
|
|
- UpdatedName: "updated_name",
|
|
|
- UpdatedTime: "updated_time",
|
|
|
- DeletedTime: "deleted_time",
|
|
|
+ Id: "id",
|
|
|
+ NboCode: "nbo_code",
|
|
|
+ NboName: "nbo_name",
|
|
|
+ NboStatus: "nbo_status",
|
|
|
+ CustId: "cust_id",
|
|
|
+ CustName: "cust_name",
|
|
|
+ CustProvinceId: "cust_province_id",
|
|
|
+ CustProvince: "cust_province",
|
|
|
+ CustCityId: "cust_city_id",
|
|
|
+ CustCity: "cust_city",
|
|
|
+ CustRegionId: "cust_region_id",
|
|
|
+ CustRegion: "cust_region",
|
|
|
+ ProductLine: "product_line",
|
|
|
+ NboType: "nbo_type",
|
|
|
+ NboPhase: "nbo_phase",
|
|
|
+ NboSource: "nbo_source",
|
|
|
+ NboBudget: "nbo_budget",
|
|
|
+ ApproStatus: "appro_status",
|
|
|
+ ContactId: "contact_id",
|
|
|
+ ContactName: "contact_name",
|
|
|
+ ContactPostion: "contact_postion",
|
|
|
+ ContactTelephone: "contact_telephone",
|
|
|
+ MakerId: "maker_id",
|
|
|
+ MakerName: "maker_name",
|
|
|
+ MakerDept: "maker_dept",
|
|
|
+ MakerPost: "maker_post",
|
|
|
+ MakerTelephone: "maker_telephone",
|
|
|
+ SalesModel: "sales_model",
|
|
|
+ SaleId: "sale_id",
|
|
|
+ SaleName: "sale_name",
|
|
|
+ DistributorId: "distributor_id",
|
|
|
+ DistributorName: "distributor_name",
|
|
|
+ FilingTime: "filing_time",
|
|
|
+ FinalFollowId: "final_follow_id",
|
|
|
+ FinalFollowName: "final_follow_name",
|
|
|
+ FinalFollowTime: "final_follow_time",
|
|
|
+ NextFollowTime: "next_follow_time",
|
|
|
+ PlanPurchaseTime: "plan_purchase_time",
|
|
|
+ EstTransTime: "est_trans_time",
|
|
|
+ EstTransPrice: "est_trans_price",
|
|
|
+ RiskProfile: "risk_profile",
|
|
|
+ Difficulty: "difficulty",
|
|
|
+ Competitor: "competitor",
|
|
|
+ Intervention: "Intervention",
|
|
|
+ DeptId: "dept_id",
|
|
|
+ DeptName: "dept_name",
|
|
|
+ IsBig: "is_big",
|
|
|
+ TechnicalSupportName: "technical_support_name",
|
|
|
+ TechnicalSupportContent: "technical_support_content",
|
|
|
+ TechnicalSupportTime: "technical_support_time",
|
|
|
+ CustomerSatisfaction: "customer_satisfaction",
|
|
|
+ ParentReceiver: "parent_receiver",
|
|
|
+ NboBudgetTime: "nbo_budget_time",
|
|
|
+ CapitalSource: "capital_source",
|
|
|
+ ProductSatisfaction: "product_satisfaction",
|
|
|
+ PurchasingWay: "purchasing_way",
|
|
|
+ PurchasingTime: "purchasing_time",
|
|
|
+ IsAdoptDashoo: "is_adopt_dashoo",
|
|
|
+ HistoricalTransactionInfo: "historical_transaction_info",
|
|
|
+ DealerSalesId: "dealer_sales_id",
|
|
|
+ DealerSalesName: "dealer_sales_name",
|
|
|
+ Accendant: "accendant",
|
|
|
+ ProjConversionTime: "proj_conversion_time",
|
|
|
+ ProjConversionReason: "proj_conversion_reason",
|
|
|
+ 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
|
|
|
@@ -191,6 +276,12 @@ func (d *ProjBusinessDao) Ctx(ctx context.Context) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Ctx(ctx)}
|
|
|
}
|
|
|
|
|
|
+// GetCtx returns the context for current Model.
|
|
|
+// It returns "context.Background() i"s there's no context previously set.
|
|
|
+func (d *ProjBusinessDao) GetCtx() context.Context {
|
|
|
+ return d.M.GetCtx()
|
|
|
+}
|
|
|
+
|
|
|
// As sets an alias name for current table.
|
|
|
func (d *ProjBusinessDao) As(as string) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.As(as)}
|
|
|
@@ -217,6 +308,12 @@ func (d *ProjBusinessDao) Args(args ...interface{}) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Args(args...)}
|
|
|
}
|
|
|
|
|
|
+// Handler calls each of "handlers" on current Model and returns a new Model.
|
|
|
+// ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
|
|
|
+func (d *ProjBusinessDao) Handler(handlers ...gdb.ModelHandler) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.Handler(handlers...)}
|
|
|
+}
|
|
|
+
|
|
|
// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
|
|
|
// The parameter <table> can be joined table and its joined condition,
|
|
|
// and also with its alias name, like:
|
|
|
@@ -256,7 +353,33 @@ func (d *ProjBusinessDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ProjBu
|
|
|
return &ProjBusinessDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
|
|
|
}
|
|
|
|
|
|
-// Option sets the extra operation option for the model.
|
|
|
+// FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
|
|
|
+func (d *ProjBusinessDao) FieldCount(column string, as ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.FieldCount(column, as...)}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
|
|
|
+func (d *ProjBusinessDao) FieldSum(column string, as ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.FieldSum(column, as...)}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
|
|
|
+func (d *ProjBusinessDao) FieldMin(column string, as ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.FieldMin(column, as...)}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
|
|
|
+func (d *ProjBusinessDao) FieldMax(column string, as ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.FieldMax(column, as...)}
|
|
|
+}
|
|
|
+
|
|
|
+// FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
|
|
|
+func (d *ProjBusinessDao) FieldAvg(column string, as ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.FieldAvg(column, as...)}
|
|
|
+}
|
|
|
+
|
|
|
+// Option adds extra operation option for the model.
|
|
|
+// Deprecated, use separate operations instead.
|
|
|
func (d *ProjBusinessDao) Option(option int) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Option(option)}
|
|
|
}
|
|
|
@@ -267,7 +390,39 @@ func (d *ProjBusinessDao) OmitEmpty() *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.OmitEmpty()}
|
|
|
}
|
|
|
|
|
|
+// OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
|
|
|
+// the Where/Having parameters for "empty" values.
|
|
|
+func (d *ProjBusinessDao) OmitEmptyWhere() *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OmitEmptyWhere()}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
|
|
|
+// the Data parameters for "empty" values.
|
|
|
+func (d *ProjBusinessDao) OmitEmptyData() *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OmitEmptyData()}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitNil sets optionOmitNil option for the model, which automatically filers
|
|
|
+// the data and where parameters for "nil" values.
|
|
|
+func (d *ProjBusinessDao) OmitNil() *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OmitNil()}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
|
|
|
+// the Where/Having parameters for "nil" values.
|
|
|
+func (d *ProjBusinessDao) OmitNilWhere() *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OmitNilWhere()}
|
|
|
+}
|
|
|
+
|
|
|
+// OmitNilData sets optionOmitNilData option for the model, which automatically filers
|
|
|
+// the Data parameters for "nil" values.
|
|
|
+func (d *ProjBusinessDao) OmitNilData() *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OmitNilData()}
|
|
|
+}
|
|
|
+
|
|
|
// Filter marks filtering the fields which does not exist in the fields of the operated table.
|
|
|
+// Note that this function supports only single table operations.
|
|
|
+// Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
|
|
|
func (d *ProjBusinessDao) Filter() *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Filter()}
|
|
|
}
|
|
|
@@ -296,18 +451,174 @@ func (d *ProjBusinessDao) WherePri(where interface{}, args ...interface{}) *Proj
|
|
|
return &ProjBusinessDao{M: d.M.WherePri(where, args...)}
|
|
|
}
|
|
|
|
|
|
+// Having sets the having statement for the model.
|
|
|
+// The parameters of this function usage are as the same as function Where.
|
|
|
+// See Where.
|
|
|
+func (d *ProjBusinessDao) Having(having interface{}, args ...interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.Having(having, args...)}
|
|
|
+}
|
|
|
+
|
|
|
+// Wheref builds condition string using fmt.Sprintf and arguments.
|
|
|
+// Note that if the number of "args" is more than the place holder in "format",
|
|
|
+// the extra "args" will be used as the where condition arguments of the Model.
|
|
|
+func (d *ProjBusinessDao) Wheref(format string, args ...interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.Wheref(format, args...)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereLT builds "column < value" statement.
|
|
|
+func (d *ProjBusinessDao) WhereLT(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereLT(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereLTE builds "column <= value" statement.
|
|
|
+func (d *ProjBusinessDao) WhereLTE(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereLTE(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereGT builds "column > value" statement.
|
|
|
+func (d *ProjBusinessDao) WhereGT(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereGT(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereGTE builds "column >= value" statement.
|
|
|
+func (d *ProjBusinessDao) WhereGTE(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereGTE(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereBetween builds "column BETWEEN min AND max" statement.
|
|
|
+func (d *ProjBusinessDao) WhereBetween(column string, min, max interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereBetween(column, min, max)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereLike builds "column LIKE like" statement.
|
|
|
+func (d *ProjBusinessDao) WhereLike(column string, like interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereLike(column, like)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereIn builds "column IN (in)" statement.
|
|
|
+func (d *ProjBusinessDao) WhereIn(column string, in interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereIn(column, in)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
|
|
|
+func (d *ProjBusinessDao) WhereNull(columns ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereNull(columns...)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
|
|
|
+func (d *ProjBusinessDao) WhereNotBetween(column string, min, max interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereNotBetween(column, min, max)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotLike builds "column NOT LIKE like" statement.
|
|
|
+func (d *ProjBusinessDao) WhereNotLike(column string, like interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereNotLike(column, like)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNot builds "column != value" statement.
|
|
|
+func (d *ProjBusinessDao) WhereNot(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereNot(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotIn builds "column NOT IN (in)" statement.
|
|
|
+func (d *ProjBusinessDao) WhereNotIn(column string, in interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereNotIn(column, in)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
|
|
|
+func (d *ProjBusinessDao) WhereNotNull(columns ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereNotNull(columns...)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOr adds "OR" condition to the where statement.
|
|
|
+func (d *ProjBusinessDao) WhereOr(where interface{}, args ...interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOr(where, args...)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
|
|
|
+func (d *ProjBusinessDao) WhereOrf(format string, args ...interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrf(format, args...)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrLT builds "column < value" statement in "OR" conditions..
|
|
|
+func (d *ProjBusinessDao) WhereOrLT(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrLT(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrLTE builds "column <= value" statement in "OR" conditions..
|
|
|
+func (d *ProjBusinessDao) WhereOrLTE(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrLTE(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrGT builds "column > value" statement in "OR" conditions..
|
|
|
+func (d *ProjBusinessDao) WhereOrGT(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrGT(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrGTE builds "column >= value" statement in "OR" conditions..
|
|
|
+func (d *ProjBusinessDao) WhereOrGTE(column string, value interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrGTE(column, value)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
|
|
|
+func (d *ProjBusinessDao) WhereOrBetween(column string, min, max interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrBetween(column, min, max)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
|
|
|
+func (d *ProjBusinessDao) WhereOrLike(column string, like interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrLike(column, like)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
|
|
|
+func (d *ProjBusinessDao) WhereOrIn(column string, in interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrIn(column, in)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
|
|
|
+func (d *ProjBusinessDao) WhereOrNull(columns ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrNull(columns...)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
|
|
|
+func (d *ProjBusinessDao) WhereOrNotBetween(column string, min, max interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrNotBetween(column, min, max)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
|
|
|
+func (d *ProjBusinessDao) WhereOrNotLike(column string, like interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrNotLike(column, like)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotIn builds "column NOT IN (in)" statement.
|
|
|
+func (d *ProjBusinessDao) WhereOrNotIn(column string, in interface{}) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrNotIn(column, in)}
|
|
|
+}
|
|
|
+
|
|
|
+// WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
|
|
|
+func (d *ProjBusinessDao) WhereOrNotNull(columns ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.WhereOrNotNull(columns...)}
|
|
|
+}
|
|
|
+
|
|
|
+// Group sets the "GROUP BY" statement for the model.
|
|
|
+func (d *ProjBusinessDao) Group(groupBy ...string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.Group(groupBy...)}
|
|
|
+}
|
|
|
+
|
|
|
// And adds "AND" condition to the where statement.
|
|
|
+// Deprecated, use Where instead.
|
|
|
func (d *ProjBusinessDao) And(where interface{}, args ...interface{}) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.And(where, args...)}
|
|
|
}
|
|
|
|
|
|
// Or adds "OR" condition to the where statement.
|
|
|
+// Deprecated, use WhereOr instead.
|
|
|
func (d *ProjBusinessDao) Or(where interface{}, args ...interface{}) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Or(where, args...)}
|
|
|
}
|
|
|
|
|
|
-// Group sets the "GROUP BY" statement for the model.
|
|
|
-func (d *ProjBusinessDao) Group(groupBy string) *ProjBusinessDao {
|
|
|
+// GroupBy sets the "GROUP BY" statement for the model.
|
|
|
+func (d *ProjBusinessDao) GroupBy(groupBy string) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Group(groupBy)}
|
|
|
}
|
|
|
|
|
|
@@ -316,6 +627,28 @@ func (d *ProjBusinessDao) Order(orderBy ...string) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Order(orderBy...)}
|
|
|
}
|
|
|
|
|
|
+// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
|
|
|
+func (d *ProjBusinessDao) OrderAsc(column string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OrderAsc(column)}
|
|
|
+}
|
|
|
+
|
|
|
+// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
|
|
|
+func (d *ProjBusinessDao) OrderDesc(column string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OrderDesc(column)}
|
|
|
+}
|
|
|
+
|
|
|
+// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
|
|
|
+func (d *ProjBusinessDao) OrderRandom() *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.OrderRandom()}
|
|
|
+}
|
|
|
+
|
|
|
+// OrderBy is alias of Model.Order.
|
|
|
+// See Model.Order.
|
|
|
+// Deprecated, use Order instead.
|
|
|
+func (d *ProjBusinessDao) OrderBy(orderBy string) *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{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]"
|
|
|
@@ -330,6 +663,11 @@ func (d *ProjBusinessDao) Offset(offset int) *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Offset(offset)}
|
|
|
}
|
|
|
|
|
|
+// Distinct forces the query to only return distinct results.
|
|
|
+func (d *ProjBusinessDao) Distinct() *ProjBusinessDao {
|
|
|
+ return &ProjBusinessDao{M: d.M.Distinct()}
|
|
|
+}
|
|
|
+
|
|
|
// Page sets the paging number for the model.
|
|
|
// The parameter <page> is started from 1 for paging.
|
|
|
// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
|
|
|
@@ -523,3 +861,21 @@ func (d *ProjBusinessDao) LockShared() *ProjBusinessDao {
|
|
|
func (d *ProjBusinessDao) Unscoped() *ProjBusinessDao {
|
|
|
return &ProjBusinessDao{M: d.M.Unscoped()}
|
|
|
}
|
|
|
+
|
|
|
+// DataScope enables the DataScope feature.
|
|
|
+func (d *ProjBusinessDao) DataScope(userCol ...string) *ProjBusinessDao {
|
|
|
+ ctx := d.GetCtx().Value("contextService")
|
|
|
+ dataScope := gconv.Map(ctx)["dataScope"].(g.Map)
|
|
|
+ if dataScope != nil {
|
|
|
+ if userIds, ok := dataScope["userIds"]; ok {
|
|
|
+ column := "created_by"
|
|
|
+ if len(userCol) == 1 {
|
|
|
+ column = userCol[0]
|
|
|
+ }
|
|
|
+ delete(dataScope, "userIds")
|
|
|
+ dataScope[column] = userIds
|
|
|
+ }
|
|
|
+ return &ProjBusinessDao{M: d.M.Where(dataScope)}
|
|
|
+ }
|
|
|
+ return d
|
|
|
+}
|