|
@@ -0,0 +1,49 @@ |
|
|
|
|
|
package implement |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" |
|
|
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
|
|
|
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" |
|
|
|
|
|
"xorm.io/xorm" |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func NewEggPointPartitionCoefficientManagementDb(engine *xorm.Engine) dao.EggPointPartitionCoefficientManagementDao { |
|
|
|
|
|
return &EggPointPartitionCoefficientManagementDb{Db: engine} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type EggPointPartitionCoefficientManagementDb struct { |
|
|
|
|
|
Db *xorm.Engine |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (e EggPointPartitionCoefficientManagementDb) EggPointPartitionCoefficientManagementGetAll() (*[]model.EggPointPartitionCoefficientManagement, error) { |
|
|
|
|
|
var m []model.EggPointPartitionCoefficientManagement |
|
|
|
|
|
err := e.Db.Asc("start_score").Find(&m) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
|
|
} |
|
|
|
|
|
return &m, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (e EggPointPartitionCoefficientManagementDb) EggPointPartitionCoefficientManagementBatchInsert(m []model.EggPointPartitionCoefficientManagement) (int64, error) { |
|
|
|
|
|
affect, err := e.Db.Insert(m) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return 0, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
|
|
} |
|
|
|
|
|
return affect, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (e EggPointPartitionCoefficientManagementDb) EggPointPartitionCoefficientManagementDel(id string) (int64, error) { |
|
|
|
|
|
affect, err := e.Db.Where("id = ?", id).Delete(model.EggPointPartitionCoefficientManagement{}) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return 0, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
|
|
} |
|
|
|
|
|
return affect, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (e EggPointPartitionCoefficientManagementDb) EggPointPartitionCoefficientManagementUpdate(id string, m *model.EggPointPartitionCoefficientManagement, columns ...string) (int64, error) { |
|
|
|
|
|
affected, err := e.Db.Where("id =?", id).Cols(columns...).Update(m) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return 0, err |
|
|
|
|
|
} |
|
|
|
|
|
return affected, nil |
|
|
|
|
|
} |