胡轶钦 6 anni fa
parent
commit
4fa8b41787

+ 21
- 0
models/booktype/booktype.go Vedi File

@@ -0,0 +1,21 @@
1
+package booktype
2
+
3
+import (
4
+	"spaceofcheng/services/utils"
5
+
6
+	"github.com/go-xorm/xorm"
7
+)
8
+
9
+// BooktypeDAO 当前数据库操作对象
10
+type BooktypeDAO struct {
11
+	ctx *utils.Context
12
+	db  *xorm.Session
13
+}
14
+
15
+// NewBooktypeDAO New Inst
16
+func NewBooktypeDAO(ctx *utils.Context) *BooktypeDAO {
17
+	return &BooktypeDAO{
18
+		ctx: ctx,
19
+		db:  ctx.DB,
20
+	}
21
+}

+ 24
- 0
models/model/ta_book.go Vedi File

@@ -0,0 +1,24 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaBook struct {
8
+	BookId          string    `xorm:"not null pk VARCHAR(64)"`
9
+	BookTypeId      string    `xorm:"VARCHAR(64)"`
10
+	BookName        string    `xorm:"VARCHAR(64)"`
11
+	BookBarcode     string    `xorm:"VARCHAR(64)"`
12
+	BookImg         string    `xorm:"TEXT"`
13
+	Author          string    `xorm:"VARCHAR(32)"`
14
+	Publisher       string    `xorm:"VARCHAR(64)"`
15
+	Price           string    `xorm:"DECIMAL(64)"`
16
+	InStock         int       `xorm:"INT(11)"`
17
+	LeftNum         int       `xorm:"INT(11)"`
18
+	BorrowNum       int       `xorm:"INT(11)"`
19
+	BookDescription string    `xorm:"TEXT"`
20
+	Status          int       `xorm:"SMALLINT(6)"`
21
+	CaseId          string    `xorm:"VARCHAR(64)"`
22
+	OrgId           string    `xorm:"VARCHAR(64)"`
23
+	CreateDate      time.Time `xorm:"DATETIME"`
24
+}

+ 19
- 0
models/model/ta_book_borrow_record.go Vedi File

@@ -0,0 +1,19 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaBookBorrowRecord struct {
8
+	BookBorrowRecordId string    `xorm:"not null pk VARCHAR(64)"`
9
+	BookId             string    `xorm:"VARCHAR(64)"`
10
+	CustomerId         string    `xorm:"VARCHAR(64)"`
11
+	CustomerName       string    `xorm:"VARCHAR(32)"`
12
+	CustomerPhone      string    `xorm:"VARCHAR(32)"`
13
+	BorrowDate         time.Time `xorm:"DATETIME"`
14
+	ReturnDate         time.Time `xorm:"DATETIME"`
15
+	EndDate            time.Time `xorm:"DATETIME"`
16
+	BorrowStatus       string    `xorm:"VARCHAR(32)"`
17
+	CaseId             string    `xorm:"VARCHAR(64)"`
18
+	OrgId              string    `xorm:"VARCHAR(64)"`
19
+}

+ 15
- 0
models/model/ta_book_type.go Vedi File

@@ -0,0 +1,15 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaBookType struct {
8
+	BookTypeId   string    `xorm:"not null pk VARCHAR(64)"`
9
+	BookTypeName string    `xorm:"VARCHAR(32)"`
10
+	BookTypeImg  string    `xorm:"TEXT"`
11
+	Status       int       `xorm:"SMALLINT(6)"`
12
+	CaseId       string    `xorm:"VARCHAR(64)"`
13
+	OrgId        string    `xorm:"VARCHAR(64)"`
14
+	CreateDate   time.Time `xorm:"DATETIME"`
15
+}

+ 17
- 0
models/model/ta_in_stock_change.go Vedi File

@@ -0,0 +1,17 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaInStockChange struct {
8
+	RecordId      string    `xorm:"not null pk VARCHAR(64)"`
9
+	BookId        string    `xorm:"VARCHAR(64)"`
10
+	InStockBefore int       `xorm:"INT(11)"`
11
+	InStockAfter  int       `xorm:"INT(11)"`
12
+	ChangeReason  string    `xorm:"TEXT"`
13
+	ChangeDate    time.Time `xorm:"DATETIME"`
14
+	ChangeUser    string    `xorm:"VARCHAR(64)"`
15
+	CaseId        string    `xorm:"VARCHAR(64)"`
16
+	OrgId         string    `xorm:"VARCHAR(64)"`
17
+}