|
|
|
@ -3,12 +3,12 @@
|
|
|
|
|
|
|
|
|
|
-- 获取组织机构的最大主键号
|
|
|
|
|
#sql("getMaxPkByOrg")
|
|
|
|
|
select COALESCE(max(org_pk_num),0) as org_pk_num from t_base_organization
|
|
|
|
|
select id_int as org_pk_num from t_base_organization
|
|
|
|
|
#end
|
|
|
|
|
-- 获取指定单位或组织机构的信息
|
|
|
|
|
#sql("getOrgInfoById")
|
|
|
|
|
select org_id,org_code,org_name,parent_id,org_type_id,school_type_id,sort_id,create_time,is_virtual,third_party_id,
|
|
|
|
|
update_ts,b_use,org_pk_num,COALESCE(city_id, '-1') as city_id,COALESCE(area_id, '-1') as area_id,
|
|
|
|
|
update_ts,b_use,COALESCE(city_id, '-1') as city_id,COALESCE(area_id, '-1') as area_id,
|
|
|
|
|
COALESCE(main_school_id, '-1') as main_school_id,bureau_id,property_id,level_id
|
|
|
|
|
from t_base_organization where org_id=? and b_use=1
|
|
|
|
|
#end
|
|
|
|
@ -48,7 +48,7 @@
|
|
|
|
|
-- 获取学校列表
|
|
|
|
|
#sql("getSchoolList")
|
|
|
|
|
select t1.org_id,t1.org_code,t1.org_name,t1.parent_id,t1.org_type_id,t1.school_type_id,t1.sort_id,
|
|
|
|
|
t1.create_time,t1.update_ts,t1.b_use,t1.org_pk_num,t1.city_id,t1.area_id,t1.main_school_id,t1.bureau_id,
|
|
|
|
|
t1.create_time,t1.update_ts,t1.b_use,t1.city_id,t1.area_id,t1.main_school_id,t1.bureau_id,
|
|
|
|
|
(select t2.school_type_name from t_dm_schooltype as t2 where t2.school_type_id=t1.school_type_id) as school_type_name
|
|
|
|
|
from t_base_organization as t1 where t1.parent_id=#para(0) and t1.b_use=1 and t1.school_type_id>0
|
|
|
|
|
#end
|
|
|
|
@ -57,7 +57,7 @@
|
|
|
|
|
#sql("getSchoolListBySchoolType")
|
|
|
|
|
select t1.org_id,t1.org_code,t1.org_name,t1.parent_id,t1.org_type_id,
|
|
|
|
|
t1.school_type_id,t1.sort_id,t1.create_time,t1.update_ts,t1.b_use,
|
|
|
|
|
t1.org_pk_num,t1.city_id,t1.area_id,t1.main_school_id,t1.bureau_id,
|
|
|
|
|
t1.city_id,t1.area_id,t1.main_school_id,t1.bureau_id,
|
|
|
|
|
(select t2.school_type_name from t_dm_schooltype as t2 where t2.school_type_id=t1.school_type_id) as school_type_name
|
|
|
|
|
from t_base_organization as t1 where t1.parent_id=#para(0) and t1.b_use=1 and t1.school_type_id =#para(1)
|
|
|
|
|
#end
|
|
|
|
@ -68,7 +68,7 @@
|
|
|
|
|
select t1.org_id,t1.org_code,t1.org_name,t1.parent_id,t1.org_type_id,
|
|
|
|
|
t2.name as org_type_name,
|
|
|
|
|
t1.school_type_id,t1.sort_id,t1.create_time,
|
|
|
|
|
t1.update_ts,t1.b_use,t1.org_pk_num,t1.city_id,t1.area_id,t1.main_school_id,t1.bureau_id
|
|
|
|
|
t1.update_ts,t1.b_use,t1.city_id,t1.area_id,t1.main_school_id,t1.bureau_id
|
|
|
|
|
from t_base_organization as t1
|
|
|
|
|
inner join t_base_org_type_principalship as t2 on t2.id=t1.org_type_id
|
|
|
|
|
where t1.parent_id=#para(0) and t1.school_type_id<=0 and t1.b_use=1 order by t1.sort_id,t1.update_ts
|
|
|
|
|