|
@@ -142,8 +142,11 @@
|
|
|
<when notnull="@arg_createby">
|
|
|
u_mattress.createby = @arg_createby
|
|
|
</when>
|
|
|
+ <!-- <when notempty="@arg_search"> -->
|
|
|
+ <!-- EXISTS (SELECT 1 FROM dbo.SC_SPLIT(@arg_search, ',') A WHERE A.Item <> '' AND (u_mattress.mattresscode LIKE '%'+LTRIM(RTRIM(A.Item))+'%' OR u_mattress.mattressrelcode like '%'+LTRIM(RTRIM(A.Item))+'%' OR u_mattress.mattressname like '%'+LTRIM(RTRIM(A.Item))+'%')) -->
|
|
|
+ <!-- </when> -->
|
|
|
<when notempty="@arg_search">
|
|
|
- EXISTS (SELECT 1 FROM dbo.SC_SPLIT(@arg_search, ',') A WHERE A.Item <> '' AND (u_mattress.mattresscode LIKE '%'+LTRIM(RTRIM(A.Item))+'%' OR u_mattress.mattressrelcode like '%'+LTRIM(RTRIM(A.Item))+'%' OR u_mattress.mattressname like '%'+LTRIM(RTRIM(A.Item))+'%'))
|
|
|
+ u_mattress.mattressid IN (SELECT t.mattressid FROM dbo.fn_GetMattressAndRelations(@arg_search) t)
|
|
|
</when>
|
|
|
<when notempty="@arg_erp_mtrlcode">
|
|
|
EXISTS (SELECT 1 FROM dbo.SC_SPLIT(@arg_erp_mtrlcode, ',') A WHERE A.Item <> '' AND (u_mattress.erp_mtrlcode LIKE '%'+LTRIM(RTRIM(A.Item))+'%'))
|