Englische Texte, Kopiericon, Get-Route für suche

This commit is contained in:
2026-03-19 15:39:52 +01:00
parent 1ad3443433
commit e399019001
4 changed files with 205 additions and 5 deletions

View File

@@ -27,6 +27,8 @@ const TEILE_OUTPUT_COLUMNS = [
'Teil',
'Bez',
'Bez2',
'EngBez1',
'EngBez2',
'Ben7',
'Ben8',
'Hersteller',
@@ -98,7 +100,14 @@ const fullTextSearch = async (searchTerm, statusFilter) => {
WHERE ek.[Teil] = t.Teil
AND tx.[Text] LIKE @${paramName} COLLATE SQL_Latin1_General_CP1_CI_AS
)`;
return `(${teileCond} OR ${textCond})`;
const tnbCond = `EXISTS (
SELECT 1
FROM TEXTE1 tx1 WITH (NOLOCK)
WHERE tx1.Id = N'TNB'
AND tx1.Schluessel = t.Teil
AND tx1.[Text] LIKE @${paramName} COLLATE SQL_Latin1_General_CP1_CI_AS
)`;
return `(${teileCond} OR ${textCond} OR ${tnbCond})`;
});
let whereClause = wordConditions.join(' AND ');
@@ -116,6 +125,8 @@ const fullTextSearch = async (searchTerm, statusFilter) => {
t.Teil,
t.Bez,
t.Bez2,
en.EngBez1,
en.EngBez2,
t.Ben7,
t.Ben8,
t.Ben43,
@@ -127,6 +138,22 @@ const fullTextSearch = async (searchTerm, statusFilter) => {
ts.Ersatz AS Ersatz,
ts.PrsVkTerm
FROM [${tableConfig.tableName}] t WITH (NOLOCK)
OUTER APPLY (
SELECT
LEFT(src.FullText, 30) AS EngBez1,
CASE
WHEN LEN(src.FullText) > 30 THEN SUBSTRING(src.FullText, 31, 30)
ELSE N''
END AS EngBez2
FROM (
SELECT TOP 1
ISNULL(tx1.[Text], N'') AS FullText
FROM TEXTE1 tx1 WITH (NOLOCK)
WHERE tx1.Id = N'TNB'
AND tx1.Schluessel = t.Teil
ORDER BY ISNULL(tx1.Zeile, 32767), tx1.ISN
) src
) en
OUTER APPLY (
SELECT TOP 1 MemoID
FROM EKATSS WITH (NOLOCK)