dao-base.go 241 B

1234567891011121314
  1. package dao
  2. import (
  3. "exam_system/config"
  4. "fmt"
  5. )
  6. func FindTotal(tableName string) int{
  7. var count int
  8. sqlStr := fmt.Sprintf("select count(id) from %s where delete_at is null",tableName)
  9. config.DB.Get(&count, sqlStr)
  10. return count
  11. }