|
@@ -3,20 +3,38 @@ package models
|
|
|
import "rdluck_tools/orm"
|
|
|
|
|
|
type ReportMapping struct {
|
|
|
- CategoryId int `description:"分类ID"`
|
|
|
- SubCategoryName string `description:"权限名称"`
|
|
|
- IsRead bool `description:"是否标红"`
|
|
|
+ CategoryId int `description:"分类ID"`
|
|
|
+ SubCategoryName string `description:"权限名称"`
|
|
|
+ IsRead bool `description:"是否标红"`
|
|
|
+}
|
|
|
+
|
|
|
+type TradeReportMapping struct {
|
|
|
+ CategoryId int `description:"分类ID"`
|
|
|
+ SubCategoryName string `description:"权限名称"`
|
|
|
+ IsRead bool `description:"是否标红"`
|
|
|
+ UpdateTime string `description:"更新时间"`
|
|
|
}
|
|
|
|
|
|
type ReportMappingResp struct {
|
|
|
List []*ReportMapping
|
|
|
}
|
|
|
|
|
|
+type TradeReportMappingResp struct {
|
|
|
+ List []*TradeReportMapping
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
func GetReportMappingStrategyAll() (items []*ReportMapping, err error) {
|
|
|
- o:=orm.NewOrm()
|
|
|
- sql:=`SELECT * FROM cygx_report_mapping WHERE report_type=1 AND chart_permission_id=23 ORDER BY sort ASC `
|
|
|
- _,err=o.Raw(sql).QueryRows(&items)
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT * FROM cygx_report_mapping WHERE report_type=1 AND chart_permission_id=23 ORDER BY sort ASC `
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+func GetTradeAll(ChartPermissionId int) (items []*TradeReportMapping, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT * FROM cygx_report_mapping WHERE chart_permission_id = ? AND report_type = 1;`
|
|
|
+ _, err = o.Raw(sql, ChartPermissionId).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|