|
|
@@ -0,0 +1,42 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewServiceAwardDividendRelationDb(engine *xorm.Engine) dao.ServiceAwardDividendRelationDao { |
|
|
|
return &ServiceAwardDividendRelationDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type ServiceAwardDividendRelationDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (s ServiceAwardDividendRelationDb) SaveServiceAwardDividendRelation(sees *xorm.Session, id interface{}, m *models.ServiceAwardDividendRelation, forceColums ...string) (affected int64, err error) { |
|
|
|
if forceColums != nil { |
|
|
|
affected, err = sees.Where("id=?", id).Cols(forceColums...).Update(m) |
|
|
|
} else { |
|
|
|
affected, err = sees.Where("id=?", id).Update(m) |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func (s ServiceAwardDividendRelationDb) InsertServiceAwardDividendRelationBySess(sess *xorm.Session, m *models.ServiceAwardDividendRelation) (id int, err error) { |
|
|
|
_, err = s.Db.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
id = m.Id |
|
|
|
return id, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (s ServiceAwardDividendRelationDb) InsertServiceAwardDividendRelation(m *models.ServiceAwardDividendRelation) (id int, err error) { |
|
|
|
_, err = s.Db.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
id = m.Id |
|
|
|
return id, nil |
|
|
|
} |