proj_business.go 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
  3. // ==========================================================================
  4. package internal
  5. import (
  6. "context"
  7. "database/sql"
  8. "github.com/gogf/gf/container/garray"
  9. "github.com/gogf/gf/database/gdb"
  10. "github.com/gogf/gf/frame/g"
  11. "github.com/gogf/gf/frame/gmvc"
  12. "github.com/gogf/gf/util/gconv"
  13. "strings"
  14. "time"
  15. model "dashoo.cn/micro/app/model/proj"
  16. )
  17. // ProjBusinessDao is the manager for logic model data accessing and custom defined data operations functions management.
  18. type ProjBusinessDao struct {
  19. gmvc.M // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
  20. C projBusinessColumns // C is the short type for Columns, which contains all the column names of Table for convenient usage.
  21. DB gdb.DB // DB is the raw underlying database management object.
  22. Table string // Table is the underlying table name of the DAO.
  23. TableAs string // TableAs is the underlying table alias name of the DAO.
  24. }
  25. // ProjBusinessColumns defines and stores column names for table proj_business.
  26. type projBusinessColumns struct {
  27. Id string // 主键
  28. NboCode string // 项目编码
  29. NboName string // 项目名称
  30. NboStatus string // 项目状态
  31. CustId string // 关联客户
  32. CustName string // 客户名称
  33. CustProvinceId string // 所在省ID
  34. CustProvince string // 所在省
  35. CustCityId string // 所在市ID
  36. CustCity string // 所在市
  37. CustRegionId string // 所在区县ID
  38. CustRegion string // 所在区县
  39. ProductLine string // 产品线
  40. NboType string // 项目级别(A 、B 、C 、成交、储备)
  41. NboPhase string // 项目阶段(暂不起用)
  42. NboSource string // 项目来源
  43. NboBudget string // 项目预算
  44. ApproStatus string // 审批状态(10待提交20审批中30审批通过40审批退回60审批拒绝)
  45. ContactId string // 关联联系人
  46. ContactName string // 联系人姓名
  47. ContactPostion string // 联系人岗位
  48. ContactTelephone string // 联系人电话
  49. MakerId string // 关联决策人
  50. MakerName string // 决策人姓名
  51. MakerDept string // 决策人部门
  52. MakerPost string // 决策人岗位
  53. MakerTelephone string // 决策人电话
  54. SalesModel string // 销售模式(10直销20经销30代理)
  55. SaleId string // 归属销售
  56. SaleName string // 销售姓名
  57. DistributorId string // 经销商/代理商ID
  58. DistributorName string // 经销商/代理商名称
  59. FilingTime string // 项目备案时间
  60. FinalFollowId string // 最新跟进人
  61. FinalFollowName string // 最新跟进人名称
  62. FinalFollowTime string // 最后跟进时间
  63. NextFollowTime string // 下次跟进时间
  64. PlanPurchaseTime string // 计划采购时间
  65. EstTransTime string // 预计成交时间
  66. EstTransPrice string // 预计成交价格
  67. RiskProfile string // 风险情况
  68. Difficulty string // 困难点
  69. Competitor string // 竞争公司
  70. Intervention string // 介入情况
  71. DeptId string // 所属部门ID
  72. DeptName string // 所属部门
  73. IsBig string // 是否为大项目
  74. TechnicalSupportName string // 技术支持人员
  75. TechnicalSupportContent string // 技术支持内容
  76. TechnicalSupportTime string // 技术支持时间
  77. CustomerSatisfaction string // 客户满意度 (10很满意、20满意、30较满意、40一般、50不满意)
  78. ParentReceiver string // 总部对接人
  79. NboBudgetTime string // 项目预算期限
  80. CapitalSource string // 资金来源
  81. ProductSatisfaction string // 产品/方案满足情况
  82. PurchasingWay string // 采购方式
  83. PurchasingTime string // 采购时间
  84. IsAdoptDashoo string // 是否采纳大数技术参数(上传附件)
  85. HistoricalTransactionInfo string // 经销商与客户历史成交信息
  86. DealerSalesId string // 关联经销商销售
  87. DealerSalesName string // 经销商销售人员
  88. Accendant string // 维护部门及人员
  89. ProjConversionTime string // 项目转化时间
  90. ProjConversionReason string // 项目转化原因
  91. Remark string // 备注
  92. CreatedBy string // 创建者
  93. CreatedName string // 创建人
  94. CreatedTime string // 创建时间
  95. UpdatedBy string // 更新者
  96. UpdatedName string // 更新人
  97. UpdatedTime string // 更新时间
  98. DeletedTime string // 删除时间
  99. }
  100. var (
  101. // ProjBusiness is globally public accessible object for table proj_business operations.
  102. ProjBusiness = ProjBusinessDao{
  103. M: g.DB("default").Model("proj_business").Safe(),
  104. DB: g.DB("default"),
  105. Table: "proj_business",
  106. C: projBusinessColumns{
  107. Id: "id",
  108. NboCode: "nbo_code",
  109. NboName: "nbo_name",
  110. NboStatus: "nbo_status",
  111. CustId: "cust_id",
  112. CustName: "cust_name",
  113. CustProvinceId: "cust_province_id",
  114. CustProvince: "cust_province",
  115. CustCityId: "cust_city_id",
  116. CustCity: "cust_city",
  117. CustRegionId: "cust_region_id",
  118. CustRegion: "cust_region",
  119. ProductLine: "product_line",
  120. NboType: "nbo_type",
  121. NboPhase: "nbo_phase",
  122. NboSource: "nbo_source",
  123. NboBudget: "nbo_budget",
  124. ApproStatus: "appro_status",
  125. ContactId: "contact_id",
  126. ContactName: "contact_name",
  127. ContactPostion: "contact_postion",
  128. ContactTelephone: "contact_telephone",
  129. MakerId: "maker_id",
  130. MakerName: "maker_name",
  131. MakerDept: "maker_dept",
  132. MakerPost: "maker_post",
  133. MakerTelephone: "maker_telephone",
  134. SalesModel: "sales_model",
  135. SaleId: "sale_id",
  136. SaleName: "sale_name",
  137. DistributorId: "distributor_id",
  138. DistributorName: "distributor_name",
  139. FilingTime: "filing_time",
  140. FinalFollowId: "final_follow_id",
  141. FinalFollowName: "final_follow_name",
  142. FinalFollowTime: "final_follow_time",
  143. NextFollowTime: "next_follow_time",
  144. PlanPurchaseTime: "plan_purchase_time",
  145. EstTransTime: "est_trans_time",
  146. EstTransPrice: "est_trans_price",
  147. RiskProfile: "risk_profile",
  148. Difficulty: "difficulty",
  149. Competitor: "competitor",
  150. Intervention: "Intervention",
  151. DeptId: "dept_id",
  152. DeptName: "dept_name",
  153. IsBig: "is_big",
  154. TechnicalSupportName: "technical_support_name",
  155. TechnicalSupportContent: "technical_support_content",
  156. TechnicalSupportTime: "technical_support_time",
  157. CustomerSatisfaction: "customer_satisfaction",
  158. ParentReceiver: "parent_receiver",
  159. NboBudgetTime: "nbo_budget_time",
  160. CapitalSource: "capital_source",
  161. ProductSatisfaction: "product_satisfaction",
  162. PurchasingWay: "purchasing_way",
  163. PurchasingTime: "purchasing_time",
  164. IsAdoptDashoo: "is_adopt_dashoo",
  165. HistoricalTransactionInfo: "historical_transaction_info",
  166. DealerSalesId: "dealer_sales_id",
  167. DealerSalesName: "dealer_sales_name",
  168. Accendant: "accendant",
  169. ProjConversionTime: "proj_conversion_time",
  170. ProjConversionReason: "proj_conversion_reason",
  171. Remark: "remark",
  172. CreatedBy: "created_by",
  173. CreatedName: "created_name",
  174. CreatedTime: "created_time",
  175. UpdatedBy: "updated_by",
  176. UpdatedName: "updated_name",
  177. UpdatedTime: "updated_time",
  178. DeletedTime: "deleted_time",
  179. },
  180. }
  181. )
  182. func NewProjBusinessDao(tenant string) ProjBusinessDao {
  183. var dao ProjBusinessDao
  184. dao = ProjBusinessDao{
  185. M: g.DB(tenant).Model("proj_business").Safe(),
  186. DB: g.DB(tenant),
  187. Table: "proj_business",
  188. C: projBusinessColumns{
  189. Id: "id",
  190. NboCode: "nbo_code",
  191. NboName: "nbo_name",
  192. NboStatus: "nbo_status",
  193. CustId: "cust_id",
  194. CustName: "cust_name",
  195. CustProvinceId: "cust_province_id",
  196. CustProvince: "cust_province",
  197. CustCityId: "cust_city_id",
  198. CustCity: "cust_city",
  199. CustRegionId: "cust_region_id",
  200. CustRegion: "cust_region",
  201. ProductLine: "product_line",
  202. NboType: "nbo_type",
  203. NboPhase: "nbo_phase",
  204. NboSource: "nbo_source",
  205. NboBudget: "nbo_budget",
  206. ApproStatus: "appro_status",
  207. ContactId: "contact_id",
  208. ContactName: "contact_name",
  209. ContactPostion: "contact_postion",
  210. ContactTelephone: "contact_telephone",
  211. MakerId: "maker_id",
  212. MakerName: "maker_name",
  213. MakerDept: "maker_dept",
  214. MakerPost: "maker_post",
  215. MakerTelephone: "maker_telephone",
  216. SalesModel: "sales_model",
  217. SaleId: "sale_id",
  218. SaleName: "sale_name",
  219. DistributorId: "distributor_id",
  220. DistributorName: "distributor_name",
  221. FilingTime: "filing_time",
  222. FinalFollowId: "final_follow_id",
  223. FinalFollowName: "final_follow_name",
  224. FinalFollowTime: "final_follow_time",
  225. NextFollowTime: "next_follow_time",
  226. PlanPurchaseTime: "plan_purchase_time",
  227. EstTransTime: "est_trans_time",
  228. EstTransPrice: "est_trans_price",
  229. RiskProfile: "risk_profile",
  230. Difficulty: "difficulty",
  231. Competitor: "competitor",
  232. Intervention: "Intervention",
  233. DeptId: "dept_id",
  234. DeptName: "dept_name",
  235. IsBig: "is_big",
  236. TechnicalSupportName: "technical_support_name",
  237. TechnicalSupportContent: "technical_support_content",
  238. TechnicalSupportTime: "technical_support_time",
  239. CustomerSatisfaction: "customer_satisfaction",
  240. ParentReceiver: "parent_receiver",
  241. NboBudgetTime: "nbo_budget_time",
  242. CapitalSource: "capital_source",
  243. ProductSatisfaction: "product_satisfaction",
  244. PurchasingWay: "purchasing_way",
  245. PurchasingTime: "purchasing_time",
  246. IsAdoptDashoo: "is_adopt_dashoo",
  247. HistoricalTransactionInfo: "historical_transaction_info",
  248. DealerSalesId: "dealer_sales_id",
  249. DealerSalesName: "dealer_sales_name",
  250. Accendant: "accendant",
  251. ProjConversionTime: "proj_conversion_time",
  252. ProjConversionReason: "proj_conversion_reason",
  253. Remark: "remark",
  254. CreatedBy: "created_by",
  255. CreatedName: "created_name",
  256. CreatedTime: "created_time",
  257. UpdatedBy: "updated_by",
  258. UpdatedName: "updated_name",
  259. UpdatedTime: "updated_time",
  260. DeletedTime: "deleted_time",
  261. },
  262. }
  263. return dao
  264. }
  265. // Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
  266. // of current DB object and with given context in it.
  267. // Note that this returned DB object can be used only once, so do not assign it to
  268. // a global or package variable for long using.
  269. func (d *ProjBusinessDao) Ctx(ctx context.Context) *ProjBusinessDao {
  270. return &ProjBusinessDao{M: d.M.Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
  271. }
  272. // GetCtx returns the context for current Model.
  273. // It returns "context.Background() i"s there's no context previously set.
  274. func (d *ProjBusinessDao) GetCtx() context.Context {
  275. return d.M.GetCtx()
  276. }
  277. // As sets an alias name for current table.
  278. func (d *ProjBusinessDao) As(as string) *ProjBusinessDao {
  279. return &ProjBusinessDao{M: d.M.As(as), Table: d.Table, TableAs: as}
  280. }
  281. // TX sets the transaction for current operation.
  282. func (d *ProjBusinessDao) TX(tx *gdb.TX) *ProjBusinessDao {
  283. return &ProjBusinessDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
  284. }
  285. // Master marks the following operation on master node.
  286. func (d *ProjBusinessDao) Master() *ProjBusinessDao {
  287. return &ProjBusinessDao{M: d.M.Master(), Table: d.Table, TableAs: d.TableAs}
  288. }
  289. // Slave marks the following operation on slave node.
  290. // Note that it makes sense only if there's any slave node configured.
  291. func (d *ProjBusinessDao) Slave() *ProjBusinessDao {
  292. return &ProjBusinessDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
  293. }
  294. // Args sets custom arguments for model operation.
  295. func (d *ProjBusinessDao) Args(args ...interface{}) *ProjBusinessDao {
  296. return &ProjBusinessDao{M: d.M.Args(args...), Table: d.Table, TableAs: d.TableAs}
  297. }
  298. // Handler calls each of "handlers" on current Model and returns a new Model.
  299. // ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
  300. func (d *ProjBusinessDao) Handler(handlers ...gdb.ModelHandler) *ProjBusinessDao {
  301. return &ProjBusinessDao{M: d.M.Handler(handlers...), Table: d.Table, TableAs: d.TableAs}
  302. }
  303. // LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
  304. // The parameter <table> can be joined table and its joined condition,
  305. // and also with its alias name, like:
  306. // Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
  307. // Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
  308. func (d *ProjBusinessDao) LeftJoin(table ...string) *ProjBusinessDao {
  309. return &ProjBusinessDao{M: d.M.LeftJoin(table...), Table: d.Table, TableAs: d.TableAs}
  310. }
  311. // RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
  312. // The parameter <table> can be joined table and its joined condition,
  313. // and also with its alias name, like:
  314. // Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
  315. // Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
  316. func (d *ProjBusinessDao) RightJoin(table ...string) *ProjBusinessDao {
  317. return &ProjBusinessDao{M: d.M.RightJoin(table...), Table: d.Table, TableAs: d.TableAs}
  318. }
  319. // InnerJoin does "INNER JOIN ... ON ..." statement on the model.
  320. // The parameter <table> can be joined table and its joined condition,
  321. // and also with its alias name, like:
  322. // Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
  323. // Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
  324. func (d *ProjBusinessDao) InnerJoin(table ...string) *ProjBusinessDao {
  325. return &ProjBusinessDao{M: d.M.InnerJoin(table...), Table: d.Table, TableAs: d.TableAs}
  326. }
  327. // Fields sets the operation fields of the model, multiple fields joined using char ','.
  328. // The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
  329. func (d *ProjBusinessDao) Fields(fieldNamesOrMapStruct ...interface{}) *ProjBusinessDao {
  330. return &ProjBusinessDao{M: d.M.Fields(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
  331. }
  332. // FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
  333. // The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
  334. func (d *ProjBusinessDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ProjBusinessDao {
  335. return &ProjBusinessDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
  336. }
  337. // FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
  338. func (d *ProjBusinessDao) FieldCount(column string, as ...string) *ProjBusinessDao {
  339. return &ProjBusinessDao{M: d.M.FieldCount(column, as...), Table: d.Table, TableAs: d.TableAs}
  340. }
  341. // FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
  342. func (d *ProjBusinessDao) FieldSum(column string, as ...string) *ProjBusinessDao {
  343. return &ProjBusinessDao{M: d.M.FieldSum(column, as...), Table: d.Table, TableAs: d.TableAs}
  344. }
  345. // FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
  346. func (d *ProjBusinessDao) FieldMin(column string, as ...string) *ProjBusinessDao {
  347. return &ProjBusinessDao{M: d.M.FieldMin(column, as...), Table: d.Table, TableAs: d.TableAs}
  348. }
  349. // FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
  350. func (d *ProjBusinessDao) FieldMax(column string, as ...string) *ProjBusinessDao {
  351. return &ProjBusinessDao{M: d.M.FieldMax(column, as...), Table: d.Table, TableAs: d.TableAs}
  352. }
  353. // FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
  354. func (d *ProjBusinessDao) FieldAvg(column string, as ...string) *ProjBusinessDao {
  355. return &ProjBusinessDao{M: d.M.FieldAvg(column, as...), Table: d.Table, TableAs: d.TableAs}
  356. }
  357. // Option adds extra operation option for the model.
  358. // Deprecated, use separate operations instead.
  359. func (d *ProjBusinessDao) Option(option int) *ProjBusinessDao {
  360. return &ProjBusinessDao{M: d.M.Option(option), Table: d.Table, TableAs: d.TableAs}
  361. }
  362. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  363. // the data and where attributes for empty values.
  364. func (d *ProjBusinessDao) OmitEmpty() *ProjBusinessDao {
  365. return &ProjBusinessDao{M: d.M.OmitEmpty(), Table: d.Table, TableAs: d.TableAs}
  366. }
  367. // OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
  368. // the Where/Having parameters for "empty" values.
  369. func (d *ProjBusinessDao) OmitEmptyWhere() *ProjBusinessDao {
  370. return &ProjBusinessDao{M: d.M.OmitEmptyWhere(), Table: d.Table, TableAs: d.TableAs}
  371. }
  372. // OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
  373. // the Data parameters for "empty" values.
  374. func (d *ProjBusinessDao) OmitEmptyData() *ProjBusinessDao {
  375. return &ProjBusinessDao{M: d.M.OmitEmptyData(), Table: d.Table, TableAs: d.TableAs}
  376. }
  377. // OmitNil sets optionOmitNil option for the model, which automatically filers
  378. // the data and where parameters for "nil" values.
  379. func (d *ProjBusinessDao) OmitNil() *ProjBusinessDao {
  380. return &ProjBusinessDao{M: d.M.OmitNil(), Table: d.Table, TableAs: d.TableAs}
  381. }
  382. // OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
  383. // the Where/Having parameters for "nil" values.
  384. func (d *ProjBusinessDao) OmitNilWhere() *ProjBusinessDao {
  385. return &ProjBusinessDao{M: d.M.OmitNilWhere(), Table: d.Table, TableAs: d.TableAs}
  386. }
  387. // OmitNilData sets optionOmitNilData option for the model, which automatically filers
  388. // the Data parameters for "nil" values.
  389. func (d *ProjBusinessDao) OmitNilData() *ProjBusinessDao {
  390. return &ProjBusinessDao{M: d.M.OmitNilData(), Table: d.Table, TableAs: d.TableAs}
  391. }
  392. // Filter marks filtering the fields which does not exist in the fields of the operated table.
  393. // Note that this function supports only single table operations.
  394. // Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
  395. func (d *ProjBusinessDao) Filter() *ProjBusinessDao {
  396. return &ProjBusinessDao{M: d.M.Filter(), Table: d.Table, TableAs: d.TableAs}
  397. }
  398. // Where sets the condition statement for the model. The parameter <where> can be type of
  399. // string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
  400. // multiple conditions will be joined into where statement using "AND".
  401. // Eg:
  402. // Where("uid=10000")
  403. // Where("uid", 10000)
  404. // Where("money>? AND name like ?", 99999, "vip_%")
  405. // Where("uid", 1).Where("name", "john")
  406. // Where("status IN (?)", g.Slice{1,2,3})
  407. // Where("age IN(?,?)", 18, 50)
  408. // Where(User{ Id : 1, UserName : "john"})
  409. func (d *ProjBusinessDao) Where(where interface{}, args ...interface{}) *ProjBusinessDao {
  410. return &ProjBusinessDao{M: d.M.Where(where, args...), Table: d.Table, TableAs: d.TableAs}
  411. }
  412. // WherePri does the same logic as M.Where except that if the parameter <where>
  413. // is a single condition like int/string/float/slice, it treats the condition as the primary
  414. // key value. That is, if primary key is "id" and given <where> parameter as "123", the
  415. // WherePri function treats the condition as "id=123", but M.Where treats the condition
  416. // as string "123".
  417. func (d *ProjBusinessDao) WherePri(where interface{}, args ...interface{}) *ProjBusinessDao {
  418. return &ProjBusinessDao{M: d.M.WherePri(where, args...), Table: d.Table, TableAs: d.TableAs}
  419. }
  420. // Having sets the having statement for the model.
  421. // The parameters of this function usage are as the same as function Where.
  422. // See Where.
  423. func (d *ProjBusinessDao) Having(having interface{}, args ...interface{}) *ProjBusinessDao {
  424. return &ProjBusinessDao{M: d.M.Having(having, args...), Table: d.Table, TableAs: d.TableAs}
  425. }
  426. // Wheref builds condition string using fmt.Sprintf and arguments.
  427. // Note that if the number of "args" is more than the place holder in "format",
  428. // the extra "args" will be used as the where condition arguments of the Model.
  429. func (d *ProjBusinessDao) Wheref(format string, args ...interface{}) *ProjBusinessDao {
  430. return &ProjBusinessDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
  431. }
  432. // WhereLT builds "column < value" statement.
  433. func (d *ProjBusinessDao) WhereLT(column string, value interface{}) *ProjBusinessDao {
  434. return &ProjBusinessDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
  435. }
  436. // WhereLTE builds "column <= value" statement.
  437. func (d *ProjBusinessDao) WhereLTE(column string, value interface{}) *ProjBusinessDao {
  438. return &ProjBusinessDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
  439. }
  440. // WhereGT builds "column > value" statement.
  441. func (d *ProjBusinessDao) WhereGT(column string, value interface{}) *ProjBusinessDao {
  442. return &ProjBusinessDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
  443. }
  444. // WhereGTE builds "column >= value" statement.
  445. func (d *ProjBusinessDao) WhereGTE(column string, value interface{}) *ProjBusinessDao {
  446. return &ProjBusinessDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
  447. }
  448. // WhereBetween builds "column BETWEEN min AND max" statement.
  449. func (d *ProjBusinessDao) WhereBetween(column string, min, max interface{}) *ProjBusinessDao {
  450. return &ProjBusinessDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
  451. }
  452. // WhereLike builds "column LIKE like" statement.
  453. func (d *ProjBusinessDao) WhereLike(column string, like interface{}) *ProjBusinessDao {
  454. return &ProjBusinessDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
  455. }
  456. // WhereIn builds "column IN (in)" statement.
  457. func (d *ProjBusinessDao) WhereIn(column string, in interface{}) *ProjBusinessDao {
  458. return &ProjBusinessDao{M: d.M.WhereIn(column, in), Table: d.Table, TableAs: d.TableAs}
  459. }
  460. // WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
  461. func (d *ProjBusinessDao) WhereNull(columns ...string) *ProjBusinessDao {
  462. return &ProjBusinessDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
  463. }
  464. // WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
  465. func (d *ProjBusinessDao) WhereNotBetween(column string, min, max interface{}) *ProjBusinessDao {
  466. return &ProjBusinessDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
  467. }
  468. // WhereNotLike builds "column NOT LIKE like" statement.
  469. func (d *ProjBusinessDao) WhereNotLike(column string, like interface{}) *ProjBusinessDao {
  470. return &ProjBusinessDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
  471. }
  472. // WhereNot builds "column != value" statement.
  473. func (d *ProjBusinessDao) WhereNot(column string, value interface{}) *ProjBusinessDao {
  474. return &ProjBusinessDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
  475. }
  476. // WhereNotIn builds "column NOT IN (in)" statement.
  477. func (d *ProjBusinessDao) WhereNotIn(column string, in interface{}) *ProjBusinessDao {
  478. return &ProjBusinessDao{M: d.M.WhereNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
  479. }
  480. // WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
  481. func (d *ProjBusinessDao) WhereNotNull(columns ...string) *ProjBusinessDao {
  482. return &ProjBusinessDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
  483. }
  484. // WhereOr adds "OR" condition to the where statement.
  485. func (d *ProjBusinessDao) WhereOr(where interface{}, args ...interface{}) *ProjBusinessDao {
  486. return &ProjBusinessDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
  487. }
  488. // WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
  489. func (d *ProjBusinessDao) WhereOrf(format string, args ...interface{}) *ProjBusinessDao {
  490. return &ProjBusinessDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
  491. }
  492. // WhereOrLT builds "column < value" statement in "OR" conditions..
  493. func (d *ProjBusinessDao) WhereOrLT(column string, value interface{}) *ProjBusinessDao {
  494. return &ProjBusinessDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
  495. }
  496. // WhereOrLTE builds "column <= value" statement in "OR" conditions..
  497. func (d *ProjBusinessDao) WhereOrLTE(column string, value interface{}) *ProjBusinessDao {
  498. return &ProjBusinessDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
  499. }
  500. // WhereOrGT builds "column > value" statement in "OR" conditions..
  501. func (d *ProjBusinessDao) WhereOrGT(column string, value interface{}) *ProjBusinessDao {
  502. return &ProjBusinessDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
  503. }
  504. // WhereOrGTE builds "column >= value" statement in "OR" conditions..
  505. func (d *ProjBusinessDao) WhereOrGTE(column string, value interface{}) *ProjBusinessDao {
  506. return &ProjBusinessDao{M: d.M.WhereOrGTE(column, value), Table: d.Table, TableAs: d.TableAs}
  507. }
  508. // WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
  509. func (d *ProjBusinessDao) WhereOrBetween(column string, min, max interface{}) *ProjBusinessDao {
  510. return &ProjBusinessDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
  511. }
  512. // WhereOrLike builds "column LIKE like" statement in "OR" conditions.
  513. func (d *ProjBusinessDao) WhereOrLike(column string, like interface{}) *ProjBusinessDao {
  514. return &ProjBusinessDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
  515. }
  516. // WhereOrIn builds "column IN (in)" statement in "OR" conditions.
  517. func (d *ProjBusinessDao) WhereOrIn(column string, in interface{}) *ProjBusinessDao {
  518. return &ProjBusinessDao{M: d.M.WhereOrIn(column, in), Table: d.Table, TableAs: d.TableAs}
  519. }
  520. // WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
  521. func (d *ProjBusinessDao) WhereOrNull(columns ...string) *ProjBusinessDao {
  522. return &ProjBusinessDao{M: d.M.WhereOrNull(columns...), Table: d.Table, TableAs: d.TableAs}
  523. }
  524. // WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
  525. func (d *ProjBusinessDao) WhereOrNotBetween(column string, min, max interface{}) *ProjBusinessDao {
  526. return &ProjBusinessDao{M: d.M.WhereOrNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
  527. }
  528. // WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
  529. func (d *ProjBusinessDao) WhereOrNotLike(column string, like interface{}) *ProjBusinessDao {
  530. return &ProjBusinessDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
  531. }
  532. // WhereOrNotIn builds "column NOT IN (in)" statement.
  533. func (d *ProjBusinessDao) WhereOrNotIn(column string, in interface{}) *ProjBusinessDao {
  534. return &ProjBusinessDao{M: d.M.WhereOrNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
  535. }
  536. // WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
  537. func (d *ProjBusinessDao) WhereOrNotNull(columns ...string) *ProjBusinessDao {
  538. return &ProjBusinessDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
  539. }
  540. // Group sets the "GROUP BY" statement for the model.
  541. func (d *ProjBusinessDao) Group(groupBy ...string) *ProjBusinessDao {
  542. return &ProjBusinessDao{M: d.M.Group(groupBy...), Table: d.Table, TableAs: d.TableAs}
  543. }
  544. // And adds "AND" condition to the where statement.
  545. // Deprecated, use Where instead.
  546. func (d *ProjBusinessDao) And(where interface{}, args ...interface{}) *ProjBusinessDao {
  547. return &ProjBusinessDao{M: d.M.And(where, args...), Table: d.Table, TableAs: d.TableAs}
  548. }
  549. // Or adds "OR" condition to the where statement.
  550. // Deprecated, use WhereOr instead.
  551. func (d *ProjBusinessDao) Or(where interface{}, args ...interface{}) *ProjBusinessDao {
  552. return &ProjBusinessDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
  553. }
  554. // GroupBy sets the "GROUP BY" statement for the model.
  555. func (d *ProjBusinessDao) GroupBy(groupBy string) *ProjBusinessDao {
  556. return &ProjBusinessDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
  557. }
  558. // Order sets the "ORDER BY" statement for the model.
  559. func (d *ProjBusinessDao) Order(orderBy ...string) *ProjBusinessDao {
  560. return &ProjBusinessDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
  561. }
  562. // OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
  563. func (d *ProjBusinessDao) OrderAsc(column string) *ProjBusinessDao {
  564. return &ProjBusinessDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
  565. }
  566. // OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
  567. func (d *ProjBusinessDao) OrderDesc(column string) *ProjBusinessDao {
  568. return &ProjBusinessDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
  569. }
  570. // OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
  571. func (d *ProjBusinessDao) OrderRandom() *ProjBusinessDao {
  572. return &ProjBusinessDao{M: d.M.OrderRandom(), Table: d.Table, TableAs: d.TableAs}
  573. }
  574. // OrderBy is alias of Model.Order.
  575. // See Model.Order.
  576. // Deprecated, use Order instead.
  577. func (d *ProjBusinessDao) OrderBy(orderBy string) *ProjBusinessDao {
  578. return &ProjBusinessDao{M: d.M.Order(orderBy), Table: d.Table, TableAs: d.TableAs}
  579. }
  580. // Limit sets the "LIMIT" statement for the model.
  581. // The parameter <limit> can be either one or two number, if passed two number is passed,
  582. // it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
  583. // statement.
  584. func (d *ProjBusinessDao) Limit(limit ...int) *ProjBusinessDao {
  585. return &ProjBusinessDao{M: d.M.Limit(limit...), Table: d.Table, TableAs: d.TableAs}
  586. }
  587. // Offset sets the "OFFSET" statement for the model.
  588. // It only makes sense for some databases like SQLServer, PostgreSQL, etc.
  589. func (d *ProjBusinessDao) Offset(offset int) *ProjBusinessDao {
  590. return &ProjBusinessDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
  591. }
  592. // Distinct forces the query to only return distinct results.
  593. func (d *ProjBusinessDao) Distinct() *ProjBusinessDao {
  594. return &ProjBusinessDao{M: d.M.Distinct(), Table: d.Table, TableAs: d.TableAs}
  595. }
  596. // Page sets the paging number for the model.
  597. // The parameter <page> is started from 1 for paging.
  598. // Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
  599. func (d *ProjBusinessDao) Page(page, limit int) *ProjBusinessDao {
  600. return &ProjBusinessDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
  601. }
  602. // Batch sets the batch operation number for the model.
  603. func (d *ProjBusinessDao) Batch(batch int) *ProjBusinessDao {
  604. return &ProjBusinessDao{M: d.M.Batch(batch), Table: d.Table, TableAs: d.TableAs}
  605. }
  606. // Cache sets the cache feature for the model. It caches the result of the sql, which means
  607. // if there's another same sql request, it just reads and returns the result from cache, it
  608. // but not committed and executed into the database.
  609. //
  610. // If the parameter <duration> < 0, which means it clear the cache with given <name>.
  611. // If the parameter <duration> = 0, which means it never expires.
  612. // If the parameter <duration> > 0, which means it expires after <duration>.
  613. //
  614. // The optional parameter <name> is used to bind a name to the cache, which means you can later
  615. // control the cache like changing the <duration> or clearing the cache with specified <name>.
  616. //
  617. // Note that, the cache feature is disabled if the model is operating on a transaction.
  618. func (d *ProjBusinessDao) Cache(duration time.Duration, name ...string) *ProjBusinessDao {
  619. return &ProjBusinessDao{M: d.M.Cache(duration, name...), Table: d.Table, TableAs: d.TableAs}
  620. }
  621. // Data sets the operation data for the model.
  622. // The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
  623. // Eg:
  624. // Data("uid=10000")
  625. // Data("uid", 10000)
  626. // Data(g.Map{"uid": 10000, "name":"john"})
  627. // Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
  628. func (d *ProjBusinessDao) Data(data ...interface{}) *ProjBusinessDao {
  629. return &ProjBusinessDao{M: d.M.Data(data...), Table: d.Table, TableAs: d.TableAs}
  630. }
  631. // All does "SELECT FROM ..." statement for the model.
  632. // It retrieves the records from table and returns the result as []*model.ProjBusiness.
  633. // It returns nil if there's no record retrieved with the given conditions from table.
  634. //
  635. // The optional parameter <where> is the same as the parameter of M.Where function,
  636. // see M.Where.
  637. func (d *ProjBusinessDao) All(where ...interface{}) ([]*model.ProjBusiness, error) {
  638. all, err := d.M.All(where...)
  639. if err != nil {
  640. return nil, err
  641. }
  642. var entities []*model.ProjBusiness
  643. if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
  644. return nil, err
  645. }
  646. return entities, nil
  647. }
  648. // One retrieves one record from table and returns the result as *model.ProjBusiness.
  649. // It returns nil if there's no record retrieved with the given conditions from table.
  650. //
  651. // The optional parameter <where> is the same as the parameter of M.Where function,
  652. // see M.Where.
  653. func (d *ProjBusinessDao) One(where ...interface{}) (*model.ProjBusiness, error) {
  654. one, err := d.M.One(where...)
  655. if err != nil {
  656. return nil, err
  657. }
  658. var entity *model.ProjBusiness
  659. if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
  660. return nil, err
  661. }
  662. return entity, nil
  663. }
  664. // FindOne retrieves and returns a single Record by M.WherePri and M.One.
  665. // Also see M.WherePri and M.One.
  666. func (d *ProjBusinessDao) FindOne(where ...interface{}) (*model.ProjBusiness, error) {
  667. one, err := d.M.FindOne(where...)
  668. if err != nil {
  669. return nil, err
  670. }
  671. var entity *model.ProjBusiness
  672. if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
  673. return nil, err
  674. }
  675. return entity, nil
  676. }
  677. // FindAll retrieves and returns Result by by M.WherePri and M.All.
  678. // Also see M.WherePri and M.All.
  679. func (d *ProjBusinessDao) FindAll(where ...interface{}) ([]*model.ProjBusiness, error) {
  680. all, err := d.M.FindAll(where...)
  681. if err != nil {
  682. return nil, err
  683. }
  684. var entities []*model.ProjBusiness
  685. if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
  686. return nil, err
  687. }
  688. return entities, nil
  689. }
  690. // Struct retrieves one record from table and converts it into given struct.
  691. // The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
  692. // it can create the struct internally during converting.
  693. //
  694. // The optional parameter <where> is the same as the parameter of Model.Where function,
  695. // see Model.Where.
  696. //
  697. // Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
  698. // from table and <pointer> is not nil.
  699. //
  700. // Eg:
  701. // user := new(User)
  702. // err := dao.User.Where("id", 1).Struct(user)
  703. //
  704. // user := (*User)(nil)
  705. // err := dao.User.Where("id", 1).Struct(&user)
  706. func (d *ProjBusinessDao) Struct(pointer interface{}, where ...interface{}) error {
  707. return d.M.Struct(pointer, where...)
  708. }
  709. // Structs retrieves records from table and converts them into given struct slice.
  710. // The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
  711. // slice internally during converting.
  712. //
  713. // The optional parameter <where> is the same as the parameter of Model.Where function,
  714. // see Model.Where.
  715. //
  716. // Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
  717. // from table and <pointer> is not empty.
  718. //
  719. // Eg:
  720. // users := ([]User)(nil)
  721. // err := dao.User.Structs(&users)
  722. //
  723. // users := ([]*User)(nil)
  724. // err := dao.User.Structs(&users)
  725. func (d *ProjBusinessDao) Structs(pointer interface{}, where ...interface{}) error {
  726. return d.M.Structs(pointer, where...)
  727. }
  728. // Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
  729. // It calls function Struct if <pointer> is type of *struct/**struct.
  730. // It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
  731. //
  732. // The optional parameter <where> is the same as the parameter of Model.Where function,
  733. // see Model.Where.
  734. //
  735. // Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
  736. //
  737. // Eg:
  738. // user := new(User)
  739. // err := dao.User.Where("id", 1).Scan(user)
  740. //
  741. // user := (*User)(nil)
  742. // err := dao.User.Where("id", 1).Scan(&user)
  743. //
  744. // users := ([]User)(nil)
  745. // err := dao.User.Scan(&users)
  746. //
  747. // users := ([]*User)(nil)
  748. // err := dao.User.Scan(&users)
  749. func (d *ProjBusinessDao) Scan(pointer interface{}, where ...interface{}) error {
  750. return d.M.Scan(pointer, where...)
  751. }
  752. // Chunk iterates the table with given size and callback function.
  753. func (d *ProjBusinessDao) Chunk(limit int, callback func(entities []*model.ProjBusiness, err error) bool) {
  754. d.M.Chunk(limit, func(result gdb.Result, err error) bool {
  755. var entities []*model.ProjBusiness
  756. err = result.Structs(&entities)
  757. if err == sql.ErrNoRows {
  758. return false
  759. }
  760. return callback(entities, err)
  761. })
  762. }
  763. // LockUpdate sets the lock for update for current operation.
  764. func (d *ProjBusinessDao) LockUpdate() *ProjBusinessDao {
  765. return &ProjBusinessDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
  766. }
  767. // LockShared sets the lock in share mode for current operation.
  768. func (d *ProjBusinessDao) LockShared() *ProjBusinessDao {
  769. return &ProjBusinessDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
  770. }
  771. // Unscoped enables/disables the soft deleting feature.
  772. func (d *ProjBusinessDao) Unscoped() *ProjBusinessDao {
  773. return &ProjBusinessDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
  774. }
  775. // DataScope enables the DataScope feature.
  776. func (d *ProjBusinessDao) DataScope(ctx context.Context, userCol ...string) *ProjBusinessDao {
  777. cs := ctx.Value("contextService")
  778. dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
  779. if dataScope != nil {
  780. tableAs := d.TableAs
  781. if d.TableAs != "" {
  782. tableAs += "."
  783. }
  784. userIds, ok := dataScope["userIds"]
  785. delete(dataScope, "userIds")
  786. var orColumns []string
  787. var orValues []interface{}
  788. if ok && userIds != "-1" {
  789. column := "created_by"
  790. if len(userCol) == 1 {
  791. column = userCol[0]
  792. }
  793. if ok, _ := d.M.HasField(column); ok {
  794. orColumns = append(orColumns, tableAs+column+" IN (?) ")
  795. orValues = append(orValues, userIds)
  796. }
  797. }
  798. // 销售工程师判断
  799. var salesEngineerFlag bool
  800. if roles, ok := dataScope["roles"]; ok {
  801. arr := garray.NewArrayFrom(roles.([]interface{}), true)
  802. if arr.Len() == 1 && arr.Contains("SalesEngineer") {
  803. salesEngineerFlag = true
  804. }
  805. }
  806. // 非销售工程师权限加成
  807. if !salesEngineerFlag {
  808. bigColumns := "is_big"
  809. if ok, _ := d.M.HasField("is_big"); ok {
  810. if val, ok := dataScope[bigColumns]; ok && val != "" {
  811. orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
  812. orValues = append(orValues, val)
  813. }
  814. delete(dataScope, bigColumns)
  815. }
  816. var andColumns []string
  817. var andValues []interface{}
  818. for k, v := range dataScope {
  819. if ok, _ := d.M.HasField(k); ok {
  820. andColumns = append(andColumns, tableAs+k+" IN (?) ")
  821. andValues = append(andValues, v)
  822. }
  823. }
  824. if len(andColumns) > 0 {
  825. andWhereSql := strings.Join(andColumns, " AND ")
  826. orColumns = append(orColumns, "("+andWhereSql+")")
  827. orValues = append(orValues, andValues...)
  828. }
  829. }
  830. whereSql := strings.Join(orColumns, " OR ")
  831. return &ProjBusinessDao{M: d.M.Where(whereSql, orValues...).Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
  832. }
  833. return d
  834. }