|
|
|
@ -42,10 +42,10 @@ public class OrganizationModel {
|
|
|
|
|
String sql = Db.getSql("organization.getOrgInfoById");
|
|
|
|
|
List<Record> list = Db.find(sql, bureau_id);
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
|
|
resMap.put("city_id", list.get(0).getStr("city_id"));
|
|
|
|
|
resMap.put("area_id", list.get(0).getStr("area_id"));
|
|
|
|
|
resMap.put("main_school_id", list.get(0).getStr("main_school_id"));
|
|
|
|
|
resMap.put("school_type_id", list.get(0).getStr("school_type_id"));
|
|
|
|
|
resMap.put("city_id", list.getFirst().getStr("city_id"));
|
|
|
|
|
resMap.put("area_id", list.getFirst().getStr("area_id"));
|
|
|
|
|
resMap.put("main_school_id", list.getFirst().getStr("main_school_id"));
|
|
|
|
|
resMap.put("school_type_id", list.getFirst().getStr("school_type_id"));
|
|
|
|
|
return resMap;
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
@ -74,23 +74,23 @@ public class OrganizationModel {
|
|
|
|
|
map.put("area_code", "");
|
|
|
|
|
} else {
|
|
|
|
|
//如果是市
|
|
|
|
|
if (records.get(0).getStr("id").equals(records.get(0).getStr("city_id"))) {
|
|
|
|
|
if (records.getFirst().getStr("id").equals(records.getFirst().getStr("city_id"))) {
|
|
|
|
|
map.put("city_id", id);
|
|
|
|
|
map.put("area_id", NullGuid);
|
|
|
|
|
map.put("parent_id", records.get(0).getStr("parent_id"));
|
|
|
|
|
map.put("area_name", records.get(0).getStr("area_name"));
|
|
|
|
|
map.put("area_code", records.get(0).getStr("area_code"));
|
|
|
|
|
map.put("province_id", records.get(0).getStr("province_id"));
|
|
|
|
|
map.put("province_name", records.get(0).getStr("province_name"));
|
|
|
|
|
map.put("parent_id", records.getFirst().getStr("parent_id"));
|
|
|
|
|
map.put("area_name", records.getFirst().getStr("area_name"));
|
|
|
|
|
map.put("area_code", records.getFirst().getStr("area_code"));
|
|
|
|
|
map.put("province_id", records.getFirst().getStr("province_id"));
|
|
|
|
|
map.put("province_name", records.getFirst().getStr("province_name"));
|
|
|
|
|
} else//如果是县区
|
|
|
|
|
{
|
|
|
|
|
sql = Db.getSql("dm.getAreaById");
|
|
|
|
|
String city_id = Db.find(sql, id).get(0).getStr("parent_id");
|
|
|
|
|
String city_id = Db.find(sql, id).getFirst().getStr("parent_id");
|
|
|
|
|
map.put("city_id", city_id);
|
|
|
|
|
map.put("area_id", id);
|
|
|
|
|
map.put("parent_id", records.get(0).getStr("parent_id"));
|
|
|
|
|
map.put("area_name", records.get(0).getStr("area_name"));
|
|
|
|
|
map.put("area_code", records.get(0).getStr("area_code"));
|
|
|
|
|
map.put("parent_id", records.getFirst().getStr("parent_id"));
|
|
|
|
|
map.put("area_name", records.getFirst().getStr("area_name"));
|
|
|
|
|
map.put("area_code", records.getFirst().getStr("area_code"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return map;
|
|
|
|
@ -196,8 +196,8 @@ public class OrganizationModel {
|
|
|
|
|
record.set("bureau_id", bureau_id);
|
|
|
|
|
List<Record> rs = getAreaIdByParentId(bureau_id);
|
|
|
|
|
if (rs != null && !rs.isEmpty()) {
|
|
|
|
|
city_id = rs.get(0).getStr("city_id");
|
|
|
|
|
area_id = rs.get(0).getStr("area_id");
|
|
|
|
|
city_id = rs.getFirst().getStr("city_id");
|
|
|
|
|
area_id = rs.getFirst().getStr("area_id");
|
|
|
|
|
} else {
|
|
|
|
|
city_id = "-1";
|
|
|
|
|
area_id = "-1";
|
|
|
|
@ -238,7 +238,7 @@ public class OrganizationModel {
|
|
|
|
|
public List<Record> getAreaIdByParentId(String parent_id) {
|
|
|
|
|
List<Record> rs = getOrgInfoById(parent_id);
|
|
|
|
|
if (!rs.isEmpty()) {
|
|
|
|
|
String bureau_id = rs.get(0).getStr("bureau_id");
|
|
|
|
|
String bureau_id = rs.getFirst().getStr("bureau_id");
|
|
|
|
|
rs = getOrgInfoById(bureau_id);
|
|
|
|
|
if (!rs.isEmpty()) {
|
|
|
|
|
return rs;
|
|
|
|
@ -276,8 +276,8 @@ public class OrganizationModel {
|
|
|
|
|
int b_use = 0;
|
|
|
|
|
List<Record> rs = getOrgInfoById(org_id);
|
|
|
|
|
if (!rs.isEmpty()) {
|
|
|
|
|
create_time = DateUtil.parse(rs.get(0).getStr("create_time"));
|
|
|
|
|
b_use = rs.get(0).getInt("b_use");
|
|
|
|
|
create_time = DateUtil.parse(rs.getFirst().getStr("create_time"));
|
|
|
|
|
b_use = rs.getFirst().getInt("b_use");
|
|
|
|
|
}
|
|
|
|
|
record.set("create_time", create_time);
|
|
|
|
|
record.set("b_use", b_use);
|
|
|
|
@ -315,8 +315,8 @@ public class OrganizationModel {
|
|
|
|
|
|
|
|
|
|
List<Record> rs = getAreaIdByParentId(parent_id);
|
|
|
|
|
if (rs != null && !rs.isEmpty()) {
|
|
|
|
|
city_id = rs.get(0).getStr("city_id");
|
|
|
|
|
area_id = rs.get(0).getStr("area_id");
|
|
|
|
|
city_id = rs.getFirst().getStr("city_id");
|
|
|
|
|
area_id = rs.getFirst().getStr("area_id");
|
|
|
|
|
} else {
|
|
|
|
|
city_id = "-1";
|
|
|
|
|
area_id = "-1";
|
|
|
|
@ -331,9 +331,9 @@ public class OrganizationModel {
|
|
|
|
|
String bureau_id = null;
|
|
|
|
|
rs = getOrgInfoById(org_id);
|
|
|
|
|
if (!rs.isEmpty()) {
|
|
|
|
|
bureau_id = rs.get(0).getStr("bureau_id");
|
|
|
|
|
create_time = rs.get(0).getStr("create_time");
|
|
|
|
|
b_use = rs.get(0).getInt("b_use");
|
|
|
|
|
bureau_id = rs.getFirst().getStr("bureau_id");
|
|
|
|
|
create_time = rs.getFirst().getStr("create_time");
|
|
|
|
|
b_use = rs.getFirst().getInt("b_use");
|
|
|
|
|
}
|
|
|
|
|
record.set("bureau_id", bureau_id);
|
|
|
|
|
record.set("create_time", DateUtil.parse(create_time));
|
|
|
|
@ -354,7 +354,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getClassCountByBureauId(String org_id) {
|
|
|
|
|
String sql = Db.getSql("class.getClassCountByBureauId");
|
|
|
|
|
return Db.find(sql, org_id).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_id).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -367,7 +367,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getOrgCountByBureauId(String org_id) {
|
|
|
|
|
String sql = Db.getSql("organization.getOrgCountByBureauId");
|
|
|
|
|
return Db.find(sql, org_id, org_id).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_id, org_id).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -380,7 +380,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getTeacherCountByBureauId(String org_id) {
|
|
|
|
|
String sql = Db.getSql("loginPerson.getTeacherCountByBureauId");
|
|
|
|
|
return Db.find(sql, org_id).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_id).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -393,7 +393,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getTeacherCountByOrgId(String org_id) {
|
|
|
|
|
String sql = Db.getSql("loginPerson.getTeacherCountByOrgId");
|
|
|
|
|
return Db.find(sql, org_id).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_id).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -406,7 +406,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getStudentCountByBureauId(String org_id) {
|
|
|
|
|
String sql = Db.getSql("loginPerson.getStudentCountByBureauId");
|
|
|
|
|
return Db.find(sql, org_id).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_id).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -419,7 +419,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getParentCountByBureauId(String org_id) {
|
|
|
|
|
String sql = Db.getSql("loginPerson.getParentCountByBureauId");
|
|
|
|
|
return Db.find(sql, org_id).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_id).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -457,7 +457,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getOrgCodeCount(String org_code) {
|
|
|
|
|
String sql = Db.getSql("organization.getOrgCodeCount");
|
|
|
|
|
return Db.find(sql, org_code).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_code).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -470,7 +470,7 @@ public class OrganizationModel {
|
|
|
|
|
*/
|
|
|
|
|
public int getOrgCodeCountExceptSelf(String org_id, String org_code) {
|
|
|
|
|
String sql = Db.getSql("organization.getOrgCodeCountExceptSelf");
|
|
|
|
|
return Db.find(sql, org_code, org_id).get(0).getInt("c");
|
|
|
|
|
return Db.find(sql, org_code, org_id).getFirst().getInt("c");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|