|
@@ -17,16 +17,16 @@ func (repository *SuMoneyTransactionRecordRepository) Save(suMoneyTransactionRec |
|
@@ -17,16 +17,16 @@ func (repository *SuMoneyTransactionRecordRepository) Save(suMoneyTransactionRec |
17
|
tx := repository.transactionContext.PgTx
|
17
|
tx := repository.transactionContext.PgTx
|
18
|
if suMoneyTransactionRecord.Identify() == nil {
|
18
|
if suMoneyTransactionRecord.Identify() == nil {
|
19
|
if _, err := tx.QueryOne(
|
19
|
if _, err := tx.QueryOne(
|
20
|
- pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
|
|
|
21
|
- "INSERT INTO su_money_transaction_records (record_type, employee, su_money, operator, record_description, create_time) VALUES (?, ?, ?, ?, ?, ?) RETURNING id, record_type, employee, su_money, operator, record_description, create_time",
|
|
|
22
|
- suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime); err != nil {
|
20
|
+ pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoneyBeforeTransaction, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
|
|
|
21
|
+ "INSERT INTO su_money_transaction_records (record_type, employee, su_money_before_transaction, su_money, operator, record_description, create_time) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING id, record_type, employee, su_money_before_transaction, su_money, operator, record_description, create_time",
|
|
|
22
|
+ suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoneyBeforeTransaction, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime); err != nil {
|
23
|
return suMoneyTransactionRecord, err
|
23
|
return suMoneyTransactionRecord, err
|
24
|
}
|
24
|
}
|
25
|
} else {
|
25
|
} else {
|
26
|
if _, err := tx.QueryOne(
|
26
|
if _, err := tx.QueryOne(
|
27
|
- pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
|
|
|
28
|
- "UPDATE su_money_transaction_records SET record_type=?, employee=?, su_money=?, operator=?, record_description=?, create_time=? WHERE id=? RETURNING id, record_type, employee, su_money, operator, record_description, create_time",
|
|
|
29
|
- suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime, suMoneyTransactionRecord.SuMoneyTransactionRecordId); err != nil {
|
27
|
+ pg.Scan(&suMoneyTransactionRecord.SuMoneyTransactionRecordId, &suMoneyTransactionRecord.RecordType, &suMoneyTransactionRecord.Employee, &suMoneyTransactionRecord.SuMoneyBeforeTransaction, &suMoneyTransactionRecord.SuMoney, &suMoneyTransactionRecord.Operator, &suMoneyTransactionRecord.RecordDescription, &suMoneyTransactionRecord.CreateTime),
|
|
|
28
|
+ "UPDATE su_money_transaction_records SET record_type=?, employee=?, su_money_before_transaction=?, su_money=?, operator=?, record_description=?, create_time=? WHERE id=? RETURNING id, record_type, employee, su_money, operator, record_description, create_time",
|
|
|
29
|
+ suMoneyTransactionRecord.RecordType, suMoneyTransactionRecord.Employee, suMoneyTransactionRecord.SuMoneyBeforeTransaction, suMoneyTransactionRecord.SuMoney, suMoneyTransactionRecord.Operator, suMoneyTransactionRecord.RecordDescription, suMoneyTransactionRecord.CreateTime, suMoneyTransactionRecord.SuMoneyTransactionRecordId); err != nil {
|
30
|
return suMoneyTransactionRecord, err
|
30
|
return suMoneyTransactionRecord, err
|
31
|
}
|
31
|
}
|
32
|
}
|
32
|
}
|
|
@@ -110,6 +110,7 @@ func (repository *SuMoneyTransactionRecordRepository) transformPgModelToDomainMo |
|
@@ -110,6 +110,7 @@ func (repository *SuMoneyTransactionRecordRepository) transformPgModelToDomainMo |
110
|
SuMoneyTransactionRecordId: suMoneyTransactionRecordModel.Id,
|
110
|
SuMoneyTransactionRecordId: suMoneyTransactionRecordModel.Id,
|
111
|
RecordType: suMoneyTransactionRecordModel.RecordType,
|
111
|
RecordType: suMoneyTransactionRecordModel.RecordType,
|
112
|
Employee: suMoneyTransactionRecordModel.Employee,
|
112
|
Employee: suMoneyTransactionRecordModel.Employee,
|
|
|
113
|
+ SuMoneyBeforeTransaction: suMoneyTransactionRecordModel.SuMoneyBeforeTransaction,
|
113
|
SuMoney: suMoneyTransactionRecordModel.SuMoney,
|
114
|
SuMoney: suMoneyTransactionRecordModel.SuMoney,
|
114
|
Operator: suMoneyTransactionRecordModel.Operator,
|
115
|
Operator: suMoneyTransactionRecordModel.Operator,
|
115
|
RecordDescription: suMoneyTransactionRecordModel.RecordDescription,
|
116
|
RecordDescription: suMoneyTransactionRecordModel.RecordDescription,
|