houyaf před 3 roky
rodič
revize
db24712736

+ 1 - 1
datamodels/biz_object_oam.go

@@ -3,7 +3,7 @@ package datamodels
 import "time"
 
 type BizObjectOAM struct {
-    BizId        int64     `json:"bizId"           xorm:"'biz_id'          bigint      pk comment('主键ID')        "`
+    BizId        int64     `json:"bizId"           xorm:"'biz_id'          bigint      pk comment('主键ID')         "`
     ObjectId     int64     `json:"objectId"        xorm:"'object_id'       bigint      pk comment('Object ID')      "`
     OamId        int64     `json:"oamId"           xorm:"'oam_id'          bigint      pk comment('OAM ID')         "`
     OamTitle     string    `json:"oamTitle"        xorm:"'oam_title'       varchar(127)   comment('OAMTitle')       "`

+ 8 - 6
datamodels/biz_object_rule.go

@@ -1,12 +1,14 @@
 package datamodels
 
 type BizObjectRule struct {
-    RoId         int64     `json:"roId"            xorm:"'ro_id'           bigint      pk comment('主键ID')        "`
-    BizId        int64     `json:"bizId"           xorm:"'biz_id'          bigint         comment('BIZ ID')       "`
-    ObjectId     int64     `json:"objectId"        xorm:"'object_id'       bigint         comment('Object ID')    "`
-    RuleId       int64     `json:"ruleId"          xorm:"'rule_id'         bigint         comment('Rule ID')      "`
-    TargetAttrId int64     `json:"targetAttrId"    xorm:"'target_attr_id'  bigint         comment('Target AttrId')"`
-    RuleCode     string    `json:"ruleCode"        xorm:"'rule_code'       varchar(1023)  comment('Rule Code')    "`
+    
+    BizId        int64     `json:"bizId"           xorm:"'biz_id'          bigint      pk comment('BIZ ID')         "`
+    ObjectId     int64     `json:"objectId"        xorm:"'object_id'       bigint      pk comment('Object ID')      "`
+    OamId        int64     `json:"oamId"           xorm:"'oam_id'          bigint      pk comment('OAM ID')         "`
+    OrId         int64     `json:"orId"            xorm:"'or_id'           bigint      pk comment('Object Rule ID') "`
+    RuleId       int64     `json:"ruleId"          xorm:"'rule_id'         bigint         comment('Rule ID')        "`
+    TargetAttrId int64     `json:"targetAttrId"    xorm:"'target_attr_id'  bigint         comment('Target AttrId')  "`
+    RuleCode     string    `json:"ruleCode"        xorm:"'rule_code'       varchar(1023)  comment('Rule Code')      "`
 }
 
 func (t *BizObjectRule) TableName() string {

+ 5 - 6
datamodels/biz_rule.go

@@ -3,12 +3,11 @@ package datamodels
 import "time"
 
 type BizRule struct {
-    RuleId      int64     `json:"ruleId"          xorm:"'rule_id'         bigint      pk comment('Rule ID')        "`
-    RuleType    int64     `json:"ruleType"        xorm:"'rule_type'       bigint         comment('Type')           "`
-    RuleTitle   string    `json:"ruleTitle"       xorm:"'rule_title'      varchar(127)   comment('模型名称')        "`
-    RuleCode    string    `json:"ruleCode"        xorm:"'rule_code'       varchar(127)   comment('模型名称')        "`
-    Comment     string    `json:"comment"         xorm:"'comment'         varchar(255)   comment('描述')            "`
-    IsFixed     int64     `json:"isFixed"         xorm:"'is_fixed'        int            comment('是否可修改')       "`
+    RuleId      int64     `json:"ruleId"          xorm:"'rule_id'         bigint      pk comment('Rule ID')     "`
+    RuleType    int64     `json:"ruleType"        xorm:"'rule_type'       bigint         comment('Type')        "`
+    RuleTitle   string    `json:"ruleTitle"       xorm:"'rule_title'      varchar(127)   comment('标题')        "`
+    Comment     string    `json:"comment"         xorm:"'comment'         varchar(255)   comment('描述')        "`
+    IsFixed     int64     `json:"isFixed"         xorm:"'is_fixed'        int            comment('是否可修改')   "`
     CreatedBy   int64     `json:"createdBy"       xorm:"'created_by'"`
     CreatedAt   time.Time `json:"createdAt"       xorm:"'created_at'"`
     UpdatedBy   int64     `json:"updatedBy"       xorm:"'updated_by'"`

+ 151 - 0
repositories/biz_object_oam_rule_repo.go

@@ -0,0 +1,151 @@
+package repositories
+
+import (
+    "errors"
+    "fmt"
+    "xorm.io/xorm"
+    "xps/datamodels"
+    "xps/viewmodels"
+)
+
+type BizObjectOAMRuleRepo struct {
+    engine *xorm.Engine
+}
+
+func NewBizObjectOAMRuleRepo(engine *xorm.Engine) *BizObjectOAMRuleRepo {
+    return &BizObjectOAMRuleRepo{
+        engine: engine,
+    }
+}
+
+func (d *BizObjectOAMRuleRepo) GetList(m map[string]interface{}) ([]viewmodels.BizObjectRuleInfo, error) {
+    sqlSelect  := ` SELECT A.*,
+                           B.object_title,
+                           B.object_code,
+                           B.object_type,
+                           C.oam_title,
+                           R.rule_title `
+    sqlFrom    := ` FROM      biz_object_rule AS A
+                    LEFT JOIN biz_object      AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)
+                    LEFT JOIN biz_object_oam  AS C ON (A.biz_id = C.biz_id AND A.object_id = C.object_id AND A.oam_id = C.oam_id)
+                    LEFT JOIN biz_rule        AS R ON (A.rule_id = R.rule_id) `
+    
+    sqlWhere   := ` WHERE 1=1    `
+    if bizId, ok := m["bizId"]; ok {
+        sqlWhere += fmt.Sprintf(" AND A.biz_id = %d ", bizId)
+    }
+    if objectId, ok := m["objectId"]; ok {
+        sqlWhere += fmt.Sprintf(" AND A.object_id = %d ", objectId)
+    }
+    if oamId, ok := m["oamId"]; ok {
+        sqlWhere += fmt.Sprintf(" AND A.oam_id = %d ", oamId)
+    }
+    if keywords, ok := m["keywords"]; ok {
+        sqlWhere += ` AND A.oam_title like ` + "'%" + fmt.Sprintf("%s", keywords) + "%'"
+    }
+    sqlOrderBy := " ORDER BY A.oam_id ASC "
+    
+    datalist   := make([]viewmodels.BizObjectRuleInfo, 0)
+    err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere + sqlOrderBy).Find(&datalist)
+    if err != nil {
+        return nil, err
+    } else {
+        return datalist, nil
+    }
+}
+
+func (d *BizObjectOAMRuleRepo) GetById(bizId, objectId, oamId, orId int64) (*viewmodels.BizObjectRuleInfo, error) {
+    sqlSelect  := ` SELECT A.*,
+                           B.object_title,
+                           B.object_code,
+                           B.object_type,
+                           C.oam_title,
+                           R.rule_title `
+    sqlFrom    := ` FROM      biz_object_rule AS A
+                    LEFT JOIN biz_object      AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)
+                    LEFT JOIN biz_object_oam  AS C ON (A.biz_id = C.biz_id AND A.object_id = C.object_id AND A.oam_id = C.oam_id)
+                    LEFT JOIN biz_rule        AS R ON (A.rule_id = R.rule_id) `
+    
+    sqlWhere   := ` WHERE 1=1   `
+    sqlWhere   += fmt.Sprintf(" AND A.biz_id    = %d ", bizId)
+    sqlWhere   += fmt.Sprintf(" AND A.object_id = %d ", objectId)
+    sqlWhere   += fmt.Sprintf(" AND A.oam_id    = %d ", oamId)
+    sqlWhere   += fmt.Sprintf(" AND A.or_id     = %d ", orId)
+    
+    data    := &viewmodels.BizObjectRuleInfo{}
+    has, err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere).Get(data)
+    if !has || err != nil {
+        return nil, err
+    } else {
+        return data, nil
+    }
+}
+
+func (d *BizObjectOAMRuleRepo) GetListById(bizId, objectId, oamId int64) ([]viewmodels.BizObjectRuleInfo, error) {
+    sqlSelect  := ` SELECT A.*,
+                           B.object_title,
+                           B.object_code,
+                           B.object_type,
+                           C.oam_title,
+                           R.rule_title `
+    sqlFrom    := ` FROM      biz_object_rule AS A
+                    LEFT JOIN biz_object      AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)
+                    LEFT JOIN biz_object_oam  AS C ON (A.biz_id = C.biz_id AND A.object_id = C.object_id AND A.oam_id = C.oam_id)
+                    LEFT JOIN biz_rule        AS R ON (A.rule_id = R.rule_id) `
+    
+    sqlWhere   := ` WHERE 1=1    `
+    sqlWhere   += fmt.Sprintf(" AND A.biz_id    = %d ", bizId)
+    sqlWhere   += fmt.Sprintf(" AND A.object_id = %d ", objectId)
+    sqlWhere   += fmt.Sprintf(" AND A.oam_id    = %d ", oamId)
+    
+    dataList    := make([]viewmodels.BizObjectRuleInfo, 0)
+    has, err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere).Get(&dataList)
+    if !has || err != nil {
+        return nil, err
+    } else {
+        return dataList, nil
+    }
+}
+
+
+func (d *BizObjectOAMRuleRepo) Create(data *datamodels.BizObjectRule) error {
+    _, err := d.engine.Insert(data)
+    return err
+}
+
+func (d *BizObjectOAMRuleRepo) Update(data *datamodels.BizObjectRule) error {
+    orId     := data.OrId
+    _, err := d.engine.
+        Where("or_id = ?", orId).
+        AllCols().
+        Update(data)
+    return err
+}
+
+func (d *BizObjectOAMRuleRepo) Delete(m map[string]interface{}) error {
+    bizId, ok1 := m["bizId"]
+    objectId, ok2 := m["objectId"]
+    oamId, ok3 := m["oamId"]
+    orId, ok4 := m["orId"]
+    if !ok1 || !ok2 || !ok3 || !ok4 {
+        return errors.New("数据不完整")
+    }
+    data := &datamodels.BizObjectRule{}
+    _, err := d.engine.
+        Where("biz_id = ?", bizId).
+        Where("object_id = ?", objectId).
+        Where("oam_id = ?", oamId).
+        Where("or_id = ?", orId).
+        Delete(data)
+    return err
+}
+
+func (d *BizObjectOAMRuleRepo) DeleteByObjectId(bizId, objectId, oamId int64) error {
+    data := &datamodels.BizObjectRule{}
+    _, err := d.engine.
+        Where("biz_id = ?", bizId).
+        Where("object_id = ?", objectId).
+        Where("oam_id = ?", oamId).
+        Delete(data)
+    return err
+}

+ 0 - 124
repositories/biz_object_rule_repo.go

@@ -1,124 +0,0 @@
-package repositories
-
-import (
-    "errors"
-    "fmt"
-    "xorm.io/xorm"
-    "xps/datamodels"
-    "xps/viewmodels"
-)
-
-type BizObjectRuleRepo struct {
-    engine *xorm.Engine
-}
-
-func NewBizObjectRuleRepo(engine *xorm.Engine) *BizObjectRuleRepo {
-    return &BizObjectRuleRepo{
-        engine: engine,
-    }
-}
-
-func (d *BizObjectRuleRepo) GetList(m map[string]interface{}) ([]viewmodels.BizObjectRuleInfo, error) {
-    sqlSelect  := ` SELECT A.*,
-                           B.object_title,
-                           B.object_code,
-                           B.object_type `
-    sqlFrom    := ` FROM      biz_object_rule AS A
-                    LEFT JOIN biz_object      AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)`
-    
-    sqlWhere   := ` WHERE A.deleted_flag = 0    `
-    if bizId, ok := m["bizId"]; ok {
-        sqlWhere += fmt.Sprintf(" AND A.biz_id = %d ", bizId)
-    }
-    if objectId, ok := m["objectId"]; ok {
-        sqlWhere += fmt.Sprintf(" AND A.object_id = %d ", objectId)
-    }
-    if keywords, ok := m["keywords"]; ok {
-        sqlWhere += ` AND A.oam_title like ` + "'%" + fmt.Sprintf("%s", keywords) + "%'"
-    }
-    sqlOrderBy := " ORDER BY A.oam_id ASC "
-    
-    datalist   := make([]viewmodels.BizObjectRuleInfo, 0)
-    err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere + sqlOrderBy).Find(&datalist)
-    if err != nil {
-        return nil, err
-    } else {
-        return datalist, nil
-    }
-}
-
-func (d *BizObjectRuleRepo) GetById(roId int64) (*viewmodels.BizObjectRuleInfo, error) {
-    sqlSelect  := ` SELECT A.*,
-                           B.object_title,
-                           B.object_code,
-                           B.object_type `
-    sqlFrom    := ` FROM      biz_object_rule AS A
-                    LEFT JOIN biz_object     AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)`
-    
-    sqlWhere   := ` WHERE A.deleted_flag = 0    `
-    sqlWhere   += fmt.Sprintf(" AND A.ro_id    = %d ", roId)
-    data    := &viewmodels.BizObjectRuleInfo{}
-    has, err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere).Get(data)
-    if !has || err != nil {
-        return nil, err
-    } else {
-        return data, nil
-    }
-}
-
-func (d *BizObjectRuleRepo) GetListById(bizId, objectId int64) ([]viewmodels.BizObjectRuleInfo, error) {
-    sqlSelect  := ` SELECT A.*,
-                           B.object_title,
-                           B.object_code,
-                           B.object_type `
-    sqlFrom    := ` FROM      biz_object_rule AS A
-                    LEFT JOIN biz_object     AS B ON (A.biz_id = B.biz_id AND A.object_id = B.object_id)`
-    
-    sqlWhere   := ` WHERE A.deleted_flag = 0    `
-    sqlWhere   += fmt.Sprintf(" AND A.biz_id    = %d ", bizId)
-    sqlWhere   += fmt.Sprintf(" AND A.object_id = %d ", objectId)
-    
-    dataList    := make([]viewmodels.BizObjectRuleInfo, 0)
-    has, err := d.engine.SQL(sqlSelect + sqlFrom + sqlWhere).Get(&dataList)
-    if !has || err != nil {
-        return nil, err
-    } else {
-        return dataList, nil
-    }
-}
-
-
-func (d *BizObjectRuleRepo) Create(data *datamodels.BizObjectRule) error {
-    _, err := d.engine.Insert(data)
-    return err
-}
-
-func (d *BizObjectRuleRepo) Update(data *datamodels.BizObjectRule) error {
-    roId     := data.RoId
-    _, err := d.engine.
-        Where("ro_id = ?", roId).
-        AllCols().
-        Update(data)
-    return err
-}
-
-func (d *BizObjectRuleRepo) Delete(m map[string]interface{}) error {
-    roId, ok := m["roId"]
-    if !ok {
-        return errors.New("数据不完整")
-    }
-    data := &datamodels.BizObjectRule{}
-    _, err := d.engine.
-        Where("ro_id = ?", roId).
-        Delete(data)
-    return err
-}
-
-func (d *BizObjectRuleRepo) DeleteByObjectId(bizId, objectId int64) error {
-    data := &datamodels.BizObjectRule{}
-    _, err := d.engine.
-        Where("biz_id = ?", bizId).
-        Where("object_id = ?", objectId).
-        Delete(data)
-    return err
-}

+ 48 - 0
service/biz_object_oam_rule_service.go

@@ -0,0 +1,48 @@
+package service
+
+import (
+    "xps/datamodels"
+    "xps/datasource"
+    "xps/repositories"
+    "xps/viewmodels"
+)
+
+type BizObjectOAMRuleService interface {
+    GetList(m map[string]interface{}) ([]viewmodels.BizObjectRuleInfo, error)
+    GetById(bizId, objectId, oamId, orId int64) (*viewmodels.BizObjectRuleInfo, error)
+    Create(or *datamodels.BizObjectRule) error
+    Update(or *datamodels.BizObjectRule) error
+    Delete(m map[string]interface{}) error
+}
+
+type bizObjectOAMRuleService struct {
+    repo *repositories.BizObjectOAMRuleRepo
+}
+
+func NewBizObjectOAMRuleService() BizObjectOAMRuleService {
+    return &bizObjectOAMRuleService{
+        repo: repositories.NewBizObjectOAMRuleRepo(datasource.InstanceMaster()),
+    }
+}
+
+func (s *bizObjectOAMRuleService) GetList(m map[string]interface{}) ([]viewmodels.BizObjectRuleInfo, error) {
+    return s.repo.GetList(m)
+}
+
+func (s *bizObjectOAMRuleService) GetById(bizId, objectId, oamId, orId int64) (*viewmodels.BizObjectRuleInfo, error) {
+    return s.repo.GetById(bizId, objectId, oamId, orId)
+}
+
+func (s *bizObjectOAMRuleService) Create(or *datamodels.BizObjectRule) error {
+    orId    := NewID()
+    or.OrId = orId
+    return s.repo.Create(or)
+}
+
+func (s *bizObjectOAMRuleService) Update(or *datamodels.BizObjectRule) error {
+    return s.repo.Update(or)
+}
+
+func (s *bizObjectOAMRuleService) Delete(m map[string]interface{}) error {
+    return s.repo.Delete(m)
+}

+ 0 - 48
service/biz_object_rule_service.go

@@ -1,48 +0,0 @@
-package service
-
-import (
-    "xps/datamodels"
-    "xps/datasource"
-    "xps/repositories"
-    "xps/viewmodels"
-)
-
-type BizObjectRuleService interface {
-    GetList(m map[string]interface{}) ([]viewmodels.BizObjectRuleInfo, error)
-    GetById(roId int64) (*viewmodels.BizObjectRuleInfo, error)
-    Create(d *datamodels.BizObjectRule) error
-    Update(d *datamodels.BizObjectRule) error
-    Delete(m map[string]interface{}) error
-}
-
-type bizObjectRuleService struct {
-    repo *repositories.BizObjectRuleRepo
-}
-
-func NewBizObjectRuleService() BizObjectRuleService {
-    return &bizObjectRuleService{
-        repo: repositories.NewBizObjectRuleRepo(datasource.InstanceMaster()),
-    }
-}
-
-func (s *bizObjectRuleService) GetList(m map[string]interface{}) ([]viewmodels.BizObjectRuleInfo, error) {
-    return s.repo.GetList(m)
-}
-
-func (s *bizObjectRuleService) GetById(roId int64) (*viewmodels.BizObjectRuleInfo, error) {
-    return s.repo.GetById(roId)
-}
-
-func (s *bizObjectRuleService) Create(ro *datamodels.BizObjectRule) error {
-    roId    := NewID()
-    ro.RoId = roId
-    return s.repo.Create(ro)
-}
-
-func (s *bizObjectRuleService) Update(ro *datamodels.BizObjectRule) error {
-    return s.repo.Update(ro)
-}
-
-func (s *bizObjectRuleService) Delete(m map[string]interface{}) error {
-    return s.repo.Delete(m)
-}

+ 11 - 6
viewmodels/biz_object_rule_info.go

@@ -1,12 +1,17 @@
 package viewmodels
 
 type BizObjectRuleInfo struct {
-    RoId         int64     `json:"roId"            xorm:"'ro_id'           bigint      pk comment('主键ID')        "`
-    BizId        int64     `json:"bizId"           xorm:"'biz_id'          bigint         comment('BIZ ID')       "`
-    ObjectId     int64     `json:"objectId"        xorm:"'object_id'       bigint         comment('Object ID')    "`
-    RuleId       int64     `json:"ruleId"          xorm:"'rule_id'         bigint         comment('Rule ID')      "`
-    TargetAttrId int64     `json:"targetAttrId"    xorm:"'target_attr_id'  bigint         comment('Target AttrId')"`
-    RuleCode     string    `json:"ruleCode"        xorm:"'rule_code'       varchar(1023)  comment('Rule Code')    "`
+    BizId        int64     `json:"bizId"           xorm:"'biz_id'          bigint         comment('BIZ ID')         "`
+    ObjectId     int64     `json:"objectId"        xorm:"'object_id'       bigint         comment('Object ID')      "`
+    ObjectTitle  string    `json:"objectTitle"     xorm:"'object_title'    varchar(127)   comment('Object Title')   "`
+    OamId        int64     `json:"oamId"           xorm:"'oam_id'          bigint         comment('Object OAM ID')  "`
+    OamTitle     string    `json:"oamTitle"        xorm:"'oam_title'       varchar(127)   comment('OAMTitle')       "`
+    OrId         int64     `json:"orId"            xorm:"'or_id'           bigint      pk comment('Object Rule ID') "`
+    RuleId       int64     `json:"ruleId"          xorm:"'rule_id'         bigint         comment('Rule ID')        "`
+    RuleType     int64     `json:"ruleType"        xorm:"'rule_type'       bigint         comment('Type')           "`
+    RuleTitle    string    `json:"ruleTitle"       xorm:"'rule_title'      varchar(127)   comment('模型名称')        "`
+    TargetAttrId int64     `json:"targetAttrId"    xorm:"'target_attr_id'  bigint         comment('Target AttrId')  "`
+    RuleCode     string    `json:"ruleCode"        xorm:"'rule_code'       varchar(1023)  comment('Rule Code')      "`
 }
 
 func (t *BizObjectRuleInfo) TableName() string {

+ 0 - 1
viewmodels/biz_rule_info.go

@@ -4,7 +4,6 @@ type BizRuleInfo struct {
     RuleId      int64     `json:"ruleId"          xorm:"'rule_id'         bigint      pk comment('Rule ID')        "`
     RuleType    int64     `json:"ruleType"        xorm:"'rule_type'       bigint         comment('Type')           "`
     RuleTitle   string    `json:"ruleTitle"       xorm:"'rule_title'      varchar(127)   comment('模型名称')        "`
-    RuleCode    string    `json:"ruleCode"        xorm:"'rule_code'       varchar(127)   comment('模型名称')        "`
     Comment     string    `json:"comment"         xorm:"'comment'         varchar(255)   comment('描述')            "`
     IsFixed     int64     `json:"isFixed"         xorm:"'is_fixed'        int            comment('是否可修改')       "`
 }

+ 24 - 20
web/controllers/biz_object_rule_controller.go → web/controllers/biz_object_oam_rule_controller.go

@@ -6,21 +6,21 @@ import (
     "xps/service"
 )
 
-type BizObjectRuleController struct {
+type BizObjectOAMRuleController struct {
     Base
-    Service service.BizObjectRuleService
+    Service service.BizObjectOAMRuleService
 }
 
-func (c *BizObjectRuleController) BeforeActivation(b mvc.BeforeActivation) {
-    b.Handle("GET",     "/",                                    "GetList"       )
-    b.Handle("GET",     "/{bizId:int64}/{objectId:int64}",      "GetListById"   )
-    b.Handle("GET",     "/{roId:int64}",                        "GetById"       )
-    b.Handle("POST",    "/add",                                 "Create"        )
-    b.Handle("PUT",     "/update",                              "Update"        )
-    b.Handle("DELETE",  "/roId:int64}",                         "DeleteByID"    )
+func (c *BizObjectOAMRuleController) BeforeActivation(b mvc.BeforeActivation) {
+    b.Handle("GET",     "/",                                                         "GetList"       )
+    b.Handle("GET",     "/{bizId:int64}/{objectId:int64}/{oamId:int64}",             "GetListById"   )
+    b.Handle("GET",     "/{bizId:int64}/{objectId:int64}/{oamId:int64}/{roId:int64}", "GetById"      )
+    b.Handle("POST",    "/add",                                                       "Create"       )
+    b.Handle("PUT",     "/update",                                                    "Update"       )
+    b.Handle("DELETE",  "/{bizId:int64}/{objectId:int64}/{oamId:int64}/{roId:int64}", "DeleteByID"   )
 }
 
-func (c *BizObjectRuleController) GetList() *JsonResult {
+func (c *BizObjectOAMRuleController) GetList() *JsonResult {
     params    := c.buildParams()
     data, err := c.Service.GetList(params)
     if err != nil {
@@ -30,10 +30,11 @@ func (c *BizObjectRuleController) GetList() *JsonResult {
     }
 }
 
-func (c *BizObjectRuleController) GetListById(bizId, objectId int64) *JsonResult {
+func (c *BizObjectOAMRuleController) GetListById(bizId, objectId, oamId int64) *JsonResult {
     params    := c.buildParams()
     params["bizId"]    = bizId
     params["objectId"] = objectId
+    params["oamId"]    = oamId
     data, err := c.Service.GetList(params)
     if err != nil {
         return ResultErr(err.Error(), nil)
@@ -42,8 +43,8 @@ func (c *BizObjectRuleController) GetListById(bizId, objectId int64) *JsonResult
     }
 }
 
-func (c *BizObjectRuleController) GetById(roId int64) *JsonResult {
-    data, err := c.Service.GetById(roId)
+func (c *BizObjectOAMRuleController) GetById(bizId, objectId, oamId, orId int64) *JsonResult {
+    data, err := c.Service.GetById(bizId, objectId, oamId, orId)
     if err != nil {
         return ResultErr(err.Error(), nil)
     } else {
@@ -51,20 +52,20 @@ func (c *BizObjectRuleController) GetById(roId int64) *JsonResult {
     }
 }
 
-func (c *BizObjectRuleController) Create() *JsonResult {
-    oam   := datamodels.BizObjectRule{}
-    if err := c.Ctx.ReadJSON(&oam); err != nil {
+func (c *BizObjectOAMRuleController) Create() *JsonResult {
+    bor   := datamodels.BizObjectRule{}
+    if err := c.Ctx.ReadJSON(&bor); err != nil {
         return ResultErr("读取数据失败", nil)
     }
     
-    if err := c.Service.Create(&oam); err != nil {
+    if err := c.Service.Create(&bor); err != nil {
         return ResultErr(err.Error(), nil)
     } else {
         return ResultOk("新增成功", nil)
     }
 }
 
-func (c *BizObjectRuleController) Update() *JsonResult {
+func (c *BizObjectOAMRuleController) Update() *JsonResult {
     ro    := datamodels.BizObjectRule{}
     if err := c.Ctx.ReadJSON(&ro); err != nil {
         return ResultErr("读取数据失败", nil)
@@ -77,9 +78,12 @@ func (c *BizObjectRuleController) Update() *JsonResult {
     }
 }
 
-func (c *BizObjectRuleController) DeleteByID(roId int64) *JsonResult {
+func (c *BizObjectOAMRuleController) DeleteByID(bizId, objectId, oamId, orId int64) *JsonResult {
     m := make(map[string]interface{})
-    m["roId"]     = roId
+    m["bizId"]    = bizId
+    m["objectId"] = objectId
+    m["oamId"]    = oamId
+    m["orId"]     = orId
     if err := c.Service.Delete(m); err != nil {
         return ResultErr(err.Error(), nil)
     } else {