public JSONObject getDataSyrsBzsAndSyrs(String type,String date){
String sjklx = CodeRepositoryUtil.getValue("SJKLX","2");//实名制是2
JSONObject jsonObject=new JSONObject();//
//以下查询人员
String sql="select (select count(*) from "+sjklx+".t_ry_jbxx t where t.zwjb in('121','111'))tjzz," +
"(select count(*) from "+sjklx+".t_ry_jbxx t where t.zwjb in('122','112')) tjfz," +
"(select count(*) from "+sjklx+".t_ry_jbxx t where t.zwjb in('131')) xjczz," +
"(select count(*) from "+sjklx+".t_ry_jbxx t where t.zwjb in('132')) xjcfz," +
"(select count(*) from "+sjklx+".t_ry_jbxx t) zj from dual"; //页面运算 减去上面的就是其他
JSONArray obj=DatabaseOptUtils.listObjectsBySqlAsJson(this,sql);
if(obj!=null&&obj.size()>0){
jsonObject=obj.getJSONObject(0);
}
//查询编制
CallableStatement cs=null;
Connection connection=null;
ResultSet rs = null;
try {
connection= this.jdbcTemplate.getDataSource().getConnection();
String smz= CodeRepositoryUtil.getValue("SJKLX","2");
cs = connection.prepareCall("{call "+smz+".proc_report_1_5(?,?)}");
cs.setString(1, "320000");
cs.registerOutParameter(2, OracleTypes.CURSOR);
cs.execute();
rs = (ResultSet) cs.getObject(2);
int i=0;
while (rs.next()) {
if(i==17){
jsonObject.put("bz",rs.getInt(3));
jsonObject.put("zz",rs.getInt(4));
}
i++;
}
} catch (SQLException throwables) {
throwables.printStackTrace();
}finally{
try {
if(rs!=null){
rs.close();
}
if (cs!=null) {
cs.close();
}
if(connection!=null) {
connection.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return jsonObject;
}