wu vor 1 Woche
Ursprung
Commit
8bba38396b

+ 9 - 0
src/custom/restcontroller/sale/customer/Hospital.java

@@ -537,14 +537,23 @@ public class Hospital extends Controller {
                 where.append(" and(");
                 where.append("t1.hospitaldepname like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append("or t1.remarks like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t3.enterprisename like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t5.name like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t6.doctors like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
 
         }
+
+        SQLFactory sqlFactory = new SQLFactory(this, "查询科室负责人");
+        sqlFactory.addParameter("siteid", siteid);
+
         Long sa_customersid = content.getLong("sa_customersid");
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_hospitaldep", "*").setTableAlias("t1");
         querySQL.addJoinTable(JOINTYPE.left, "sa_customers", "t2", "t2.sa_customersid=t1.sa_customersid and t2.siteid=t1.siteid");
         querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t3", "t3.sys_enterpriseid=t2.sys_enterpriseid and t3.siteid=t2.siteid", "enterprisename");
+        querySQL.addJoinTable(JOINTYPE.left, "sys_datateam", "t5", "t5.ownerid = t1.sa_hospitaldepid and t5.siteid = t1.siteid and t5.ownertable = 'sa_hospitaldep' and t5.isleader = 1");
+        querySQL.addJoinTable(JOINTYPE.left, sqlFactory, "t6", "t6.sa_hospitaldepid = t1.sa_hospitaldepid", "doctors");
         querySQL.setSiteid(siteid);
         querySQL.setWhere(where);
         querySQL.setWhere("t2.sa_customersid", sa_customersid);

+ 3 - 0
src/custom/restcontroller/sale/customer/SQL/查询科室负责人.sql

@@ -0,0 +1,3 @@
+SELECT sa_hospitaldepid,GROUP_CONCAT(doctorname) doctors from sa_doctor
+WHERE  isleader=1 and siteid=$siteid$
+GROUP BY sa_hospitaldepid