bank.go 540 B

1234567891011121314151617181920212223
  1. package model
  2. import (
  3. "fmt"
  4. "mtp20_assisted/global"
  5. )
  6. // GetByUserID 通过UserID获取信息
  7. func (t *Bankaccountsign) GetByUserID(userID uint64) (has bool, err error) {
  8. sql := fmt.Sprintf(`
  9. select
  10. t.*
  11. from BANK_ACCOUNTSIGN t
  12. where t.ACCOUNTCODE in
  13. (select to_char(a.accountid) from taaccount a where a.RELATEDUSERID = %v)
  14. `, userID)
  15. return global.M2A_DB.SQL(sql).Get(t)
  16. }
  17. // Get 通过银行ID获取信息
  18. func (t *Bankbankinfo) Get() (has bool, err error) {
  19. return global.M2A_DB.Where("BANKID = ?", t.BANKID).Get(t)
  20. }