|
|
@@ -118,17 +118,26 @@ public class agents2 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);
|
|
|
+
|
|
|
+
|
|
|
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.inner, "sa_agents_hospital", "t4", "t4.sa_hospitaldepid=t1.sa_hospitaldepid and t4.siteid=t1.siteid", "sa_agents_hospitalid");
|
|
|
+ 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("t4.sa_agentsid",sa_agentsid);
|
|
|
+ querySQL.setWhere("t4.sa_agentsid", sa_agentsid);
|
|
|
querySQL.setPage(pageSize, pageNumber).setOrderBy(pageSorting);
|
|
|
Rows rows = querySQL.query();
|
|
|
|
|
|
@@ -139,7 +148,6 @@ public class agents2 extends Controller {
|
|
|
//系统标签
|
|
|
HashMap<Long, ArrayList<String>> sysTagList = DataTag.queryTag(this, "sa_hospitaldep", ids, true);
|
|
|
Rows stageRows = dbConnect.runSqlQuery("SELECT stagename,sequence from sa_devstage WHERE siteid='" + siteid + "' order by sequence");
|
|
|
- RowsMap doctorRowsMap = CommonHepler.getDoctorRowsMap(this, ids);
|
|
|
for (Row row : rows) {
|
|
|
Long id = row.getLong("sa_hospitaldepid");
|
|
|
row.put("leader", leaderRows.get(row.getString("sa_hospitaldepid")));
|
|
|
@@ -152,9 +160,6 @@ public class agents2 extends Controller {
|
|
|
row.put("tag", tag);
|
|
|
//系统标签
|
|
|
row.put("tag_sys", sys_tag);
|
|
|
- //科室负责人
|
|
|
- Rows doctorRows = doctorRowsMap.getOrDefault(id.toString(), new Rows());
|
|
|
- row.putIfAbsent("doctors", StringUtils.join(doctorRows.toArray("doctorname"), ","));
|
|
|
String stagename = row.getString("stagename");
|
|
|
for (Row stageRow : stageRows) {
|
|
|
if (stagename.equals(stageRow.getString("stagename"))) {
|
|
|
@@ -288,9 +293,9 @@ public class agents2 extends Controller {
|
|
|
where.append(" and t1.sa_hospitaldepid in (SELECT ownerid from sys_enterprise_tradefield t1 " +
|
|
|
"INNER JOIN sys_hr t2 ON t2.hrid=t1.hrid and t2.siteid=t1.siteid " +
|
|
|
"INNER JOIN sys_datateam t3 ON t3.userid=t2.userid and t3.ownertable='sa_hospitaldep' and t3.isleader=1 and t3.siteid=t2.siteid " +
|
|
|
- "WHERE sa_agentsid="+sa_agentsid+")");
|
|
|
+ "WHERE sa_agentsid=" + sa_agentsid + ")");
|
|
|
where.append(" and t1.sa_hospitaldepid not in (SELECT sa_hospitaldepid from sa_agents_hospital " +
|
|
|
- "WHERE sa_agentsid="+sa_agentsid+")");
|
|
|
+ "WHERE sa_agentsid=" + sa_agentsid + ")");
|
|
|
|
|
|
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");
|