query.go 815 B

12345678910111213141516171819
  1. package multiple_graph_config_chart_mapping
  2. import (
  3. "hongze/hongze_yb/global"
  4. )
  5. // GetMultipleGraphConfigChartMappingByChartId 根据图表id和来源获取关联关系
  6. func GetMultipleGraphConfigChartMappingByChartId(chartId int) (item *MultipleGraphConfigChartMapping, err error) {
  7. err = global.MYSQL["data"].Model(MultipleGraphConfigChartMapping{}).Where("chart_info_id = ?", chartId).First(&item).Error
  8. return
  9. }
  10. // GetMultipleGraphConfigChartMappingByIdAndSource 根据配置id和来源获取关联关系
  11. func GetMultipleGraphConfigChartMappingByIdAndSource(configId, source int) (item *MultipleGraphConfigChartMapping, err error) {
  12. err = global.MYSQL["data"].Model(MultipleGraphConfigChartMapping{}).Where("multiple_graph_config_id = ? AND source = ?", configId, source).First(&item).Error
  13. return
  14. }