|
@@ -495,6 +495,30 @@ func GetEdbRelationListByIds(edbIds []int, source int) (total int, list []*data_
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// GetEdbRelationList 获取指标引用列表
|
|
|
|
+func GetEdbRelationListById(edbId int, source int) (item *data_manage.BaseRelationEdbInfo, err error) {
|
|
|
|
+ var pars []interface{}
|
|
|
|
+ var condition string
|
|
|
|
+ condition += ` AND e.edb_info_id = ?`
|
|
|
|
+ pars = append(pars, edbId)
|
|
|
|
+ list := make([]*data_manage.BaseRelationEdbInfo, 0)
|
|
|
|
+ // 关联表语句
|
|
|
|
+ var addFieldStr, joinTableStr string
|
|
|
|
+ // 供应商停用
|
|
|
|
+ if source == utils.DATA_SOURCE_MYSTEEL_CHEMICAL {
|
|
|
|
+ joinTableStr = ` LEFT JOIN base_from_mysteel_chemical_index z ON e.edb_code = z.index_code `
|
|
|
|
+ addFieldStr = ` ,z.is_supplier_stop `
|
|
|
|
+ }
|
|
|
|
+ _, list, err = data_manage.GetEdbInfoRelationList(condition, pars, addFieldStr, joinTableStr, "", 0, 1)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if len(list) > 0 {
|
|
|
|
+ item = list[0]
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+}
|
|
|
|
+
|
|
// 查找当前计算指标的所有溯源指标
|
|
// 查找当前计算指标的所有溯源指标
|
|
func GetEdbListByEdbInfoId(edbInfoList []*data_manage.EdbInfo, needPredict bool) (edbMappingListMap map[int]*data_manage.EdbInfoCalculateMapping, edbInfoMappingRootIdsMap map[int][]int, err error) {
|
|
func GetEdbListByEdbInfoId(edbInfoList []*data_manage.EdbInfo, needPredict bool) (edbMappingListMap map[int]*data_manage.EdbInfoCalculateMapping, edbInfoMappingRootIdsMap map[int][]int, err error) {
|
|
if len(edbInfoList) == 0 {
|
|
if len(edbInfoList) == 0 {
|