...
|
...
|
@@ -48,6 +48,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
"created_at",
|
|
|
"deleted_at",
|
|
|
"updated_at",
|
|
|
"cooperation_contract_undertaker_id",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
...
|
...
|
@@ -86,6 +87,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
÷ndsEstimate.CreatedAt,
|
|
|
÷ndsEstimate.DeletedAt,
|
|
|
÷ndsEstimate.UpdatedAt,
|
|
|
÷ndsEstimate.CooperationContractUndertakerId,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO dividends_estimates (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
dividendsEstimate.DividendsEstimateId,
|
...
|
...
|
@@ -110,6 +112,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
dividendsEstimate.CreatedAt,
|
|
|
nil,
|
|
|
dividendsEstimate.UpdatedAt,
|
|
|
dividendsEstimate.CooperationContractUndertakerId,
|
|
|
); err != nil {
|
|
|
return dividendsEstimate, err
|
|
|
}
|
...
|
...
|
@@ -138,6 +141,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
÷ndsEstimate.CreatedAt,
|
|
|
÷ndsEstimate.DeletedAt,
|
|
|
÷ndsEstimate.UpdatedAt,
|
|
|
÷ndsEstimate.CooperationContractUndertakerId,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE dividends_estimates SET %s WHERE dividends_estimate_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
dividendsEstimate.DividendsEstimateId,
|
...
|
...
|
@@ -162,6 +166,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
dividendsEstimate.CreatedAt,
|
|
|
nil,
|
|
|
dividendsEstimate.UpdatedAt,
|
|
|
dividendsEstimate.CooperationContractUndertakerId,
|
|
|
dividendsEstimate.Identify(),
|
|
|
); err != nil {
|
|
|
return dividendsEstimate, err
|
...
|
...
|
@@ -183,28 +188,29 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do |
|
|
}
|
|
|
}
|
|
|
dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
|
|
|
DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
DividendsType: dividendsEstimate.DividendsType,
|
|
|
DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
Org: dividendsEstimate.Org,
|
|
|
Company: dividendsEstimate.Company,
|
|
|
Operator: dividendsEstimate.Operator,
|
|
|
OperateTime: dividendsEstimate.OperateTime,
|
|
|
IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
UpdatedAt: dividendsEstimate.UpdatedAt,
|
|
|
DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
DividendsType: dividendsEstimate.DividendsType,
|
|
|
DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
Org: dividendsEstimate.Org,
|
|
|
Company: dividendsEstimate.Company,
|
|
|
Operator: dividendsEstimate.Operator,
|
|
|
OperateTime: dividendsEstimate.OperateTime,
|
|
|
IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
UpdatedAt: dividendsEstimate.UpdatedAt,
|
|
|
CooperationContractUndertakerId: dividendsEstimate.CooperationContractUndertakerId,
|
|
|
})
|
|
|
}
|
|
|
if len(dividendsEstimateModels) > 0 {
|
...
|
...
|
@@ -229,28 +235,29 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* |
|
|
var dividendsEstimateModels []*models.DividendsEstimate
|
|
|
for _, dividendsEstimate := range dividendsEstimates {
|
|
|
dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
|
|
|
DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
DividendsType: dividendsEstimate.DividendsType,
|
|
|
DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
Org: dividendsEstimate.Org,
|
|
|
Company: dividendsEstimate.Company,
|
|
|
Operator: dividendsEstimate.Operator,
|
|
|
OperateTime: dividendsEstimate.OperateTime,
|
|
|
IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
UpdatedAt: time.Now(),
|
|
|
DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
|
|
|
DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
|
|
|
PaymentStatus: dividendsEstimate.PaymentStatus,
|
|
|
DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
|
|
|
DividendsParticipateType: dividendsEstimate.DividendsParticipateType,
|
|
|
DividendsType: dividendsEstimate.DividendsType,
|
|
|
DividendsTypeName: dividendsEstimate.DividendsTypeName,
|
|
|
OrderOrReturnedOrderNum: dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
DividendsUser: dividendsEstimate.DividendsUser,
|
|
|
DividendsStage: dividendsEstimate.DividendsStage,
|
|
|
Org: dividendsEstimate.Org,
|
|
|
Company: dividendsEstimate.Company,
|
|
|
Operator: dividendsEstimate.Operator,
|
|
|
OperateTime: dividendsEstimate.OperateTime,
|
|
|
IsCanceled: dividendsEstimate.IsCanceled,
|
|
|
OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
UpdatedAt: time.Now(),
|
|
|
CooperationContractUndertakerId: dividendsEstimate.CooperationContractUndertakerId,
|
|
|
})
|
|
|
}
|
|
|
if _, err := tx.Model(÷ndsEstimateModels).WherePK().Update(); err != nil {
|
...
|
...
|
|