Support #2202 » PDSCOMBOASSETIDRPT.sql
1 |
ALTER PROCEDURE PDSCOMBOASSETIDRPT |
---|---|
2 |
(
|
3 |
@AssetType VARCHAR(20) |
4 |
,@AssetClass VARCHAR(20) |
5 |
,@AssetCode VARCHAR(20) |
6 |
)
|
7 |
AS
|
8 |
|
9 |
--DECLARE @AssetType VARCHAR(20) = 'AST0004'
|
10 |
--DECLARE @AssetClass VARCHAR(20) = ''
|
11 |
--DECLARE @AssetCode VARCHAR(20) = ''
|
12 |
|
13 |
SELECT DISTINCT assetid.AssetID, assetid.AssetName, assetid.AssetCode, assetcode.AssetType, fixasset.AssetClass |
14 |
FROM PMDAST0002 AS assetid |
15 |
LEFT JOIN pmdast0001 AS assetcode |
16 |
ON assetid.AssetCode = assetcode.AssetCode |
17 |
LEFT JOIN PCMFILOFIXASSET as fixasset |
18 |
ON fixasset.AssetType = assetcode.AssetType |
19 |
WHERE (assetcode.AssetType = @AssetType OR @AssetType = '') |
20 |
AND (fixasset.AssetClass = @AssetClass OR @AssetClass = '') |
21 |
AND (assetid.AssetCode = @AssetCode OR @AssetCode = '') |