query.go 487 B

123456789101112131415161718
  1. package company_report_permission
  2. import (
  3. "errors"
  4. "hongze/hongze_yb/global"
  5. "hongze/hongze_yb/utils"
  6. )
  7. // GetByWhereMap 根据查询条件map获取信息
  8. func GetByWhereMap(where map[string]interface{}) (list []*CompanyReportPermission, err error) {
  9. cond, whereVal, buildErr := utils.WhereBuild(where)
  10. if buildErr != nil {
  11. err = errors.New("系统异常,生成查询语句失败")
  12. return
  13. }
  14. err = global.DEFAULT_MYSQL.Where(cond, whereVal...).Find(&list).Error
  15. return
  16. }