|
@@ -15,7 +15,9 @@ SELECT
|
|
|
t9.itemno,
|
|
t9.itemno,
|
|
|
t9.itemname,
|
|
t9.itemname,
|
|
|
t9.model,
|
|
t9.model,
|
|
|
- t9.spec
|
|
|
|
|
|
|
+ t9.spec,
|
|
|
|
|
+ t10.begdate cardbegdate,
|
|
|
|
|
+ t10.enddate cardenddate
|
|
|
FROM
|
|
FROM
|
|
|
sa_serviceorder t1
|
|
sa_serviceorder t1
|
|
|
LEFT JOIN sys_enterprise t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid
|
|
LEFT JOIN sys_enterprise t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid
|
|
@@ -29,4 +31,5 @@ FROM
|
|
|
left join sys_hr t7 on t7.hrid=t1.saler_hrid and t7.siteid=t1.siteid
|
|
left join sys_hr t7 on t7.hrid=t1.saler_hrid and t7.siteid=t1.siteid
|
|
|
left join (SELECT * FROM (SELECT *,ROW_NUMBER() OVER (PARTITION BY sa_serviceorderid ORDER BY sa_serviceorderitemsid ASC) AS rowno FROM sa_serviceorderitems) t WHERE rowno = 1) t8 on t8.sa_serviceorderid=t1.sa_serviceorderid and t8.siteid=t1.siteid
|
|
left join (SELECT * FROM (SELECT *,ROW_NUMBER() OVER (PARTITION BY sa_serviceorderid ORDER BY sa_serviceorderitemsid ASC) AS rowno FROM sa_serviceorderitems) t WHERE rowno = 1) t8 on t8.sa_serviceorderid=t1.sa_serviceorderid and t8.siteid=t1.siteid
|
|
|
left join plm_item t9 on t9.itemid=t8.itemid and t9.siteid=t8.siteid
|
|
left join plm_item t9 on t9.itemid=t8.itemid and t9.siteid=t8.siteid
|
|
|
|
|
+ left join sa_warrantycard t10 on t8.cardno=t10.cardno
|
|
|
where t1.siteid=$siteid$ and t1.sa_serviceorderid=$sa_serviceorderid$
|
|
where t1.siteid=$siteid$ and t1.sa_serviceorderid=$sa_serviceorderid$
|