feat(silo attached detach): added in silo attach detach setup in the silo card
This commit is contained in:
42
server/services/sqlServer/querys/silo/connectionCheck.ts
Normal file
42
server/services/sqlServer/querys/silo/connectionCheck.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
export const notconnectedToMachine = `
|
||||
select distinct HumanReadableId as machineId
|
||||
,Location as location
|
||||
,name
|
||||
--,[SiloHumanReadableId]
|
||||
from [test1_AlplaPROD2.0_Read].[masterData].[Machine] (nolock) m
|
||||
|
||||
left join
|
||||
[test1_AlplaPROD2.0_Read].[issueMaterial].[SiloAssignment] (nolock) s
|
||||
on s.MachineId = m.id
|
||||
|
||||
|
||||
where m.id not in (
|
||||
SELECT
|
||||
[MachineId]
|
||||
|
||||
FROM [test1_AlplaPROD2.0_Read].[issueMaterial].[SiloAssignment]
|
||||
|
||||
where [SiloHumanReadableId] = [siloID]
|
||||
)
|
||||
|
||||
and name not like '%REWORK%'
|
||||
`;
|
||||
|
||||
export const connectedToMachine = `
|
||||
SELECT
|
||||
[SiloHumanReadableId]
|
||||
,[SiloDescription]
|
||||
,[MaterialHumanReadableId]
|
||||
,[MaterialDescription]
|
||||
,[ConnectionDate]
|
||||
,m.HumanReadableId as machineId
|
||||
,m.Location as location
|
||||
,m.Name as name
|
||||
FROM [test1_AlplaPROD2.0_Read].[issueMaterial].[SiloAssignment] s
|
||||
|
||||
left join
|
||||
[test1_AlplaPROD2.0_Read].[masterData].[Machine] m
|
||||
on m.id = s.MachineId
|
||||
|
||||
where [SiloHumanReadableId] = [siloID]
|
||||
`;
|
||||
Reference in New Issue
Block a user