|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"database/sql"
|
|
|
"fmt"
|
|
|
"strings"
|
|
|
+ "time"
|
|
|
|
|
|
"git.i2edu.net/i2/go-zero/core/stores/sqlc"
|
|
|
"git.i2edu.net/i2/go-zero/core/stores/sqlx"
|
|
|
@@ -32,23 +33,33 @@ type (
|
|
|
}
|
|
|
|
|
|
I2billAcquirerMktQr struct {
|
|
|
- DelFlag sql.NullString `db:"del_flag" json:"del_flag"`
|
|
|
+ SchoolId sql.NullInt64 `db:"school_id" json:"school_id"` // 校区id
|
|
|
+ Qr sql.NullString `db:"qr" json:"qr"` // 二维码url
|
|
|
+ LastUpdateBy sql.NullInt64 `db:"last_update_by" json:"last_update_by"`
|
|
|
+ Id int64 `db:"id" json:"id"` // 主键
|
|
|
UserId sql.NullInt64 `db:"user_id" json:"user_id"` // 用户id
|
|
|
- Qr sql.NullString `db:"qr" json:"qr"` // 二维码url
|
|
|
- ActivityId sql.NullString `db:"activity_id" json:"activity_id"` // 活动id
|
|
|
- CreateTime sql.NullTime `db:"create_time" json:"create_time"`
|
|
|
- CreateBy sql.NullString `db:"create_by" json:"create_by"`
|
|
|
+ ActivityId sql.NullInt64 `db:"activity_id" json:"activity_id"` // 活动id
|
|
|
+ CreateBy sql.NullInt64 `db:"create_by" json:"create_by"`
|
|
|
LastUpdateTime sql.NullTime `db:"last_update_time" json:"last_update_time"`
|
|
|
- LastUpdateBy sql.NullString `db:"last_update_by" json:"last_update_by"`
|
|
|
- Id int64 `db:"id" json:"id"` // 主键
|
|
|
- QudaoId sql.NullString `db:"qudao_id" json:"qudao_id"` // 渠道id
|
|
|
+ QudaoId sql.NullInt64 `db:"qudao_id" json:"qudao_id"` // 渠道id
|
|
|
+ DelFlag sql.NullInt64 `db:"del_flag" json:"del_flag"`
|
|
|
+ CreateTime sql.NullTime `db:"create_time" json:"create_time"`
|
|
|
+ }
|
|
|
+ I2billAcquirerMktQrXorm struct {
|
|
|
+ SchoolId int64 `json:"school_id"`
|
|
|
+ Qr string `json:"qr"`
|
|
|
+ LastUpdateBy int64 `json:"last_update_by"`
|
|
|
+ Id int64 `json:"id"`
|
|
|
+ UserId int64 `json:"user_id"`
|
|
|
+ ActivityId int64 `json:"activity_id"`
|
|
|
+ CreateBy int64 `json:"create_by"`
|
|
|
+ LastUpdateTime time.Time `json:"last_update_time"`
|
|
|
+ QudaoId int64 `json:"qudao_id"`
|
|
|
+ DelFlag int64 `json:"del_flag"`
|
|
|
+ CreateTime time.Time `json:"create_time"`
|
|
|
}
|
|
|
)
|
|
|
|
|
|
-func (t *I2billAcquirerMktQr) TableName() string {
|
|
|
- return "i2bill_acquirer_mkt_qr"
|
|
|
-}
|
|
|
-
|
|
|
func NewI2billAcquirerMktQrModel(conn sqlx.SqlConn) I2billAcquirerMktQrModel {
|
|
|
return &defaultI2billAcquirerMktQrModel{
|
|
|
conn: conn,
|
|
|
@@ -57,8 +68,8 @@ func NewI2billAcquirerMktQrModel(conn sqlx.SqlConn) I2billAcquirerMktQrModel {
|
|
|
}
|
|
|
|
|
|
func (m *defaultI2billAcquirerMktQrModel) Insert(data I2billAcquirerMktQr) (sql.Result, error) {
|
|
|
- query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?)", m.table, i2billAcquirerMktQrRowsExpectAutoSet)
|
|
|
- ret, err := m.conn.Exec(query, data.DelFlag, data.UserId, data.Qr, data.ActivityId, data.CreateBy, data.LastUpdateTime, data.LastUpdateBy, data.QudaoId)
|
|
|
+ query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, i2billAcquirerMktQrRowsExpectAutoSet)
|
|
|
+ ret, err := m.conn.Exec(query, data.SchoolId, data.Qr, data.LastUpdateBy, data.UserId, data.ActivityId, data.CreateBy, data.LastUpdateTime, data.QudaoId, data.DelFlag)
|
|
|
return ret, err
|
|
|
}
|
|
|
|
|
|
@@ -78,7 +89,7 @@ func (m *defaultI2billAcquirerMktQrModel) FindOne(id int64) (*I2billAcquirerMktQ
|
|
|
|
|
|
func (m *defaultI2billAcquirerMktQrModel) Update(data I2billAcquirerMktQr) error {
|
|
|
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, i2billAcquirerMktQrRowsWithPlaceHolder)
|
|
|
- _, err := m.conn.Exec(query, data.DelFlag, data.UserId, data.Qr, data.ActivityId, data.CreateBy, data.LastUpdateTime, data.LastUpdateBy, data.QudaoId, data.Id)
|
|
|
+ _, err := m.conn.Exec(query, data.SchoolId, data.Qr, data.LastUpdateBy, data.UserId, data.ActivityId, data.CreateBy, data.LastUpdateTime, data.QudaoId, data.DelFlag, data.Id)
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
@@ -87,3 +98,7 @@ func (m *defaultI2billAcquirerMktQrModel) Delete(id int64) error {
|
|
|
_, err := m.conn.Exec(query, id)
|
|
|
return err
|
|
|
}
|
|
|
+
|
|
|
+func (t *I2billAcquirerMktQrXorm) TableName() string {
|
|
|
+ return "i2bill_acquirer_mkt_qr"
|
|
|
+}
|