...
|
...
|
@@ -46,6 +46,7 @@ func (repository *CreditAccountRepository) Save(creditAccount *domain.CreditAcco |
|
|
"created_at",
|
|
|
"deleted_at",
|
|
|
"updated_at",
|
|
|
"remarks",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
...
|
...
|
@@ -81,6 +82,7 @@ func (repository *CreditAccountRepository) Save(creditAccount *domain.CreditAcco |
|
|
&creditAccount.CreatedAt,
|
|
|
&creditAccount.DeletedAt,
|
|
|
&creditAccount.UpdatedAt,
|
|
|
&creditAccount.Remarks,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO credit_accounts (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
creditAccount.CreditAccountId,
|
...
|
...
|
@@ -100,8 +102,9 @@ func (repository *CreditAccountRepository) Save(creditAccount *domain.CreditAcco |
|
|
creditAccount.Operator,
|
|
|
creditAccount.OperateTime,
|
|
|
creditAccount.CreatedAt,
|
|
|
creditAccount.DeletedAt,
|
|
|
nil,
|
|
|
creditAccount.UpdatedAt,
|
|
|
creditAccount.Remarks,
|
|
|
); err != nil {
|
|
|
return creditAccount, err
|
|
|
}
|
...
|
...
|
@@ -127,6 +130,7 @@ func (repository *CreditAccountRepository) Save(creditAccount *domain.CreditAcco |
|
|
&creditAccount.CreatedAt,
|
|
|
&creditAccount.DeletedAt,
|
|
|
&creditAccount.UpdatedAt,
|
|
|
&creditAccount.Remarks,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE credit_accounts SET %s WHERE credit_account_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
creditAccount.CreditAccountId,
|
...
|
...
|
@@ -146,8 +150,9 @@ func (repository *CreditAccountRepository) Save(creditAccount *domain.CreditAcco |
|
|
creditAccount.Operator,
|
|
|
creditAccount.OperateTime,
|
|
|
creditAccount.CreatedAt,
|
|
|
creditAccount.DeletedAt,
|
|
|
nil,
|
|
|
creditAccount.UpdatedAt,
|
|
|
creditAccount.Remarks,
|
|
|
creditAccount.Identify(),
|
|
|
); err != nil {
|
|
|
return creditAccount, err
|
...
|
...
|
|