From fcbf45454ddb07610af05cb44c3b7619cd231096 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 18 Jun 2024 16:41:41 +0800 Subject: [PATCH] 1 --- src/dao/installment_payment_list_dao.go | 4 +++- src/implement/installment_payment_list_db.go | 18 ++++++++++++++++-- .../super_cloud_issuance_package_ord_db.go | 6 ++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/dao/installment_payment_list_dao.go b/src/dao/installment_payment_list_dao.go index 6e863e3..251f9fa 100644 --- a/src/dao/installment_payment_list_dao.go +++ b/src/dao/installment_payment_list_dao.go @@ -1,5 +1,7 @@ package dao +import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + type InstallmentPaymentListDao interface { - //TODO:: You can add specific method definitions here + GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) } diff --git a/src/implement/installment_payment_list_db.go b/src/implement/installment_payment_list_db.go index f6a4431..e12df4f 100644 --- a/src/implement/installment_payment_list_db.go +++ b/src/implement/installment_payment_list_db.go @@ -2,13 +2,27 @@ import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) +func NewInstallmentPaymentListDb(engine *xorm.Engine) dao.InstallmentPaymentListDao { + return &InstallmentPaymentListDb{Db: engine} +} + type InstallmentPaymentListDb struct { Db *xorm.Engine } -func NewInstallmentPaymentListDb(engine *xorm.Engine) dao.InstallmentPaymentListDao { - return &InstallmentPaymentListDb{Db: engine} +func (i InstallmentPaymentListDb) GetInstallmentPaymentListById(id int) (m *models.InstallmentPaymentList, err error) { + m = new(models.InstallmentPaymentList) + has, err := i.Db.Where("id =?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil } diff --git a/src/implement/super_cloud_issuance_package_ord_db.go b/src/implement/super_cloud_issuance_package_ord_db.go index 1813909..728c28a 100644 --- a/src/implement/super_cloud_issuance_package_ord_db.go +++ b/src/implement/super_cloud_issuance_package_ord_db.go @@ -2,6 +2,7 @@ package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" "xorm.io/xorm" ) @@ -9,6 +10,11 @@ type SuperCloudIssuancePackageOrdDb struct { Db *xorm.Engine } +func (s SuperCloudIssuancePackageOrdDb) GetCloudIssuancePackageOrd(ordNo string) (m *models.SuperCloudIssuancePackageOrd, err error) { + //TODO implement me + panic("implement me") +} + func NewSuperCloudIssuancePackageOrdDb(engine *xorm.Engine) dao.SuperCloudIssuancePackageOrdDao { return &SuperCloudIssuancePackageOrdDb{Db: engine} }