AUDACON Технические данные

Вывод разделов технических данных

MGID
Идентификатор раздела
TextStr
Название раздела
ImageName
Изображение раздела
SortNr
Сортировка раздела
SET @TypeID = 52179; /* AUDI A4 (8K2, B8) 1.8 TFSI 2008-НВ */

SELECT DISTINCT TB_Topic_MainGR.MGID, TB_Topic_MainGR_TXT.TextStr, TB_Image.ImageName, TB_Topic_MainGR.SortNr
FROM TB_Topic_MainGR
INNER JOIN TB_Topic_MainGRSubGR ON TB_Topic_MainGR.MGID = TB_Topic_MainGRSubGR.MGID
INNER JOIN TB_Topic_MainGR_TXT ON TB_Topic_MainGR.MGTextID = TB_Topic_MainGR_TXT.MGTextID AND (TB_Topic_MainGR_TXT.LangCode = 'ru')
INNER JOIN TB_Topic_SubGRItem ON TB_Topic_MainGRSubGR.SGRID = TB_Topic_SubGRItem.SGRID
INNER JOIN TB_AD_AD ON TB_Topic_SubGRItem.ItemMpID = TB_AD_AD.ItemMpID AND TB_AD_AD.TypeID = @TypeID
INNER JOIN TB_AD_TypeValueCol ON TB_AD_AD.TypeValueID = TB_AD_TypeValueCol.TypeValueID
LEFT OUTER
JOIN TB_AD_ValueCountryRestriction ON TB_AD_TypeValueCol.TypeValueColID = TB_AD_ValueCountryRestriction.TypeValueColID AND ((TB_AD_ValueCountryRestriction.CountryID = 51 AND TB_AD_ValueCountryRestriction.Exclude = 1) OR (TB_AD_ValueCountryRestriction.Exclude = 0))
LEFT OUTER
JOIN TB_Image ON TB_Topic_MainGR.ImageID = TB_Image.ImageID
WHERE ((TB_AD_ValueCountryRestriction.TypeValueColID IS NULL) OR (TB_AD_ValueCountryRestriction.CountryID = 51 AND TB_AD_ValueCountryRestriction.Exclude = 0))
ORDER BY TB_Topic_MainGR.SortNr


Вывод технической информации раздела


SGRID
Идентификатор раздела
SGTextStr
Название раздела
SortNr
Сортировка раздела
ItemMpID
Идентификатор параметра
ItemMpText
Название параметра
QualColTextStr
Уточнение применения
ADQuantityTextStr
Единицы измерения
AddTextStr
Дополнительные данные
ImageName
Изображение
ItemSort
Уровень сортировки
MainGRSort
Уровень сортировки
SET @MGID = 13; /* Топливная система */
SET @TypeID = 52179; /* AUDI A4 (8K2, B8) 1.8 TFSI 2008-НВ */
SET @COUNTRYID = 51; /* Страна применения - Россия */

SELECT DISTINCT TB_Topic_MainGRSubGR.SGRID, TB_Topic_SubGR_TXT.TextStr SGTextStr, TB_Topic_SubGRItem.SortNr, TB_Topic_SubGRItem.ItemMpID, TB_Topic_ItemMp_TXT.TextStr ItemMpText, TB_Qual_Qual_TXT.TextStr QualColTextStr, TB_AD_ADValue_TXT.TextStr ValueText, TB_AD_ADQuantity_TXT.TextStr ADQuantityTextStr, TB_AD_ADAddText_TXT.TextStr AddTextStr, ItemImage.ImageName, TB_AD_TypeValueCol.SortNr ItemSort, TB_Topic_MainGRSubGR.SortNr MainGRSort
FROM TB_Topic_MainGRSubGR
INNER JOIN TB_Topic_SubGR ON TB_Topic_MainGRSubGR.SGRID = TB_Topic_SubGR.SGRID AND TB_Topic_MainGRSubGR.MGID = @MGID
INNER JOIN TB_Topic_SubGRItem ON TB_Topic_SubGR.SGRID = TB_Topic_SubGRItem.SGRID
INNER JOIN TB_Topic_SubGR_TXT ON TB_Topic_SubGR.SGRTextID = TB_Topic_SubGR_TXT.SGRTextID AND (TB_Topic_SubGR_TXT.LangCode = 'ru')
INNER JOIN TB_AD_AD ON TB_Topic_SubGRItem.ItemMpID = TB_AD_AD.ItemMpID AND TB_AD_AD.TypeID = @TypeID
INNER JOIN TB_AD_TypeValueCol ON TB_AD_AD.TypeValueID = TB_AD_TypeValueCol.TypeValueID
INNER JOIN TB_AD_ADValue ON TB_AD_TypeValueCol.ValueID = TB_AD_ADValue.ValueID
LEFT OUTER
JOIN TB_AD_ValueCountryRestriction ON TB_AD_TypeValueCol.TypeValueColID = TB_AD_ValueCountryRestriction.TypeValueColID AND ((TB_AD_ValueCountryRestriction.CountryID = @COUNTRYID AND TB_AD_ValueCountryRestriction.Exclude = 1) OR (TB_AD_ValueCountryRestriction.Exclude = 0))
INNER JOIN TB_AD_ADValue_TXT ON TB_AD_ADValue.ValueID = TB_AD_ADValue_TXT.ValueID AND TB_AD_ADValue_TXT.LangCode = 'ru'
LEFT OUTER
JOIN TB_AD_ADQuantity_TXT ON TB_AD_ADValue.QuantityID = TB_AD_ADQuantity_TXT.QuantityID AND TB_AD_ADQuantity_TXT.LangCode = 'ru'
LEFT OUTER
JOIN TB_AD_ADAddText_TXT ON TB_AD_ADValue.AddTextID = TB_AD_ADAddText_TXT.AddTextID AND TB_AD_ADAddText_TXT.LangCode = 'ru'
LEFT OUTER
JOIN TB_Image ItemImage ON TB_AD_ADValue.ImageID = ItemImage.ImageID
INNER JOIN TB_Topic_ItemMp_TXT TB_Topic_ItemMp_TXT ON TB_AD_AD.ItemMpID = TB_Topic_ItemMp_TXT.ItemMpID AND TB_Topic_ItemMp_TXT.LangCode = 'ru'
LEFT OUTER
JOIN TB_Qual_Qual_TXT TB_Qual_Qual_TXT ON TB_AD_AD.QualColID = TB_Qual_Qual_TXT.QualColID AND TB_Qual_Qual_TXT.LangCode = 'ru' AND TB_Qual_Qual_TXT.QualColID <> 0
WHERE ((TB_AD_ValueCountryRestriction.TypeValueColID IS NULL) OR (TB_AD_ValueCountryRestriction.CountryID = @COUNTRYID AND TB_AD_ValueCountryRestriction.Exclude = 0))
ORDER BY MainGRSort, TB_Topic_SubGRItem.SortNr, ItemSort