...
|
...
|
@@ -24,6 +24,7 @@ func (repository *CooperationApplicationRepository) nextIdentify() (int64, error |
|
|
id, err := IdWorker.NextId()
|
|
|
return id, err
|
|
|
}
|
|
|
|
|
|
func (repository *CooperationApplicationRepository) Save(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
|
|
|
sqlBuildFields := []string{
|
|
|
"cooperation_application_id",
|
...
|
...
|
@@ -67,7 +68,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
|
&cooperationApplication.CooperationApplicationVerifyDescription,
|
|
|
&cooperationApplication.CooperationApplicationVerifyTime,
|
|
|
&cooperationApplication.CooperationApplyTime,
|
|
|
&cooperationApplication.CooperationProject,
|
|
|
&cooperationApplication.CooperationProject.CooperationProjectNumber,
|
|
|
&cooperationApplication.Org,
|
|
|
&cooperationApplication.IsCanceled,
|
|
|
&cooperationApplication.Company,
|
...
|
...
|
@@ -85,12 +86,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
|
cooperationApplication.CooperationApplicationVerifyDescription,
|
|
|
cooperationApplication.CooperationApplicationVerifyTime,
|
|
|
cooperationApplication.CooperationApplyTime,
|
|
|
cooperationApplication.CooperationProject,
|
|
|
cooperationApplication.CooperationProject.CooperationProjectNumber,
|
|
|
cooperationApplication.Org,
|
|
|
cooperationApplication.IsCanceled,
|
|
|
cooperationApplication.Company,
|
|
|
cooperationApplication.CreatedAt,
|
|
|
cooperationApplication.DeletedAt,
|
|
|
nil,
|
|
|
cooperationApplication.UpdatedAt,
|
|
|
); err != nil {
|
|
|
return cooperationApplication, err
|
...
|
...
|
@@ -107,7 +108,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
|
&cooperationApplication.CooperationApplicationVerifyDescription,
|
|
|
&cooperationApplication.CooperationApplicationVerifyTime,
|
|
|
&cooperationApplication.CooperationApplyTime,
|
|
|
&cooperationApplication.CooperationProject,
|
|
|
&cooperationApplication.CooperationProject.CooperationProjectNumber,
|
|
|
&cooperationApplication.Org,
|
|
|
&cooperationApplication.IsCanceled,
|
|
|
&cooperationApplication.Company,
|
...
|
...
|
@@ -125,12 +126,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
|
cooperationApplication.CooperationApplicationVerifyDescription,
|
|
|
cooperationApplication.CooperationApplicationVerifyTime,
|
|
|
cooperationApplication.CooperationApplyTime,
|
|
|
cooperationApplication.CooperationProject,
|
|
|
cooperationApplication.CooperationProject.CooperationProjectNumber,
|
|
|
cooperationApplication.Org,
|
|
|
cooperationApplication.IsCanceled,
|
|
|
cooperationApplication.Company,
|
|
|
cooperationApplication.CreatedAt,
|
|
|
cooperationApplication.DeletedAt,
|
|
|
nil,
|
|
|
cooperationApplication.UpdatedAt,
|
|
|
cooperationApplication.Identify(),
|
|
|
); err != nil {
|
...
|
...
|
@@ -139,6 +140,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication |
|
|
}
|
|
|
return cooperationApplication, nil
|
|
|
}
|
|
|
|
|
|
func (repository *CooperationApplicationRepository) Remove(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
|
|
|
tx := repository.transactionContext.PgTx
|
|
|
cooperationApplicationModel := new(models.CooperationApplication)
|
...
|
...
|
@@ -148,6 +150,7 @@ func (repository *CooperationApplicationRepository) Remove(cooperationApplicatio |
|
|
}
|
|
|
return cooperationApplication, nil
|
|
|
}
|
|
|
|
|
|
func (repository *CooperationApplicationRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationApplication, error) {
|
|
|
tx := repository.transactionContext.PgTx
|
|
|
cooperationApplicationModel := new(models.CooperationApplication)
|
...
|
...
|
@@ -172,6 +175,7 @@ func (repository *CooperationApplicationRepository) FindOne(queryOptions map[str |
|
|
return transform.TransformToCooperationApplicationDomainModelFromPgModels(cooperationApplicationModel, cooperationProjectModel)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (repository *CooperationApplicationRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationApplication, error) {
|
|
|
tx := repository.transactionContext.PgTx
|
|
|
var cooperationApplicationModels []*models.CooperationApplication
|
...
|
...
|
@@ -198,6 +202,7 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string |
|
|
return int64(count), cooperationApplications, nil
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func NewCooperationApplicationRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationApplicationRepository, error) {
|
|
|
if transactionContext == nil {
|
|
|
return nil, fmt.Errorf("transactionContext参数不能为nil")
|
...
|
...
|
|