|
|
@@ -11,31 +11,31 @@ type NewFlexibleEmploymentPupiaoOrdDb struct { |
|
|
|
Db *xorm.Engine `json:"model"` |
|
|
|
} |
|
|
|
|
|
|
|
func (NewFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Set(masterId string) { // set方法 |
|
|
|
NewFlexibleEmploymentPupiaoOrdDb.Db = commDb.DBs[masterId] |
|
|
|
func (newFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Set(masterId string) { // set方法 |
|
|
|
newFlexibleEmploymentPupiaoOrdDb.Db = commDb.DBs[masterId] |
|
|
|
} |
|
|
|
|
|
|
|
func (NewFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Get(outBatchNo string) (m *model.NewFlexibleEmploymentPupiaoOrd, err error) { |
|
|
|
m = new(model.NewFlexibleEmploymentPupiaoOrd) |
|
|
|
has, err := NewFlexibleEmploymentPupiaoOrdDb.Db.Where("out_batch_no = ?", outBatchNo).Get(m) |
|
|
|
func (newFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Get(outBatchNo string) (*model.NewFlexibleEmploymentPupiaoOrd, error) { |
|
|
|
var m model.NewFlexibleEmploymentPupiaoOrd |
|
|
|
has, err := newFlexibleEmploymentPupiaoOrdDb.Db.Where("out_batch_no = ?", outBatchNo).Get(&m) |
|
|
|
if err != nil { |
|
|
|
return nil, logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
return &m, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (NewFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Update(id interface{}, m *model.NewFlexibleEmploymentPupiaoOrd, forceColums ...string) (int64, error) { |
|
|
|
func (newFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Update(id interface{}, m *model.NewFlexibleEmploymentPupiaoOrd, forceColums ...string) (int64, error) { |
|
|
|
var ( |
|
|
|
affected int64 |
|
|
|
err error |
|
|
|
) |
|
|
|
if forceColums != nil { |
|
|
|
affected, err = NewFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Cols(forceColums...).Update(m) |
|
|
|
affected, err = newFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Cols(forceColums...).Update(m) |
|
|
|
} else { |
|
|
|
affected, err = NewFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Update(m) |
|
|
|
affected, err = newFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Update(m) |
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|