package models import "rdluck_tools/orm" //权限相关 type ChartPermissionSearchKeyWordMapping struct { Id int `description:"id"` ChartPermissionId int `description:"权限id"` KeyWord string `description:"二级分类名称"` From string `description:"类型标识"` TacticType string `description:"策略表type字段值"` TeleconferenceSort int `description:"电话会类型排序"` } func GetPermission(classifyNameSecond string) (items []*ChartPermissionSearchKeyWordMapping, err error) { o := orm.NewOrm() sql := `SELECT * FROM chart_permission_search_key_word_mapping AS a WHERE a.from='rddp' AND a.key_word=? ` _, err = o.Raw(sql, classifyNameSecond).QueryRows(&items) return } func AddChartPermissionChapterMapping(chartPermissionId int, reportId int64) (err error) { sql := `INSERT INTO chart_permission_chapter_mapping (chart_permission_id, report_chapter_type_id,research_type) VALUES(?,?,?)` o := orm.NewOrm() _, err = o.Raw(sql, chartPermissionId, reportId, "rddp").Exec() return }