6
0

consequent_detail.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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/database/gdb"
  9. "github.com/gogf/gf/frame/g"
  10. "github.com/gogf/gf/frame/gmvc"
  11. "time"
  12. "lims_adapter/model"
  13. )
  14. // ConsequentDetailDao is the manager for logic model data accessing
  15. // and custom defined data operations functions management.
  16. type ConsequentDetailDao struct {
  17. gmvc.M
  18. DB gdb.DB
  19. Table string
  20. Columns consequentDetailColumns
  21. }
  22. // ConsequentDetailColumns defines and stores column names for table consequent_detail.
  23. type consequentDetailColumns struct {
  24. Id string // 主键ID
  25. CreatedBy string // 创建人
  26. CreatedAt string // 创建时间
  27. UpdatedBy string // 更新人
  28. UpdatedAt string // 更新时间
  29. DeletedAt string // 删除时间
  30. CreatedById string // 创建人ID
  31. UpdatedById string // 更新人ID
  32. ConsequentId string // 成果ID
  33. HonorName string // 获奖名称
  34. HonorTime string // 获奖日期
  35. HonorOrganization string // 颁奖单位
  36. HonorLevel string // 获奖级别
  37. HonorOwner string // 获奖人员
  38. SocietyDepartment string // 学会任职科室
  39. SocietyExpertName string // 专家姓名
  40. SocietyOrganization string // 任职学术机构名称
  41. SocietyPosition string // 担任职务
  42. SocietyArea string // 机构所在地区
  43. SocietyYears string // 任职年限
  44. SocietyElectionTime string // 职务当选时间
  45. SocietyNature string // 是否科协所属
  46. SocietyType string // 院内学会类别
  47. SocietyOrganizationLevel string // 院内级别
  48. SocietyPositionLevel string // 职务类别
  49. SocietyOfFirst string // 归属一级学会
  50. SocietySecondary string // 二级学会
  51. ProjectName string // 项目名称
  52. ProjectLevel string // 级别
  53. ProjectType string // 项目类别
  54. ProjectTime string // 资助时间
  55. ProjectFund string // 经费
  56. ProjectManager string // 负责人
  57. ProjectParticipant string // 参与者
  58. PaperTopic string // 论文题目
  59. PaperAuthor string // 作者
  60. PaperCorrespondingAuthor string // 通讯作者
  61. PaperIssuingTime string // 发表时间
  62. PaperVolume string // 卷期
  63. PaperPage string // 页码
  64. PaperMagazineName string // 杂志名称
  65. PaperSubsidyFund string // 资助基金
  66. PatentName string // 专利名称
  67. PatentAuthor string // 申请人
  68. PatentAuthorizationTime string // 授权时间
  69. }
  70. var (
  71. // ConsequentDetail is globally public accessible object for table consequent_detail operations.
  72. ConsequentDetail = ConsequentDetailDao{
  73. M: g.DB("default").Model("consequent_detail").Safe(),
  74. DB: g.DB("default"),
  75. Table: "consequent_detail",
  76. Columns: consequentDetailColumns{
  77. Id: "Id",
  78. CreatedBy: "CreatedBy",
  79. CreatedAt: "CreatedAt",
  80. UpdatedBy: "UpdatedBy",
  81. UpdatedAt: "UpdatedAt",
  82. DeletedAt: "DeletedAt",
  83. CreatedById: "CreatedById",
  84. UpdatedById: "UpdatedById",
  85. ConsequentId: "ConsequentId",
  86. HonorName: "HonorName",
  87. HonorTime: "HonorTime",
  88. HonorOrganization: "HonorOrganization",
  89. HonorLevel: "HonorLevel",
  90. HonorOwner: "HonorOwner",
  91. SocietyDepartment: "SocietyDepartment",
  92. SocietyExpertName: "SocietyExpertName",
  93. SocietyOrganization: "SocietyOrganization",
  94. SocietyPosition: "SocietyPosition",
  95. SocietyArea: "SocietyArea",
  96. SocietyYears: "SocietyYears",
  97. SocietyElectionTime: "SocietyElectionTime",
  98. SocietyNature: "SocietyNature",
  99. SocietyType: "SocietyType",
  100. SocietyOrganizationLevel: "SocietyOrganizationLevel",
  101. SocietyPositionLevel: "SocietyPositionLevel",
  102. SocietyOfFirst: "SocietyOfFirst",
  103. SocietySecondary: "SocietySecondary",
  104. ProjectName: "ProjectName",
  105. ProjectLevel: "ProjectLevel",
  106. ProjectType: "ProjectType",
  107. ProjectTime: "ProjectTime",
  108. ProjectFund: "ProjectFund",
  109. ProjectManager: "ProjectManager",
  110. ProjectParticipant: "ProjectParticipant",
  111. PaperTopic: "PaperTopic",
  112. PaperAuthor: "PaperAuthor",
  113. PaperCorrespondingAuthor: "PaperCorrespondingAuthor",
  114. PaperIssuingTime: "PaperIssuingTime",
  115. PaperVolume: "PaperVolume",
  116. PaperPage: "PaperPage",
  117. PaperMagazineName: "PaperMagazineName",
  118. PaperSubsidyFund: "PaperSubsidyFund",
  119. PatentName: "PatentName",
  120. PatentAuthor: "PatentAuthor",
  121. PatentAuthorizationTime: "PatentAuthorizationTime",
  122. },
  123. }
  124. )
  125. func NewConsequentDetailDao(tenant string) ConsequentDetailDao {
  126. var dao ConsequentDetailDao
  127. dao = ConsequentDetailDao{
  128. M: g.DB(tenant).Model("consequent_detail").Safe(),
  129. DB: g.DB(tenant),
  130. Table: "consequent_detail",
  131. Columns: consequentDetailColumns{
  132. Id: "Id",
  133. CreatedBy: "CreatedBy",
  134. CreatedAt: "CreatedAt",
  135. UpdatedBy: "UpdatedBy",
  136. UpdatedAt: "UpdatedAt",
  137. DeletedAt: "DeletedAt",
  138. CreatedById: "CreatedById",
  139. UpdatedById: "UpdatedById",
  140. ConsequentId: "ConsequentId",
  141. HonorName: "HonorName",
  142. HonorTime: "HonorTime",
  143. HonorOrganization: "HonorOrganization",
  144. HonorLevel: "HonorLevel",
  145. HonorOwner: "HonorOwner",
  146. SocietyDepartment: "SocietyDepartment",
  147. SocietyExpertName: "SocietyExpertName",
  148. SocietyOrganization: "SocietyOrganization",
  149. SocietyPosition: "SocietyPosition",
  150. SocietyArea: "SocietyArea",
  151. SocietyYears: "SocietyYears",
  152. SocietyElectionTime: "SocietyElectionTime",
  153. SocietyNature: "SocietyNature",
  154. SocietyType: "SocietyType",
  155. SocietyOrganizationLevel: "SocietyOrganizationLevel",
  156. SocietyPositionLevel: "SocietyPositionLevel",
  157. SocietyOfFirst: "SocietyOfFirst",
  158. SocietySecondary: "SocietySecondary",
  159. ProjectName: "ProjectName",
  160. ProjectLevel: "ProjectLevel",
  161. ProjectType: "ProjectType",
  162. ProjectTime: "ProjectTime",
  163. ProjectFund: "ProjectFund",
  164. ProjectManager: "ProjectManager",
  165. ProjectParticipant: "ProjectParticipant",
  166. PaperTopic: "PaperTopic",
  167. PaperAuthor: "PaperAuthor",
  168. PaperCorrespondingAuthor: "PaperCorrespondingAuthor",
  169. PaperIssuingTime: "PaperIssuingTime",
  170. PaperVolume: "PaperVolume",
  171. PaperPage: "PaperPage",
  172. PaperMagazineName: "PaperMagazineName",
  173. PaperSubsidyFund: "PaperSubsidyFund",
  174. PatentName: "PatentName",
  175. PatentAuthor: "PatentAuthor",
  176. PatentAuthorizationTime: "PatentAuthorizationTime",
  177. },
  178. }
  179. return dao
  180. }
  181. // Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
  182. // of current DB object and with given context in it.
  183. // Note that this returned DB object can be used only once, so do not assign it to
  184. // a global or package variable for long using.
  185. func (d *ConsequentDetailDao) Ctx(ctx context.Context) *ConsequentDetailDao {
  186. return &ConsequentDetailDao{M: d.M.Ctx(ctx)}
  187. }
  188. // As sets an alias name for current table.
  189. func (d *ConsequentDetailDao) As(as string) *ConsequentDetailDao {
  190. return &ConsequentDetailDao{M: d.M.As(as)}
  191. }
  192. // TX sets the transaction for current operation.
  193. func (d *ConsequentDetailDao) TX(tx *gdb.TX) *ConsequentDetailDao {
  194. return &ConsequentDetailDao{M: d.M.TX(tx)}
  195. }
  196. // Master marks the following operation on master node.
  197. func (d *ConsequentDetailDao) Master() *ConsequentDetailDao {
  198. return &ConsequentDetailDao{M: d.M.Master()}
  199. }
  200. // Slave marks the following operation on slave node.
  201. // Note that it makes sense only if there's any slave node configured.
  202. func (d *ConsequentDetailDao) Slave() *ConsequentDetailDao {
  203. return &ConsequentDetailDao{M: d.M.Slave()}
  204. }
  205. // Args sets custom arguments for model operation.
  206. func (d *ConsequentDetailDao) Args(args ...interface{}) *ConsequentDetailDao {
  207. return &ConsequentDetailDao{M: d.M.Args(args...)}
  208. }
  209. // LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
  210. // The parameter <table> can be joined table and its joined condition,
  211. // and also with its alias name, like:
  212. // Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
  213. // Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
  214. func (d *ConsequentDetailDao) LeftJoin(table ...string) *ConsequentDetailDao {
  215. return &ConsequentDetailDao{M: d.M.LeftJoin(table...)}
  216. }
  217. // RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
  218. // The parameter <table> can be joined table and its joined condition,
  219. // and also with its alias name, like:
  220. // Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
  221. // Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
  222. func (d *ConsequentDetailDao) RightJoin(table ...string) *ConsequentDetailDao {
  223. return &ConsequentDetailDao{M: d.M.RightJoin(table...)}
  224. }
  225. // InnerJoin does "INNER JOIN ... ON ..." statement on the model.
  226. // The parameter <table> can be joined table and its joined condition,
  227. // and also with its alias name, like:
  228. // Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
  229. // Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
  230. func (d *ConsequentDetailDao) InnerJoin(table ...string) *ConsequentDetailDao {
  231. return &ConsequentDetailDao{M: d.M.InnerJoin(table...)}
  232. }
  233. // Fields sets the operation fields of the model, multiple fields joined using char ','.
  234. // The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
  235. func (d *ConsequentDetailDao) Fields(fieldNamesOrMapStruct ...interface{}) *ConsequentDetailDao {
  236. return &ConsequentDetailDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
  237. }
  238. // FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
  239. // The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
  240. func (d *ConsequentDetailDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ConsequentDetailDao {
  241. return &ConsequentDetailDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
  242. }
  243. // Option sets the extra operation option for the model.
  244. func (d *ConsequentDetailDao) Option(option int) *ConsequentDetailDao {
  245. return &ConsequentDetailDao{M: d.M.Option(option)}
  246. }
  247. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  248. // the data and where attributes for empty values.
  249. func (d *ConsequentDetailDao) OmitEmpty() *ConsequentDetailDao {
  250. return &ConsequentDetailDao{M: d.M.OmitEmpty()}
  251. }
  252. // Filter marks filtering the fields which does not exist in the fields of the operated table.
  253. func (d *ConsequentDetailDao) Filter() *ConsequentDetailDao {
  254. return &ConsequentDetailDao{M: d.M.Filter()}
  255. }
  256. // Where sets the condition statement for the model. The parameter <where> can be type of
  257. // string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
  258. // multiple conditions will be joined into where statement using "AND".
  259. // Eg:
  260. // Where("uid=10000")
  261. // Where("uid", 10000)
  262. // Where("money>? AND name like ?", 99999, "vip_%")
  263. // Where("uid", 1).Where("name", "john")
  264. // Where("status IN (?)", g.Slice{1,2,3})
  265. // Where("age IN(?,?)", 18, 50)
  266. // Where(User{ Id : 1, UserName : "john"})
  267. func (d *ConsequentDetailDao) Where(where interface{}, args ...interface{}) *ConsequentDetailDao {
  268. return &ConsequentDetailDao{M: d.M.Where(where, args...)}
  269. }
  270. // WherePri does the same logic as M.Where except that if the parameter <where>
  271. // is a single condition like int/string/float/slice, it treats the condition as the primary
  272. // key value. That is, if primary key is "id" and given <where> parameter as "123", the
  273. // WherePri function treats the condition as "id=123", but M.Where treats the condition
  274. // as string "123".
  275. func (d *ConsequentDetailDao) WherePri(where interface{}, args ...interface{}) *ConsequentDetailDao {
  276. return &ConsequentDetailDao{M: d.M.WherePri(where, args...)}
  277. }
  278. // And adds "AND" condition to the where statement.
  279. func (d *ConsequentDetailDao) And(where interface{}, args ...interface{}) *ConsequentDetailDao {
  280. return &ConsequentDetailDao{M: d.M.And(where, args...)}
  281. }
  282. // Or adds "OR" condition to the where statement.
  283. func (d *ConsequentDetailDao) Or(where interface{}, args ...interface{}) *ConsequentDetailDao {
  284. return &ConsequentDetailDao{M: d.M.Or(where, args...)}
  285. }
  286. // Group sets the "GROUP BY" statement for the model.
  287. func (d *ConsequentDetailDao) Group(groupBy string) *ConsequentDetailDao {
  288. return &ConsequentDetailDao{M: d.M.Group(groupBy)}
  289. }
  290. // Order sets the "ORDER BY" statement for the model.
  291. func (d *ConsequentDetailDao) Order(orderBy ...string) *ConsequentDetailDao {
  292. return &ConsequentDetailDao{M: d.M.Order(orderBy...)}
  293. }
  294. // Limit sets the "LIMIT" statement for the model.
  295. // The parameter <limit> can be either one or two number, if passed two number is passed,
  296. // it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
  297. // statement.
  298. func (d *ConsequentDetailDao) Limit(limit ...int) *ConsequentDetailDao {
  299. return &ConsequentDetailDao{M: d.M.Limit(limit...)}
  300. }
  301. // Offset sets the "OFFSET" statement for the model.
  302. // It only makes sense for some databases like SQLServer, PostgreSQL, etc.
  303. func (d *ConsequentDetailDao) Offset(offset int) *ConsequentDetailDao {
  304. return &ConsequentDetailDao{M: d.M.Offset(offset)}
  305. }
  306. // Page sets the paging number for the model.
  307. // The parameter <page> is started from 1 for paging.
  308. // Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
  309. func (d *ConsequentDetailDao) Page(page, limit int) *ConsequentDetailDao {
  310. return &ConsequentDetailDao{M: d.M.Page(page, limit)}
  311. }
  312. // Batch sets the batch operation number for the model.
  313. func (d *ConsequentDetailDao) Batch(batch int) *ConsequentDetailDao {
  314. return &ConsequentDetailDao{M: d.M.Batch(batch)}
  315. }
  316. // Cache sets the cache feature for the model. It caches the result of the sql, which means
  317. // if there's another same sql request, it just reads and returns the result from cache, it
  318. // but not committed and executed into the database.
  319. //
  320. // If the parameter <duration> < 0, which means it clear the cache with given <name>.
  321. // If the parameter <duration> = 0, which means it never expires.
  322. // If the parameter <duration> > 0, which means it expires after <duration>.
  323. //
  324. // The optional parameter <name> is used to bind a name to the cache, which means you can later
  325. // control the cache like changing the <duration> or clearing the cache with specified <name>.
  326. //
  327. // Note that, the cache feature is disabled if the model is operating on a transaction.
  328. func (d *ConsequentDetailDao) Cache(duration time.Duration, name ...string) *ConsequentDetailDao {
  329. return &ConsequentDetailDao{M: d.M.Cache(duration, name...)}
  330. }
  331. // Data sets the operation data for the model.
  332. // The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
  333. // Eg:
  334. // Data("uid=10000")
  335. // Data("uid", 10000)
  336. // Data(g.Map{"uid": 10000, "name":"john"})
  337. // Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
  338. func (d *ConsequentDetailDao) Data(data ...interface{}) *ConsequentDetailDao {
  339. return &ConsequentDetailDao{M: d.M.Data(data...)}
  340. }
  341. // All does "SELECT FROM ..." statement for the model.
  342. // It retrieves the records from table and returns the result as []*model.ConsequentDetail.
  343. // It returns nil if there's no record retrieved with the given conditions from table.
  344. //
  345. // The optional parameter <where> is the same as the parameter of M.Where function,
  346. // see M.Where.
  347. func (d *ConsequentDetailDao) All(where ...interface{}) ([]*model.ConsequentDetail, error) {
  348. all, err := d.M.All(where...)
  349. if err != nil {
  350. return nil, err
  351. }
  352. var entities []*model.ConsequentDetail
  353. if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
  354. return nil, err
  355. }
  356. return entities, nil
  357. }
  358. // One retrieves one record from table and returns the result as *model.ConsequentDetail.
  359. // It returns nil if there's no record retrieved with the given conditions from table.
  360. //
  361. // The optional parameter <where> is the same as the parameter of M.Where function,
  362. // see M.Where.
  363. func (d *ConsequentDetailDao) One(where ...interface{}) (*model.ConsequentDetail, error) {
  364. one, err := d.M.One(where...)
  365. if err != nil {
  366. return nil, err
  367. }
  368. var entity *model.ConsequentDetail
  369. if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
  370. return nil, err
  371. }
  372. return entity, nil
  373. }
  374. // FindOne retrieves and returns a single Record by M.WherePri and M.One.
  375. // Also see M.WherePri and M.One.
  376. func (d *ConsequentDetailDao) FindOne(where ...interface{}) (*model.ConsequentDetail, error) {
  377. one, err := d.M.FindOne(where...)
  378. if err != nil {
  379. return nil, err
  380. }
  381. var entity *model.ConsequentDetail
  382. if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
  383. return nil, err
  384. }
  385. return entity, nil
  386. }
  387. // FindAll retrieves and returns Result by by M.WherePri and M.All.
  388. // Also see M.WherePri and M.All.
  389. func (d *ConsequentDetailDao) FindAll(where ...interface{}) ([]*model.ConsequentDetail, error) {
  390. all, err := d.M.FindAll(where...)
  391. if err != nil {
  392. return nil, err
  393. }
  394. var entities []*model.ConsequentDetail
  395. if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
  396. return nil, err
  397. }
  398. return entities, nil
  399. }
  400. // Struct retrieves one record from table and converts it into given struct.
  401. // The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
  402. // it can create the struct internally during converting.
  403. //
  404. // The optional parameter <where> is the same as the parameter of Model.Where function,
  405. // see Model.Where.
  406. //
  407. // Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
  408. // from table and <pointer> is not nil.
  409. //
  410. // Eg:
  411. // user := new(User)
  412. // err := dao.User.Where("id", 1).Struct(user)
  413. //
  414. // user := (*User)(nil)
  415. // err := dao.User.Where("id", 1).Struct(&user)
  416. func (d *ConsequentDetailDao) Struct(pointer interface{}, where ...interface{}) error {
  417. return d.M.Struct(pointer, where...)
  418. }
  419. // Structs retrieves records from table and converts them into given struct slice.
  420. // The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
  421. // slice internally during converting.
  422. //
  423. // The optional parameter <where> is the same as the parameter of Model.Where function,
  424. // see Model.Where.
  425. //
  426. // Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
  427. // from table and <pointer> is not empty.
  428. //
  429. // Eg:
  430. // users := ([]User)(nil)
  431. // err := dao.User.Structs(&users)
  432. //
  433. // users := ([]*User)(nil)
  434. // err := dao.User.Structs(&users)
  435. func (d *ConsequentDetailDao) Structs(pointer interface{}, where ...interface{}) error {
  436. return d.M.Structs(pointer, where...)
  437. }
  438. // Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
  439. // It calls function Struct if <pointer> is type of *struct/**struct.
  440. // It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
  441. //
  442. // The optional parameter <where> is the same as the parameter of Model.Where function,
  443. // see Model.Where.
  444. //
  445. // Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
  446. //
  447. // Eg:
  448. // user := new(User)
  449. // err := dao.User.Where("id", 1).Scan(user)
  450. //
  451. // user := (*User)(nil)
  452. // err := dao.User.Where("id", 1).Scan(&user)
  453. //
  454. // users := ([]User)(nil)
  455. // err := dao.User.Scan(&users)
  456. //
  457. // users := ([]*User)(nil)
  458. // err := dao.User.Scan(&users)
  459. func (d *ConsequentDetailDao) Scan(pointer interface{}, where ...interface{}) error {
  460. return d.M.Scan(pointer, where...)
  461. }
  462. // Chunk iterates the table with given size and callback function.
  463. func (d *ConsequentDetailDao) Chunk(limit int, callback func(entities []*model.ConsequentDetail, err error) bool) {
  464. d.M.Chunk(limit, func(result gdb.Result, err error) bool {
  465. var entities []*model.ConsequentDetail
  466. err = result.Structs(&entities)
  467. if err == sql.ErrNoRows {
  468. return false
  469. }
  470. return callback(entities, err)
  471. })
  472. }
  473. // LockUpdate sets the lock for update for current operation.
  474. func (d *ConsequentDetailDao) LockUpdate() *ConsequentDetailDao {
  475. return &ConsequentDetailDao{M: d.M.LockUpdate()}
  476. }
  477. // LockShared sets the lock in share mode for current operation.
  478. func (d *ConsequentDetailDao) LockShared() *ConsequentDetailDao {
  479. return &ConsequentDetailDao{M: d.M.LockShared()}
  480. }
  481. // Unscoped enables/disables the soft deleting feature.
  482. func (d *ConsequentDetailDao) Unscoped() *ConsequentDetailDao {
  483. return &ConsequentDetailDao{M: d.M.Unscoped()}
  484. }