...
|
...
|
@@ -47,6 +47,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. |
|
|
"updated_at",
|
|
|
"deleted_at",
|
|
|
"created_at",
|
|
|
"applicant_account",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
...
|
...
|
@@ -82,6 +83,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. |
|
|
&cooperationProject.UpdatedAt,
|
|
|
&cooperationProject.DeletedAt,
|
|
|
&cooperationProject.CreatedAt,
|
|
|
&cooperationProject.ApplicantCount,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO cooperation_projects (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
cooperationProject.CooperationProjectId,
|
...
|
...
|
@@ -103,6 +105,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. |
|
|
cooperationProject.UpdatedAt,
|
|
|
nil,
|
|
|
cooperationProject.CreatedAt,
|
|
|
cooperationProject.ApplicantCount,
|
|
|
); err != nil {
|
|
|
return cooperationProject, err
|
|
|
}
|
...
|
...
|
@@ -128,6 +131,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. |
|
|
&cooperationProject.UpdatedAt,
|
|
|
&cooperationProject.DeletedAt,
|
|
|
&cooperationProject.CreatedAt,
|
|
|
&cooperationProject.ApplicantCount,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE cooperation_projects SET %s WHERE cooperation_project_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
cooperationProject.CooperationProjectId,
|
...
|
...
|
@@ -149,6 +153,7 @@ func (repository *CooperationProjectRepository) Save(cooperationProject *domain. |
|
|
cooperationProject.UpdatedAt,
|
|
|
nil,
|
|
|
cooperationProject.CreatedAt,
|
|
|
cooperationProject.ApplicantCount,
|
|
|
cooperationProject.Identify(),
|
|
|
); err != nil {
|
|
|
return cooperationProject, err
|
...
|
...
|
@@ -181,6 +186,7 @@ func (repository *CooperationProjectRepository) UpdateMany(cooperationProjects [ |
|
|
UpdatedAt: time.Now(),
|
|
|
DeletedAt: cooperationProject.DeletedAt,
|
|
|
CreatedAt: cooperationProject.CreatedAt,
|
|
|
ApplicantCount: cooperationProject.ApplicantCount,
|
|
|
})
|
|
|
}
|
|
|
if _, err := tx.Model(&cooperationProjectModels).WherePK().Update(); err != nil {
|
...
|
...
|
|