This commit is contained in:
suyl
2021-07-20 14:13:39 +08:00
parent 2fd881f172
commit 902a245674
7 changed files with 100 additions and 9 deletions

View File

@@ -5,7 +5,7 @@ import (
"git.rosy.net.cn/jx-callback/business/model"
)
func GetPrinters(db *DaoDB, appID int, printNo string) (printers []*model.Printer, err error) {
func GetPrinters(db *DaoDB, appID int, printNo string, status, statusNeq int) (printers []*model.Printer, err error) {
sql := `
SELECT *
FROM printer
@@ -22,6 +22,14 @@ func GetPrinters(db *DaoDB, appID int, printNo string) (printers []*model.Printe
sql += " AND print_no = ?"
sqlParams = append(sqlParams, printNo)
}
if status != 0 {
sql += " AND status = ?"
sqlParams = append(sqlParams, status)
}
if statusNeq != 0 {
sql += " AND status <> ?"
sqlParams = append(sqlParams, statusNeq)
}
err = GetRows(db, &printers, sql, sqlParams)
return printers, err
}

View File

@@ -0,0 +1,16 @@
package dao
import (
"git.rosy.net.cn/jx-callback/business/model"
"time"
)
func GetSimFlowExpend(db *DaoDB, iccid string, createdAtBegin, createdAtEnd time.Time) (simFlowExpnd []*model.SimFlowExpend, err error) {
return simFlowExpnd, err
}
func GetSimFlowExpendSum(db *DaoDB, iccid string, createdAtBegin, createdAtEnd time.Time) (simFlowExpnd []*model.SimFlowExpend, err error) {
return simFlowExpnd, err
}

View File

@@ -1,9 +1,10 @@
package model
const (
PrinterStatusOnlineWithoutPaper = 2 //在线正常缺纸
PrinterStatusOnlineWithoutPaper = 2 //在线缺纸
PrinterStatusOnline = 1 //在线正常
PrinterStatusOffline = -1 //离线
PrinterStatusNoFlow = -2 //当月流量超30m了
PrintMsgAlreadySend = 2 //已经发出打印消息
PrintMsgSuccess = 1 //打印成功
@@ -54,9 +55,9 @@ func (v *PrintMsg) TableIndex() [][]string {
type SimFlowExpend struct {
ModelIDCUL
IccID string `orm:"column(icc_id)" json:"iccID"` //sim卡iccid
Flow int `json:"flow"` //流量数
FlowUnit string `json:"flowUnit"` //流量单位
IccID string `orm:"column(icc_id)" json:"iccID"` //sim卡iccid
Flow float64 `json:"flow"` //流量数
FlowUnit string `json:"flowUnit"` //流量单位
}
func (v *SimFlowExpend) TableIndex() [][]string {
@@ -69,9 +70,9 @@ func (v *SimFlowExpend) TableIndex() [][]string {
type SimFlowIncome struct {
ModelIDCUL
IccID string `orm:"column(icc_id)" json:"iccID"` //sim卡iccid
Flow int `json:"flow"` //流量数
FlowUnit string `json:"flowUnit"` //流量单位
IccID string `orm:"column(icc_id)" json:"iccID"` //sim卡iccid
Flow float64 `json:"flow"` //流量数
FlowUnit string `json:"flowUnit"` //流量单位
}
func (v *SimFlowIncome) TableIndex() [][]string {