From dbd29c8eccf0b0ee5b8b609569bd24b610e1a0b6 Mon Sep 17 00:00:00 2001 From: jiang4869 <1121429190@qq.com> Date: Tue, 4 Jan 2022 18:47:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=86=E9=A1=B5=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/view/genfunc/def.go | 4 +++- data/view/model/def.go | 1 + data/view/model/model.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/view/genfunc/def.go b/data/view/genfunc/def.go index 7b830dc..a6db57d 100755 --- a/data/view/genfunc/def.go +++ b/data/view/genfunc/def.go @@ -258,6 +258,7 @@ func (obj *_{{$obj.StructName}}Mgr) GetByOptions(opts ...Option) (results []*{{$ return } +{{if $obj.IsOutPage}} // SelectPage 分页查询 func (obj *_{{$obj.StructName}}Mgr) SelectPage(page IPage,opts ...Option) (resultPage IPage, err error) { options := options{ @@ -280,6 +281,7 @@ func (obj *_{{$obj.StructName}}Mgr) SelectPage(page IPage,opts ...Option) (resul resultPage.SetRecords(results) return } +{{end}} //////////////////////////enume case //////////////////////////////////////////// @@ -350,7 +352,7 @@ func (obj *_{{$obj.StructName}}Mgr) GetBatchFrom{{$oem.ColStructName}}({{CapLowe } {{end}} {{end}} } }` -genPage = `package {{.PackageName}} + genPage = `package {{.PackageName}} import ( "fmt" diff --git a/data/view/model/def.go b/data/view/model/def.go index 8bf606b..f017c0d 100644 --- a/data/view/model/def.go +++ b/data/view/model/def.go @@ -117,6 +117,7 @@ type funDef struct { Em []EmInfo // index 列表 Primary []FList // primary unique Index []FList // index + IsOutPage bool // 是否开启分页 } // diff --git a/data/view/model/model.go b/data/view/model/model.go index da0ac26..1eda56e 100755 --- a/data/view/model/model.go +++ b/data/view/model/model.go @@ -349,6 +349,7 @@ func (m *_Model) generateFunc() (genOut []GenOutInfo) { // wxw 2021.2.26 17:17 var data funDef data.TableName = tab.Name + data.IsOutPage = config.GetIsOutPage() // 添加分页开关 tab.Name = getTableNameWithPrefix(tab.Name) data.StructName = getCamelName(tab.Name)