|
@@ -14,6 +14,7 @@ type ChartPermissionSearchKeyWordMapping struct {
|
|
From string `description:"类型标识" json:"-"`
|
|
From string `description:"类型标识" json:"-"`
|
|
TacticType string `description:"策略表type字段值" json:"-"`
|
|
TacticType string `description:"策略表type字段值" json:"-"`
|
|
TeleconferenceSort int `description:"电话会类型排序" json:"-"`
|
|
TeleconferenceSort int `description:"电话会类型排序" json:"-"`
|
|
|
|
+ ClassifyId int `description:"分类ID"`
|
|
}
|
|
}
|
|
|
|
|
|
func GetPermission(classifyNameSecond string) (items []*ChartPermissionSearchKeyWordMapping, err error) {
|
|
func GetPermission(classifyNameSecond string) (items []*ChartPermissionSearchKeyWordMapping, err error) {
|
|
@@ -69,7 +70,7 @@ func AddChartPermissionSearchKeyWordMappingMulti(chartPermissionSearchKeyWordMap
|
|
|
|
|
|
func AddChartPermissionChapterMapping(chartPermissionId int, reportId int64) (err error) {
|
|
func AddChartPermissionChapterMapping(chartPermissionId int, reportId int64) (err error) {
|
|
sql := `INSERT INTO chart_permission_chapter_mapping (chart_permission_id, report_chapter_type_id,research_type)
|
|
sql := `INSERT INTO chart_permission_chapter_mapping (chart_permission_id, report_chapter_type_id,research_type)
|
|
- VALUES(?,?,?)`
|
|
|
|
|
|
+ VALUES(?,?,?)`
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
_, err = o.Raw(sql, chartPermissionId, reportId, "rddp").Exec()
|
|
_, err = o.Raw(sql, chartPermissionId, reportId, "rddp").Exec()
|
|
return
|
|
return
|
|
@@ -103,12 +104,13 @@ func UpdateChartPermissionNameFromMappingByKeyword(newKeyword, keyword, source s
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func GetPermissionsByClassifyNames(names []string) (items []*ChartPermissionSearchKeyWordMapping, err error) {
|
|
|
|
- if len(names) == 0 {
|
|
|
|
|
|
+// GetPermissionsByClassifyIds 根据分类IDs获取权限IDs
|
|
|
|
+func GetPermissionsByClassifyIds(classifyIds []int) (items []*ChartPermissionSearchKeyWordMapping, err error) {
|
|
|
|
+ if len(classifyIds) == 0 {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
- sql := fmt.Sprintf(`SELECT * FROM chart_permission_search_key_word_mapping AS a WHERE a.from='rddp' AND a.key_word IN (%s)`, utils.GetOrmInReplace(len(names)))
|
|
|
|
- _, err = o.Raw(sql, names).QueryRows(&items)
|
|
|
|
|
|
+ sql := fmt.Sprintf(`SELECT * FROM chart_permission_search_key_word_mapping AS a WHERE a.from='rddp' AND a.classify_id IN (%s)`, utils.GetOrmInReplace(len(classifyIds)))
|
|
|
|
+ _, err = o.Raw(sql, classifyIds).QueryRows(&items)
|
|
return
|
|
return
|
|
}
|
|
}
|