main
黄海 3 years ago
parent db608cca0b
commit 0377c29acd

@ -24,7 +24,7 @@ public class OrganizationModel {
* @return
*/
public Record getOrgInfo(String org_id) {
String sql = "select t1.org_id,t1.org_name,t1.parent_id,(select count(1) from t_base_organization as t2 where t1.org_id=t2.parent_id) as cnt from t_base_organization as t1 where t1.org_id=?";
String sql = "select t1.org_id,t1.org_name,t1.school_type_id,t1.department_type_id,t1.parent_id,(select count(1) from t_base_organization as t2 where t1.org_id=t2.parent_id) as cnt from t_base_organization as t1 where t1.org_id=?";
return Db.findFirst(sql, org_id);
}
@ -522,7 +522,11 @@ public class OrganizationModel {
*/
public List<Record> getOrgTreeByBureauId(String bureau_id) {
String sql = Db.getSql("organization.getOrgTreeByBureauId");
return Db.find(sql, bureau_id);
List<Record> list = Db.find(sql, bureau_id);
Record r = getOrgInfo(bureau_id);
String school_type_id = r.getStr("school_type_id");
for (Record record : list) record.set("school_type_id", school_type_id);
return list;
}
/**

@ -84,7 +84,7 @@
-- 组织机构部门树
#sql("getOrgTreeByBureauId")
select org_id,org_name,(case when bureau_id=org_id then '-1' else parent_id end) as parent_id,bureau_id from t_base_organization where bureau_id=?
select org_id,org_name,(case when bureau_id=org_id then '-1' else parent_id end) as parent_id,bureau_id,school_type_id,department_type_id from t_base_organization where bureau_id=?
and b_use=1 order by sort_id,update_ts
#end

Loading…
Cancel
Save