|
|
@@ -1,4 +1,4 @@
|
|
|
-SELECT DISTINCT t4.sa_customersid,t6.enterprisename hospitalname,t1.sa_hospitaldepid,t4.hospitaldepname,t8.itemclassname, t2.itemid,t2.itemname,t2.model,t9.spec,CONCAT(t1.sa_hospitaldepid,';',t2.itemid) keyid
|
|
|
+SELECT DISTINCT t4.sa_customersid,t6.enterprisename hospitalname,t1.sa_hospitaldepid,t4.hospitaldepname,GROUP_CONCAT(t8.itemclassname) itemclassname, t2.itemid,t2.itemname,t2.model,t9.spec,CONCAT(t1.sa_hospitaldepid,';',t2.itemid) keyid
|
|
|
from sa_order t1
|
|
|
INNER JOIN sa_orderitems t2 ON t2.sa_orderid = t1.sa_orderid and t2.siteid = t1.siteid
|
|
|
LEFT JOIN sys_hr t3 ON t3.hrid = t1.saler_hrid
|
|
|
@@ -9,4 +9,5 @@ from sa_order t1
|
|
|
LEFT JOIN plm_itemclass t8 ON t8.itemclassid=t7.itemclassid
|
|
|
LEFT JOIN plm_item t9 ON t9.itemid=t2.itemid
|
|
|
WHERE t1.siteid = $siteid$ and t1.`status` in ('审核', '关闭') and YEAR (t1.checkdate) in ($year$) and t1.sa_customersid=$sa_customersid$ and $where$ and t1.deleted=0
|
|
|
+GROUP BY t4.sa_customersid,t6.enterprisename,t1.sa_hospitaldepid,t4.hospitaldepname,t2.itemid,t2.itemname,t2.model,t9.spec
|
|
|
ORDER BY t6.enterprisename,t4.hospitaldepname
|