|
@@ -74,3 +74,27 @@ func DeleteMultipleGraphConfigEdbMappingByEdbIds(configId, source int, edbIds []
|
|
|
_, err = o.Raw(sql, configId, source, edbIds).Exec()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func DeleteMultipleGraphConfigEdbMappingByChartInfoId(chartInfoId, configId, source int) (err error) {
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ to, err := o.Begin()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ defer func() {
|
|
|
+ if err != nil {
|
|
|
+ _ = to.Rollback()
|
|
|
+ } else {
|
|
|
+ _ = to.Commit()
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
+ sql := ` DELETE FROM multiple_graph_config_chart_mapping WHERE chart_info_id=? and multiple_graph_config_id = ? and source=?`
|
|
|
+ _, err = to.Raw(sql, chartInfoId, configId, source).Exec()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ sql = ` DELETE FROM multiple_graph_config_edb_mapping WHERE multiple_graph_config_id = ? and source=? `
|
|
|
+ _, err = to.Raw(sql, configId, source).Exec()
|
|
|
+ return
|
|
|
+}
|