Skip to content

Commit

Permalink
gobatis-cmd自动生成model操作数据库方法
Browse files Browse the repository at this point in the history
  • Loading branch information
xfali committed Feb 20, 2020
1 parent 83b8a82 commit f007b00
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions test/cmd/test_table.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
//This file was generated by xfali/gobatis-cmd at
//2020-02-20 15:03:12.9833677 +0800 CST m=+0.049373301
//2020-02-20 15:55:57.3524245 +0800 CST m=+0.049892501

package test

import "time"
import (
"github.com/xfali/gobatis"
"time"
)

type TestTable struct {
//TableName gobatis.ModelName `test_table`
Id int `xfield:"id"`
Username string `xfield:"username"`
Password string `xfield:"password"`
Createtime time.Time `xfield:"createtime"`
//TableName gobatis.ModelName `test_table`
Id int `xfield:"id"`
Username string `xfield:"username"`
Password string `xfield:"password"`
Createtime time.Time `xfield:"createtime"`
}

func (m *TestTable) Select(sess *gobatis.Session) ([]TestTable, error) {
return SelectTestTable(sess, *m)
}

func (m *TestTable) Count(sess *gobatis.Session) (int64, error) {
return SelectTestTableCount(sess, *m)
}

func (m *TestTable) Insert(sess *gobatis.Session) (int64, int64, error) {
return InsertTestTable(sess, *m)
}

func (m *TestTable) Update(sess *gobatis.Session) (int64, error) {
return UpdateTestTable(sess, *m)
}

func (m *TestTable) Delete(sess *gobatis.Session) (int64, error) {
return DeleteTestTable(sess, *m)
}

0 comments on commit f007b00

Please sign in to comment.