123456789101112131415161718192021222324252627282930 |
- package chart_permission
- import (
- "errors"
- "hongze/hongze_yb/global"
- "hongze/hongze_yb/utils"
- )
- func GetListByProductId(productId int64) (list []*ChartPermission, err error) {
- err = global.DEFAULT_MYSQL.Where(" product_id = ?", productId).Find(&list).Error
- return
- }
- func GetClassNameListByProductId(productId int64) (list []*ChartPermission, err error) {
- err = global.DEFAULT_MYSQL.Where(" product_id = ?", productId).Group("classify_name").Find(&list).Error
- return
- }
- func GetByWhereMap(where map[string]interface{}) (list []*ChartPermission, err error) {
- cond, whereVal, buildErr := utils.WhereBuild(where)
- if buildErr != nil {
- err = errors.New("系统异常,生成查询语句失败")
- return
- }
- err = global.DEFAULT_MYSQL.Where(cond, whereVal...).Find(&list).Error
- return
- }
|