- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
"SELECT " +
"2 AS recType," +
"1 AS cnt," +
"'' AS vndName," +
"'' AS catName," +
"off.orderBy1S AS orderBy1S," +
"off._id AS _id," +
"off.vendorCode AS vendorCode," +
"off.price AS price," +
"off.currencyId AS currencyId," +
"off.thumbnail AS thumbnail," +
"off.name AS name," +
"IFNULL(crt.quantity,0) AS quantityItem," +
"off.queryRest AS queryRest," +
"off.valueRest AS valueRest," +
"off.lastChangedRest AS lastChangedRest," +
"off.price_uah_ir AS price_uah_ir," +
"IFNULL(vlt.[rate],0) AS rate " + //валютный курс для currencyId товара
"FROM tOffer AS off " +
"LEFT JOIN tCart AS crt ON off.vendorCode=crt.offerId " +
"LEFT JOIN tCurrency AS vlt ON off.currencyId=vlt.valute " +
"WHERE off.vendorName='" + BRAND_NAME + "' AND off.categoryId=" + CATEGORY_ID + " AND (off.name LIKE " + nameFilter + ") " +
"UNION " +
"SELECT " +
"1," +
"COUNT(*)," +
"MAX(vnd.name)," +
"IFNULL(cat.name,'')," +
"0," +
"0," +
"0," +
"0," +
"''," +
"''," +
"vnd.name," +
"0," +
"0," +
"''," +
"''," +
"0," +
"0 " +
"FROM tOffer AS off " +
"LEFT JOIN tVendor AS vnd ON off.vendorName=vnd.name " +
"INNER JOIN tCategory AS cat ON off.categoryId=cat._id " +
"WHERE off.vendorName='" + BRAND_NAME + "' AND off.categoryId=" + CATEGORY_ID + " AND (off.name LIKE " + nameFilter + ") " +
"GROUP BY vnd.name HAVING COUNT(*)>0 " +
"UNION " +
"SELECT " +
"3," +
"COUNT(*)," +
"MAX('Другой товар')," +
"''," +
"0," +
"0," +
"0," +
"0," +
"''," +
"''," +
"'Другой товар'," +
"0," +
"0," +
"''," +
"''," +
"0," +
"0 " +
"FROM tOffer AS off " +
"WHERE off.vendorName<>'" + BRAND_NAME + "' AND (off.name LIKE " + nameFilter + ") " +
"GROUP BY 'Другой товар' HAVING COUNT(*)>0 " +
"UNION " +
"SELECT " +
"4," +
"1," +
"''," +
"''," +
"off.orderBy1S," +
"off._id," +
"off.vendorCode," +
"off.price," +
"off.currencyId," +
"off.thumbnail," +
"off.name," +
"IFNULL(crt.quantity,0)," +
"off.queryRest," +
"off.valueRest," +
"off.lastChangedRest," +
"off.price_uah_ir," +
"IFNULL(vlt.[rate],0) " + //валютный курс для currencyId товара
"FROM tOffer AS off " +
"LEFT JOIN tCart AS crt ON off.vendorCode=crt.offerId " +
"LEFT JOIN tCurrency AS vlt ON off.currencyId=vlt.valute " +
"WHERE off.vendorName<>'" + BRAND_NAME + "' AND (off.name LIKE " + nameFilter + ") " +
"ORDER BY recType,orderBy1S ";