You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2321 lines
159 KiB
2321 lines
159 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Data;
|
|
using System.Text;
|
|
using System.Collections;
|
|
using System.Reflection;
|
|
using System.Web.Script.Serialization;
|
|
using FangYar.Model;
|
|
using FangYar.BLL;
|
|
using System.IO;
|
|
using System.Drawing;
|
|
using FangYar.Common;
|
|
|
|
namespace FangYar.WebUI.ashx
|
|
{
|
|
/// <summary>
|
|
/// OaLeaveHandler 的摘要说明
|
|
/// </summary>
|
|
public class FireOrgHandler : IHttpHandler
|
|
{
|
|
private FangYar.BLL.FIRE.FIRE_ORG bll = new FangYar.BLL.FIRE.FIRE_ORG();
|
|
private FangYar.BLL.ToTree_BLL blltree = new BLL.ToTree_BLL();
|
|
private FangYar.BLL.TBL.SysAreaBLL abll = new BLL.TBL.SysAreaBLL();
|
|
|
|
public void ProcessRequest(HttpContext context)
|
|
{
|
|
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Other, "组织机构操作请求", "");
|
|
|
|
context.Response.ContentType = "text/plain";
|
|
string action = context.Request.Params["Action"];
|
|
string returnstr = "";
|
|
|
|
switch (action)
|
|
{
|
|
case "OrgTree":
|
|
returnstr = GetOrgDeptTree(context);
|
|
break;
|
|
case "OrgList2":
|
|
returnstr = GetOrgTree(context);
|
|
break;
|
|
case "AreaList":
|
|
returnstr = GetAreaList(context);
|
|
break;
|
|
case "GetChildAreaList":
|
|
returnstr = GetChildAreaList(context);
|
|
break;
|
|
case "AreaList2":
|
|
returnstr = GetAreaList2(context);
|
|
break;
|
|
case "AreaPID":
|
|
returnstr = GetAreaPID(context);
|
|
break;
|
|
case "OrgList":
|
|
returnstr = GetOrgList(context);
|
|
break;
|
|
case "GetOrg":
|
|
returnstr = GetOrg(context);
|
|
break;
|
|
case "Add":
|
|
returnstr = AddOrg(context);
|
|
break;
|
|
case "Edit":
|
|
returnstr = EditOrg(context);
|
|
break;
|
|
case "Del":
|
|
returnstr = DelOrg(context);
|
|
break;
|
|
case "getFireOrgTree":
|
|
returnstr = getFireOrgTree(context);
|
|
break;
|
|
case "getFireOrgName":
|
|
returnstr = getFireOrgName(context);
|
|
break;
|
|
case "OrgList3":
|
|
returnstr = GetOrgList3(context);
|
|
break;
|
|
//根据地区编码获取组织机构ID
|
|
case "getOrgIdByCity":
|
|
returnstr = GetOrgIdByCity(context);
|
|
break;
|
|
//根据地区编码获取地区城市名称
|
|
case "getCityNameByCity":
|
|
returnstr = getCityNameByCity(context);
|
|
break;
|
|
case "GetDeptTree":
|
|
returnstr = GetDeptTree(context);
|
|
break;
|
|
case "GetOrgChilds":
|
|
returnstr = GetOrgChilds(context);
|
|
break;
|
|
|
|
case "expLackStatisticsZD"://导出缺失项统计数据(总队)
|
|
returnstr = expLackStatisticsZD(context);
|
|
break;
|
|
case "expLackStatistics"://导出缺失项统计数据
|
|
returnstr = expLackStatistics(context);
|
|
break;
|
|
case "expLackStatisticsZhidui"://导出缺失项统计数据(支队)
|
|
returnstr = expLackStatisticsZhidui(context);
|
|
break;
|
|
case "GetCampDayStat"://查询各支队数据
|
|
returnstr = GetCampDayStat(context);
|
|
break;
|
|
case "GetCampDayStatTimRange"://根据时间范围查询各支队数据
|
|
returnstr = GetCampDayStatTimRange(context);
|
|
break;
|
|
case "GetCampDayStatTimRangeZD"://根据时间范围查询各支队数据
|
|
returnstr = GetCampDayStatTimRangeZD(context);
|
|
break;
|
|
|
|
}
|
|
|
|
context.Response.Write(returnstr);
|
|
}
|
|
|
|
|
|
|
|
|
|
//机构树
|
|
private string GetOrgTree(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
string usersUid = context.Request.Params["usersUid"];
|
|
try
|
|
{
|
|
string sql = " SELECT IS_SUBCAMPVIDEO from tbl_sys_emp WHERE USERS_UID='" + usersUid + "' ";
|
|
var dt = FangYar.Common.MySqlHelper.QueryTable(sql);
|
|
if (dt.Rows.Count > 0)
|
|
{
|
|
if ((dt.Rows[0]["IS_SUBCAMPVIDEO"] + "").Equals("1"))
|
|
{
|
|
orgId = WebCommonUtil.GetOrgIdDownLevelToUpLevel(orgId);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
|
|
}
|
|
|
|
////判断是否Android手机访问
|
|
//try
|
|
//{
|
|
// if (WebCommonUtil.IsPhoneRequest(context))
|
|
// {
|
|
// orgId = WebCommonUtil.GetOrgIdDownLevelToUpLevel(orgId);
|
|
// }
|
|
|
|
//}
|
|
//catch (Exception ex)
|
|
//{
|
|
|
|
//}
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"orgPid\":\"" + orgId + "\",\"data\":";
|
|
List<FangYar.Model.FIRE.FIRE_ORG> data = bll.GetOrgListTreeByOrgId(orgId);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "机构树异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "机构树");
|
|
return returnstr;
|
|
|
|
}
|
|
|
|
|
|
//机构+部门树
|
|
private string GetOrgDeptTree(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
List<FangYar.Model.FIRE.FIRE_ORG> data = bll.GetListTreeByOrgId(orgId);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "机构+部门树异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "机构+部门树");
|
|
return returnstr;
|
|
|
|
}
|
|
|
|
|
|
//获取父级行政区ID
|
|
private string GetAreaPID(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string ORG_ID = context.Request.Params["ORG_ID"];
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
FangYar.Model.FIRE.FIRE_ORG data = bll.GetModel(ORG_ID);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "获取父级行政区ID异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "获取父级行政区ID");
|
|
return returnstr;
|
|
}
|
|
|
|
//获取行政区列表
|
|
private string GetAreaList(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string PID = context.Request.Params["PID"];
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
DataTable data = bll.GetAreaList(" PID ='" + PID + "' or AREA_CODE = '" + PID + "'");
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "获取行政区列表异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "获取行政区列表");
|
|
return returnstr;
|
|
}
|
|
//获取子级行政区列表
|
|
private string GetChildAreaList(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string PID = context.Request.Params["PID"];
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
DataTable data = bll.GetAreaList(" PID ='" + PID + "'");
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "获取行政区列表异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "获取行政区列表");
|
|
return returnstr;
|
|
}
|
|
|
|
//根据ORG_ID获取行政区列表
|
|
private string GetAreaList2(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string OrgId = context.Request.Params["OrgId"];
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
DataTable data = bll.GetAreaList2(OrgId);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "根据ORG_ID获取行政区列表异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "根据ORG_ID获取行政区列表");
|
|
return returnstr;
|
|
}
|
|
|
|
|
|
//查询
|
|
private string GetOrgList(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string OrgId = context.Request.Params["OrgId"];
|
|
string keyword = context.Request.Params["keywords"];
|
|
string treeID = context.Request.Params["treeID"];
|
|
string page = context.Request.Params["page"];
|
|
string limit = context.Request.Params["limit"];
|
|
int pageIndex = 1;
|
|
int pageSize = 10;
|
|
if (!string.IsNullOrEmpty(page)) { pageIndex = int.Parse(page); }
|
|
if (!string.IsNullOrEmpty(limit)) { pageSize = int.Parse(limit); }
|
|
string where = null;
|
|
//if (!string.IsNullOrEmpty(treeID) && treeID != OrgId)
|
|
//{
|
|
// where += " ORG_ID = '" + treeID + "'";
|
|
//}
|
|
if (!string.IsNullOrEmpty(treeID) && treeID != OrgId)
|
|
{
|
|
where = " where org_id in ( select org_id from fire_org, (SELECT get_Org_child_list('" + treeID + "') cids) t where find_in_set(ORG_ID, cids))";
|
|
|
|
}
|
|
else
|
|
{
|
|
where = " where org_id in ( select org_id from fire_org, (SELECT get_Org_child_list('" + OrgId + "') cids) t where find_in_set(ORG_ID, cids))";
|
|
|
|
}
|
|
if (!string.IsNullOrEmpty(keyword))
|
|
{
|
|
if (where != null)
|
|
{
|
|
where += " and ";
|
|
}
|
|
where += " ORG_NAME like '%" + keyword + "%' ";
|
|
}
|
|
returnstr = "{\"code\":0,\"msg\":\"\",";
|
|
int count = bll.GetRecordCount(where);
|
|
returnstr += "\"count\":" + count + ",\"data\":";
|
|
if (count == 0)
|
|
{
|
|
returnstr += "[]";
|
|
}
|
|
else
|
|
{
|
|
List<FangYar.Model.FIRE.FIRE_ORG> list = bll.QueryList(pageIndex, pageSize, where, "");
|
|
//修改查询返回数据结果()
|
|
for (int i = 0; i < list.Count; i++)
|
|
{
|
|
list[i].CITY = list[i].CITY_ZX;
|
|
}
|
|
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(list);
|
|
}
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "查询异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "查询");
|
|
return returnstr;
|
|
}
|
|
|
|
//获取队站信息
|
|
private string GetOrg(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["orgId"];
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"Data\":";
|
|
FangYar.Model.FIRE.FIRE_ORG data = bll.getOrg(orgId);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "获取队站信息异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "获取队站信息");
|
|
return returnstr;
|
|
}
|
|
|
|
//添加机构
|
|
private string AddOrg(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string ORG_ID = Guid.NewGuid().ToString("N");
|
|
string PID = context.Request.Params["PID"];
|
|
string USER_ID = context.Request.Params["USER_ID"];
|
|
string ORG_NO = context.Request.Params["ORG_NO"];
|
|
string ORG_NAME = context.Request.Params["ORG_NAME"];
|
|
string ATTR = context.Request.Params["ATTR"];
|
|
string ORG_LEVEL = context.Request.Params["ORG_LEVEL"];
|
|
string ORG_TYPE = context.Request.Params["ORG_TYPE"];
|
|
string ADDR = context.Request.Params["ADDR"];
|
|
string DES = context.Request.Params["DES"];
|
|
string AFF = context.Request.Params["AFF"];
|
|
string CODE = context.Request.Params["CODE"];
|
|
string CONT = context.Request.Params["CONT"];
|
|
string PHONE = context.Request.Params["PHONE"];
|
|
string LON = context.Request.Params["LON"];
|
|
string LAT = context.Request.Params["LAT"];
|
|
string CITY = context.Request.Params["CITY"];
|
|
string COUNTY = context.Request.Params["COUNTY"];
|
|
string CITY_NAME = context.Request.Params["CITY_NAME"];
|
|
string STATE = context.Request.Params["STATE"];
|
|
string TYPE = context.Request.Params["TYPE"];
|
|
string SORT = context.Request.Params["SORT"];
|
|
string CHARGELEADER = context.Request.Params["CHARGELEADER"];
|
|
string LEADER = context.Request.Params["LEADER"];
|
|
|
|
string ALL_NUM = context.Request.Params["ALL_NUM"];
|
|
string EXTENDCODE1 = context.Request.Params["EXTENDCODE1"];
|
|
string EXTENDCODE2 = context.Request.Params["EXTENDCODE2"];
|
|
string EXTENDCODE3 = context.Request.Params["EXTENDCODE3"];
|
|
|
|
string INTRODUCTION = context.Request.Params["INTRODUCTION"];
|
|
string INPREPARATION = context.Request.Params["INPREPARATION"];//编制内
|
|
string IS_TOP_CAMP = context.Request.Params["IS_TOP_CAMP"];//和上级单位同驻地:0:否;1:是
|
|
string ALTITUDE = context.Request.Params["ALTITUDE"];
|
|
string UNITTRAININGTYPE = context.Request.Params["UNITTRAININGTYPE"];
|
|
byte[] outputb = Convert.FromBase64String(INTRODUCTION);
|
|
string orgStr = Encoding.Default.GetString(outputb);
|
|
string text = HttpUtility.UrlDecode(orgStr);//将Url中的编码转换为简体汉字 , System.Text.Encoding.GetEncoding("GB2312")
|
|
|
|
//存储图片
|
|
//string picture = GetUploadImg(context);
|
|
//消防机构表
|
|
FangYar.Model.FIRE.FIRE_ORG model = new Model.FIRE.FIRE_ORG();
|
|
model.ORG_ID = ORG_ID;
|
|
model.PID = PID;
|
|
model.ORG_NO = ORG_NO;
|
|
model.ORG_NAME = ORG_NAME;
|
|
model.ATTR = ATTR;
|
|
model.ORG_LEVEL = ORG_LEVEL;
|
|
model.ORG_TYPE = ORG_TYPE;
|
|
model.ADDR = ADDR;
|
|
model.DES = DES;
|
|
model.AFF = AFF;
|
|
model.CODE = CODE;
|
|
model.CONT = CONT;
|
|
model.PHONE = PHONE;
|
|
model.LON = LON;
|
|
model.LAT = LAT;
|
|
model.CITY_ZX = CITY;
|
|
model.COUNTY = COUNTY;
|
|
|
|
model.STATE = STATE;
|
|
model.A_PER = USER_ID;
|
|
|
|
model.ALL_NUM = ALL_NUM;
|
|
model.EXTENDCODE1 = EXTENDCODE1;
|
|
model.EXTENDCODE2 = EXTENDCODE2;
|
|
model.EXTENDCODE3 = EXTENDCODE3;
|
|
|
|
model.IS_TOP_CAMP = IS_TOP_CAMP;
|
|
|
|
model.INTRODUCTION = text;
|
|
if (!string.IsNullOrEmpty(TYPE))
|
|
{
|
|
model.TYPE = int.Parse(TYPE);
|
|
}
|
|
if (!string.IsNullOrEmpty(SORT))
|
|
{
|
|
model.SORT = int.Parse(SORT);
|
|
}
|
|
model.CHARGELEADER = CHARGELEADER;
|
|
model.LEADER = LEADER;
|
|
if (!string.IsNullOrEmpty(INPREPARATION))
|
|
{
|
|
model.INPREPARATION = int.Parse(INPREPARATION);
|
|
}
|
|
if (!string.IsNullOrEmpty(ALTITUDE))
|
|
{
|
|
model.ALTITUDE = int.Parse(ALTITUDE);
|
|
}
|
|
if (!string.IsNullOrEmpty(UNITTRAININGTYPE))
|
|
{
|
|
model.UNITTRAININGTYPE = int.Parse(UNITTRAININGTYPE);
|
|
}
|
|
FangYar.Model.TBL.TBL_SYS_AREA_PID_Model area_s = abll.GetPIDS(CITY);
|
|
//Camp_Fire2.CwsClient cf = new Camp_Fire2.CwsClient();
|
|
//string flag = cf.insertGroup(ORG_ID, ORG_NAME, CITY, area_s.CODE_S, CITY_NAME, area_s.NAME_S);
|
|
|
|
if (!string.IsNullOrWhiteSpace(COUNTY))
|
|
{
|
|
model.CITY = COUNTY;
|
|
}
|
|
else
|
|
{
|
|
model.CITY = CITY;
|
|
}
|
|
//0:支队;1:特勤站;2:大队;3:总队
|
|
switch (model.EXTENDCODE1)
|
|
{
|
|
//支队
|
|
case "0":
|
|
if (!string.IsNullOrWhiteSpace(model.CITY))
|
|
{
|
|
if (model.CITY.Length >= 4)
|
|
{
|
|
model.CITY = model.CITY.Substring(0, 4) + "00";
|
|
}
|
|
}
|
|
break;
|
|
//总队
|
|
case "3":
|
|
model.CITY = "540000";
|
|
break;
|
|
}
|
|
|
|
if (bll.AddOrg(model))
|
|
{
|
|
msg = "添加成功!";
|
|
code = 1;
|
|
}
|
|
else { msg = "添加失败!"; }
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "添加失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "添加机构异常:" + e);
|
|
}
|
|
returnstr = "{\"msg\":\"" + msg + "\",\"code\":" + code + "}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Add, "组织机构操作请求", "添加机构");
|
|
return returnstr;
|
|
}
|
|
|
|
//修改机构信息
|
|
private string EditOrg(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string ORG_ID = context.Request.Params["ID"];
|
|
string PID = context.Request.Params["PID"];
|
|
string USER_ID = context.Request.Params["USER_ID"];
|
|
string ORG_NO = context.Request.Params["ORG_NO"];
|
|
string ORG_NAME = context.Request.Params["ORG_NAME"];
|
|
string ATTR = context.Request.Params["ATTR"];
|
|
string ORG_LEVEL = context.Request.Params["ORG_LEVEL"];
|
|
string ORG_TYPE = context.Request.Params["ORG_TYPE"];
|
|
string ADDR = context.Request.Params["ADDR"];
|
|
string DES = context.Request.Params["DES"];
|
|
string AFF = context.Request.Params["AFF"];
|
|
string CODE = context.Request.Params["CODE"];
|
|
string CONT = context.Request.Params["CONT"];
|
|
string PHONE = context.Request.Params["PHONE"];
|
|
string LON = context.Request.Params["LON"];
|
|
string LAT = context.Request.Params["LAT"];
|
|
string CITY = context.Request.Params["CITY"];
|
|
string COUNTY = context.Request.Params["COUNTY"];
|
|
string STATE = context.Request.Params["STATE"];
|
|
string TYPE = context.Request.Params["TYPE"];
|
|
string SORT = context.Request.Params["SORT"];
|
|
string CHARGELEADER = context.Request.Params["CHARGELEADER"];
|
|
string LEADER = context.Request.Params["LEADER"];
|
|
string ALL_NUM = context.Request.Params["ALL_NUM"];
|
|
string EXTENDCODE1 = context.Request.Params["EXTENDCODE1"];
|
|
string EXTENDCODE2 = context.Request.Params["EXTENDCODE2"];
|
|
string EXTENDCODE3 = context.Request.Params["EXTENDCODE3"];
|
|
|
|
string INTRODUCTION = context.Request.Params["INTRODUCTION"];
|
|
string INPREPARATION = context.Request.Params["INPREPARATION"];//编制内
|
|
string IS_TOP_CAMP = context.Request.Params["IS_TOP_CAMP"];//和上级单位同驻地:0:否;1:是
|
|
string ALTITUDE = context.Request.Params["ALTITUDE"];
|
|
string UNITTRAININGTYPE = context.Request.Params["UNITTRAININGTYPE"];
|
|
byte[] outputb = Convert.FromBase64String(INTRODUCTION);
|
|
string orgStr = Encoding.Default.GetString(outputb);
|
|
string text = HttpUtility.UrlDecode(orgStr);//将Url中的编码转换为简体汉字 , System.Text.Encoding.GetEncoding("GB2312")
|
|
|
|
//消防机构表
|
|
FangYar.Model.FIRE.FIRE_ORG model = new Model.FIRE.FIRE_ORG();
|
|
model.ORG_ID = ORG_ID;
|
|
model.PID = PID;
|
|
model.ORG_NO = ORG_NO;
|
|
model.ORG_NAME = ORG_NAME;
|
|
model.ATTR = ATTR;
|
|
model.ORG_LEVEL = ORG_LEVEL;
|
|
model.ORG_TYPE = ORG_TYPE;
|
|
model.ADDR = ADDR;
|
|
model.DES = DES;
|
|
model.AFF = AFF;
|
|
model.CODE = CODE;
|
|
model.CONT = CONT;
|
|
model.PHONE = PHONE;
|
|
model.LON = LON;
|
|
model.LAT = LAT;
|
|
model.CITY_ZX = CITY;
|
|
model.COUNTY = COUNTY;
|
|
|
|
model.STATE = STATE;
|
|
model.U_PER = USER_ID;
|
|
model.ALL_NUM = ALL_NUM;
|
|
model.EXTENDCODE1 = EXTENDCODE1;
|
|
model.EXTENDCODE2 = EXTENDCODE2;
|
|
model.EXTENDCODE3 = EXTENDCODE3;
|
|
model.IS_TOP_CAMP = IS_TOP_CAMP;
|
|
|
|
model.INTRODUCTION = text;
|
|
|
|
if (!string.IsNullOrEmpty(TYPE))
|
|
{
|
|
model.TYPE = int.Parse(TYPE);
|
|
}
|
|
if (!string.IsNullOrEmpty(SORT))
|
|
{
|
|
model.SORT = int.Parse(SORT);
|
|
}
|
|
model.CHARGELEADER = CHARGELEADER;
|
|
model.LEADER = LEADER;
|
|
if (!string.IsNullOrEmpty(INPREPARATION))
|
|
{
|
|
model.INPREPARATION = int.Parse(INPREPARATION);
|
|
}
|
|
if (!string.IsNullOrEmpty(ALTITUDE))
|
|
{
|
|
model.ALTITUDE = int.Parse(ALTITUDE);
|
|
}
|
|
if (!string.IsNullOrEmpty(UNITTRAININGTYPE))
|
|
{
|
|
model.UNITTRAININGTYPE = int.Parse(UNITTRAININGTYPE);
|
|
}
|
|
//修改战训city字段使用逻辑
|
|
if (!string.IsNullOrWhiteSpace(COUNTY))
|
|
{
|
|
model.CITY = COUNTY;
|
|
}
|
|
else
|
|
{
|
|
model.CITY = CITY;
|
|
}
|
|
//0:支队;1:特勤站;2:大队;3:总队
|
|
switch (model.EXTENDCODE1)
|
|
{
|
|
//支队
|
|
case "0":
|
|
if (!string.IsNullOrWhiteSpace(model.CITY))
|
|
{
|
|
if (model.CITY.Length >= 4)
|
|
{
|
|
model.CITY = model.CITY.Substring(0, 4) + "00";
|
|
}
|
|
}
|
|
break;
|
|
//总队
|
|
case "3":
|
|
model.CITY = "540000";
|
|
break;
|
|
}
|
|
|
|
if (bll.EditOrg(model))
|
|
{
|
|
msg = "修改成功!";
|
|
code = 1;
|
|
}
|
|
else { msg = "修改失败!"; }
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "修改失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "修改机构信息异常:" + e);
|
|
}
|
|
returnstr = "{\"msg\":\"" + msg + "\",\"code\":" + code + "}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Update, "组织机构操作请求", "修改机构信息");
|
|
return returnstr;
|
|
}
|
|
|
|
//删除机构信息
|
|
private string DelOrg(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
int code = -1;
|
|
string msg = "";
|
|
try
|
|
{
|
|
string OrgList = context.Request.Params["OrgList"];
|
|
string[] OrgArray = OrgList.Split(',');
|
|
string OrgListString = "";
|
|
for (int i = 0; i < OrgArray.Length; i++)
|
|
{
|
|
if (i == 0)
|
|
{
|
|
OrgListString = "'" + OrgArray[i] + "'";
|
|
}
|
|
else
|
|
{
|
|
OrgListString += ",'" + OrgArray[i] + "'";
|
|
}
|
|
}
|
|
var rcode = bll.DelOrg(OrgListString);
|
|
if (rcode == 0)
|
|
{
|
|
msg = "删除成功!";
|
|
code = 1;
|
|
}
|
|
else if (rcode == 1)
|
|
{
|
|
msg = "所选机构还有下级机构关联,请移除下级机构后再删除当前所选机构!";
|
|
}
|
|
else if (rcode == 2)
|
|
{
|
|
msg = "所选机构还有消防队站关联,请移除消防队站后再删除当前所选机构!";
|
|
}
|
|
else if (rcode == 3)
|
|
{
|
|
msg = "删除失败!";
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
msg = "删除失败!";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "删除机构信息异常:" + e);
|
|
}
|
|
returnstr = "{\"code\":" + code + ",\"msg\":\"" + msg + "\"}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Delete, "组织机构操作请求", "删除机构信息");
|
|
return returnstr;
|
|
}
|
|
//字典表机构树
|
|
private string getFireOrgTree(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string ORG_ID = context.Request.Params["ORG_ID"];
|
|
|
|
List<FangYar.Model.TreeNodeModel> list = new List<Model.TreeNodeModel>();
|
|
//list = blltree.GetTree("ORG_ID", "PID", "ORG_NAME", "FIRE_ORG", where, list);
|
|
list = blltree.GetTree2("ORG_ID", "PID", "ORG_NAME", "FIRE_ORG", ORG_ID, list);
|
|
returnstr = "{\"data\":";
|
|
if (list.Count == 0)
|
|
{
|
|
returnstr += "[]";
|
|
}
|
|
else
|
|
{
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(list);
|
|
}
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "字典表机构树异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "字典表机构树");
|
|
return returnstr;
|
|
|
|
}
|
|
//获取机构名称,获取单个model数据
|
|
private string getFireOrgName(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
FangYar.BLL.FIRE.FIRE_ORG fireorg_bll = new BLL.FIRE.FIRE_ORG();
|
|
string ID = context.Request.Params["ID"];
|
|
int count = fireorg_bll.GetRecordCount(" ORG_ID ='" + ID + "'");
|
|
if (count > 0)
|
|
{
|
|
returnstr = "{\"code\":1,\"data\":";
|
|
|
|
FangYar.Model.FIRE.FIRE_ORG model = fireorg_bll.GetModel(ID);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(model);
|
|
returnstr += "}";
|
|
}
|
|
else
|
|
{
|
|
|
|
returnstr = "{\"code\":0,\"data\":[]}";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "获取机构名称,获取单个model数据异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "获取机构名称,获取单个model数据");
|
|
return returnstr;
|
|
|
|
}
|
|
|
|
|
|
//查询(只查询机构,不查询部门)
|
|
private string GetOrgList3(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string OrgId = context.Request.Params["OrgId"];
|
|
string page = context.Request.Params["page"];
|
|
string limit = context.Request.Params["limit"];
|
|
int pageIndex = 1;
|
|
int pageSize = 10;
|
|
if (!string.IsNullOrEmpty(page)) { pageIndex = int.Parse(page); }
|
|
if (!string.IsNullOrEmpty(limit)) { pageSize = int.Parse(limit); }
|
|
string where = null;
|
|
if (!string.IsNullOrEmpty(OrgId))
|
|
{
|
|
if (where != null)
|
|
{
|
|
where += " and ";
|
|
}
|
|
where += " (ORG_ID = '" + OrgId + "' or PID = '" + OrgId + "') and TYPE = '0'";
|
|
}
|
|
returnstr = "{\"code\":0,\"msg\":\"\",";
|
|
int count = bll.GetRecordCount(where);
|
|
returnstr += "\"count\":" + count + ",\"data\":";
|
|
if (count == 0)
|
|
{
|
|
returnstr += "[]";
|
|
}
|
|
else
|
|
{
|
|
List<FangYar.Model.FIRE.FIRE_ORG> list = bll.QueryList(pageIndex, pageSize, where, "");
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(list);
|
|
}
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "查询(只查询机构,不查询部门)异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "查询(只查询机构,不查询部门)");
|
|
return returnstr;
|
|
}
|
|
/// <summary>
|
|
/// 根据地区编码获取组织机构ID
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
/// <returns></returns>
|
|
private string GetOrgIdByCity(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string cityCode = context.Request.Params["cityCode"];
|
|
int pageIndex = 1;
|
|
int pageSize = 1;
|
|
string where = " CITY ='" + cityCode + "' ";
|
|
returnstr = "{\"code\":0,\"msg\":\"\",";
|
|
List<FangYar.Model.FIRE.FIRE_ORG> list = bll.QueryList(pageIndex, pageSize, where, " field(type,0,1),field(EXTENDCODE1, 3, 0, 2, 1),field( ISORG, 0, 1 ),sort asc ");
|
|
returnstr += "\"data\":{\"orgId\":\"" + list[0].ORG_ID + "\",\"orgName\":\"" + list[0].ORG_NAME + "\"}";
|
|
returnstr += "}";
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "根据地区编码获取组织机构ID异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "根据地区编码获取组织机构ID");
|
|
return returnstr;
|
|
}
|
|
|
|
////图片上传
|
|
//private string GetUploadImg(HttpContext context)
|
|
//{
|
|
// string returnStr = "";
|
|
|
|
// try
|
|
// {
|
|
// string serverPath = "Upload/Fire/Org/";
|
|
// string base64Str = context.Request.Params["pic"];
|
|
// if (!String.IsNullOrWhiteSpace(base64Str))
|
|
// {
|
|
// base64Str = base64Str.Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "")
|
|
// .Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", ""); //将base64头部信息替换
|
|
|
|
|
|
// byte[] imageBytes = Convert.FromBase64String(base64Str);
|
|
// using (MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length))
|
|
// {
|
|
// ms.Write(imageBytes, 0, imageBytes.Length);
|
|
|
|
// System.Drawing.Image img = Image.FromStream(ms, true);//将流中的图片转换为Image图片对象
|
|
// //ms.Close();
|
|
// //ms.Dispose();
|
|
// Random ran = new Random((int)DateTime.Now.Ticks);//利用时间种子解决伪随机数短时间重复问题
|
|
// if (!Directory.Exists(context.Server.MapPath("~/" + serverPath)))
|
|
// {
|
|
// DirectoryInfo directoryInfo = new DirectoryInfo(context.Server.MapPath("~/" + serverPath));
|
|
// directoryInfo.Create();
|
|
// }
|
|
|
|
// //文件保存位置及命名,精确到毫秒并附带一组随机数,防止文件重名,数据库保存路径为此变量
|
|
// //string serverPath = "Upload/Device/";
|
|
// string filename = serverPath + DateTime.Now.ToString("yyyyMMddhhmmssms") + ran.Next(99999) + ".jpg";
|
|
// //路径映射为绝对路径
|
|
// string path = context.Server.MapPath("~/") + filename;
|
|
|
|
// img.Save(path);//图片保存,JPEG格式图片较小
|
|
// returnStr = filename;
|
|
// }
|
|
|
|
// }
|
|
// }
|
|
// catch (Exception ex) { }
|
|
// return returnStr;
|
|
//}
|
|
|
|
|
|
/// <summary>
|
|
/// 根据地区编码获取地区城市名称
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
/// <returns></returns>
|
|
private string getCityNameByCity(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string cityCode = context.Request.Params["cityCode"];
|
|
if (cityCode.IndexOf("0000") > 0)
|
|
{
|
|
cityCode = cityCode.Substring(0, 2) + "0100";
|
|
}
|
|
string sqlStr = " SELECT AREA_NAME from tbl_sys_area WHERE AREA_CODE = '" + cityCode + "' ";
|
|
DataTable dt = FangYar.Common.MySqlHelper.QueryTable(sqlStr);
|
|
returnstr = "{\"code\":0,\"msg\":\"\",";
|
|
if (dt.Rows.Count > 0)
|
|
{
|
|
string cityName = dt.Rows[0]["AREA_NAME"] + "";
|
|
cityName = cityName.Replace("市", "").Replace("县", "").Replace("地区", "").Replace("区", "");
|
|
cityName = cityName.Replace("县", "");
|
|
returnstr += "\"data\":\"" + cityName + "\"";
|
|
}
|
|
else
|
|
{
|
|
returnstr += "\"data\":\"\"";
|
|
}
|
|
returnstr += "}";
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":\"\"}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "根据地区编码获取地区城市名称异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "根据地区编码获取地区城市名称");
|
|
return returnstr;
|
|
}
|
|
//机构+部门树
|
|
private string GetDeptTree(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
DataTable data = bll.GetDeptTreeByOrgId(orgId);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "机构+部门树异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "机构+部门树");
|
|
return returnstr;
|
|
|
|
}
|
|
//获取子级机构
|
|
private string GetOrgChilds(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
returnstr = "{\"code\":1,\"msg\":\"\",\"data\":";
|
|
string sql = "select * from fire_org o where pid = '" + orgId + "' and type = '0' order by field(EXTENDCODE1,3,0,2,1), sort";
|
|
DataTable data = FangYar.Common.MySqlHelper.QueryTable(sql);
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(data);
|
|
returnstr += "}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "组织机构操作请求", "获取子级机构异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "组织机构操作请求", "获取子级机构");
|
|
return returnstr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//导出缺失项统计数据(总队)
|
|
public string expLackStatisticsZD(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
#region 人员信息相关
|
|
#region 人员学历缺失
|
|
string empCertSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (CERT is null or CERT='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt1 = FangYar.Common.MySqlHelper.QueryTable(empCertSql);
|
|
#endregion
|
|
|
|
#region 人员民族缺失
|
|
string empNationSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (NATION is null or NATION='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt2 = FangYar.Common.MySqlHelper.QueryTable(empNationSql);
|
|
#endregion
|
|
|
|
#region 人员入伍时间缺失
|
|
string empEnlistedTimeSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (ENLISTED_TIME is null or ENLISTED_TIME='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt3 = FangYar.Common.MySqlHelper.QueryTable(empEnlistedTimeSql);
|
|
#endregion
|
|
|
|
#region 人员政治面貌缺失
|
|
string empFaceSql = @"SELECT '日喀则市消防救援支队' orgName,count( ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (FACE is null or FACE='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt4 = FangYar.Common.MySqlHelper.QueryTable(empFaceSql);
|
|
#endregion
|
|
|
|
#region 人员照片缺失
|
|
string empPhotoSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PHOTO is null or PHOTO='' or PHOTO = 'images/imgPerDefaut.jpg')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt5 = FangYar.Common.MySqlHelper.QueryTable(empPhotoSql);
|
|
#endregion
|
|
|
|
#region 人员职位缺失
|
|
string empProfSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (PROF is null or PROF='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt6 = FangYar.Common.MySqlHelper.QueryTable(empProfSql);
|
|
#endregion
|
|
|
|
#region 人员消防救援衔缺失
|
|
string empPolSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (POL is null or POL='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt7 = FangYar.Common.MySqlHelper.QueryTable(empPolSql);
|
|
#endregion
|
|
|
|
#region 人员编号缺失
|
|
string empNumSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (EMP_NUM is null or EMP_NUM='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dt8 = FangYar.Common.MySqlHelper.QueryTable(empNumSql);
|
|
#endregion
|
|
|
|
#region 人员血型缺失
|
|
string empBLOODSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (BLOOD_TYPE is null or BLOOD_TYPE='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dtBLOOD = FangYar.Common.MySqlHelper.QueryTable(empBLOODSql);
|
|
#endregion
|
|
|
|
|
|
#region 人员标签缺失
|
|
string empTAGSSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and (TAGS is null or TAGS='')and IS_DEL = '0'and IS_ADMIN='0'";
|
|
DataTable dtTAGS = FangYar.Common.MySqlHelper.QueryTable(empTAGSSql);
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region 车辆信息相关
|
|
#region 车辆(公务车)统计
|
|
string carOfficSql = @"SELECT '日喀则市消防救援支队' orgName,count( ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_car e, (SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de') cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='0' and IS_DEL='0' ";
|
|
DataTable dt9 = FangYar.Common.MySqlHelper.QueryTable(carOfficSql);
|
|
#endregion
|
|
|
|
#region 车辆(执勤车)统计
|
|
string carDutySql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_sys_car e, ( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and CLASS ='1' and IS_DEL='0' and IS_DEL='0'";
|
|
DataTable dt10 = FangYar.Common.MySqlHelper.QueryTable(carDutySql);
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 摄像头、道闸、门禁、访客机相关设备
|
|
#region 摄像头统计
|
|
string cameraSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids)";
|
|
DataTable dt11 = FangYar.Common.MySqlHelper.QueryTable(cameraSql);
|
|
#endregion
|
|
|
|
#region 设备(人脸门禁)统计
|
|
string epuipFaceSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '0'";
|
|
DataTable dt12 = FangYar.Common.MySqlHelper.QueryTable(epuipFaceSql);
|
|
#endregion
|
|
|
|
#region 设备(车辆道闸)统计
|
|
string epuipCarSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '1'";
|
|
DataTable dt13 = FangYar.Common.MySqlHelper.QueryTable(epuipCarSql);
|
|
#endregion
|
|
|
|
#region 设备(人证一体机)统计
|
|
string epuipVisitorSql = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '40a1e65991764d4dac2d826bfbbfc849' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '5806465fa4e845998f31a10d023f332e' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '82487f0ebb6848e7ac4abc3d7cbc8504' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '833b28c12b42495a99a5e41068eb6805' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '9a1324ec8b244a7f9d6cbca88cd614fd' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( 'b5b00dfb27a34e0a8bd86270930e02d6' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( 'f4d9f25b27114172a66a9d04cc158b00' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '36e8032be5f54a3cb994c4ac74ac3f77' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0) ) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '734389c7ae364584aea9918693bba3de' ) cids ) s WHERE find_in_set(e.org_id, cids) and EXTEND2= '2'";
|
|
DataTable dt14 = FangYar.Common.MySqlHelper.QueryTable(epuipVisitorSql);
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 巡查相关设备
|
|
#region 巡查点(巡查)统计
|
|
string sql1 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids ) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids ) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '0'
|
|
UNION ALL
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'";
|
|
DataTable dt15 = FangYar.Common.MySqlHelper.QueryTable(sql1);
|
|
#endregion
|
|
|
|
#region 巡查点(查铺)统计
|
|
string sql2 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids ) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids ) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'
|
|
UNION ALL
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '1'";
|
|
DataTable dt16 = FangYar.Common.MySqlHelper.QueryTable(sql2);
|
|
#endregion
|
|
|
|
#region 巡查点(查哨)统计
|
|
string sql3 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids ) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids ) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'
|
|
UNION ALL
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM oa_patrol_spot e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) AND EXTENDCODE1 = '2'";
|
|
DataTable dt17 = FangYar.Common.MySqlHelper.QueryTable(sql3);
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 灭火资源信息相关
|
|
#region 消防栓统计
|
|
string sql4 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM fire_hydrant e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) ";
|
|
DataTable dt18 = FangYar.Common.MySqlHelper.QueryTable(sql4);
|
|
#endregion
|
|
|
|
#region 天然水源统计
|
|
string sql5 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM fire_water_source e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) ";
|
|
DataTable dt19 = FangYar.Common.MySqlHelper.QueryTable(sql5);
|
|
#endregion
|
|
|
|
#region 消防水池统计
|
|
string sql6 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM fire_pool e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) ";
|
|
DataTable dt20 = FangYar.Common.MySqlHelper.QueryTable(sql6);
|
|
#endregion
|
|
|
|
#region 取水码头统计
|
|
string sql7 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM fire_intake_wharf e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) ";
|
|
DataTable dt21 = FangYar.Common.MySqlHelper.QueryTable(sql7);
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 社会参战力量
|
|
#region 应急联动单位统计
|
|
string sql8 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0'
|
|
union all
|
|
SELECT'昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0'
|
|
union all
|
|
SELECT'山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0'
|
|
union all
|
|
SELECT'阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0'
|
|
union all
|
|
SELECT'那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id, cids) and TYPE = '0'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '0' ";
|
|
DataTable dt22 = FangYar.Common.MySqlHelper.QueryTable(sql8);
|
|
#endregion
|
|
|
|
#region 联勤保障单位统计
|
|
string sql9 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1'
|
|
union all
|
|
SELECT'昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1'
|
|
union all
|
|
SELECT'山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1'
|
|
union all
|
|
SELECT'阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1'
|
|
union all
|
|
SELECT'那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1'
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1'
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1'
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id, cids) and TYPE = '1'
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM fire_e_l_unit e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) and TYPE = '1' ";
|
|
DataTable dt23 = FangYar.Common.MySqlHelper.QueryTable(sql9);
|
|
#endregion
|
|
|
|
#region 专家统计
|
|
string sql10 = @"SELECT '日喀则市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('40a1e65991764d4dac2d826bfbbfc849') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'昌都市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('5806465fa4e845998f31a10d023f332e') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'山南市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('82487f0ebb6848e7ac4abc3d7cbc8504') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'阿里地区消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('833b28c12b42495a99a5e41068eb6805') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT'那曲市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('9a1324ec8b244a7f9d6cbca88cd614fd') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '林芝市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('b5b00dfb27a34e0a8bd86270930e02d6') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '拉萨市消防救援支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('f4d9f25b27114172a66a9d04cc158b00') cids) s WHERE find_in_set(e.org_id,cids)
|
|
union all
|
|
SELECT '训练与战勤保障支队' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('36e8032be5f54a3cb994c4ac74ac3f77') cids) s WHERE find_in_set(e.org_id, cids)
|
|
union all
|
|
SELECT '总队机关' orgName,count(ifnull(e.ID,0)) countNum FROM fire_expert e,(SELECT get_Org_child_list('734389c7ae364584aea9918693bba3de') cids) s WHERE find_in_set(e.org_id,cids) ";
|
|
DataTable dt24 = FangYar.Common.MySqlHelper.QueryTable(sql10);
|
|
#endregion
|
|
#endregion
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"\"";
|
|
|
|
//人员学历缺失
|
|
returnstr += ",\"dt1\":" + FangYar.Common.JsonHelper.ToJson(dt1);
|
|
//人员民族缺失
|
|
returnstr += ",\"dt2\":" + FangYar.Common.JsonHelper.ToJson(dt2);
|
|
//人员入伍时间缺失
|
|
returnstr += ",\"dt3\":" + FangYar.Common.JsonHelper.ToJson(dt3);
|
|
//人员政治面貌缺失
|
|
returnstr += ",\"dt4\":" + FangYar.Common.JsonHelper.ToJson(dt4);
|
|
//人员照片缺失
|
|
returnstr += ",\"dt5\":" + FangYar.Common.JsonHelper.ToJson(dt5);
|
|
//人员职位缺失
|
|
returnstr += ",\"dt6\":" + FangYar.Common.JsonHelper.ToJson(dt6);
|
|
//人员消防救援衔缺失
|
|
returnstr += ",\"dt7\":" + FangYar.Common.JsonHelper.ToJson(dt7);
|
|
//人员编号缺失
|
|
returnstr += ",\"dt8\":" + FangYar.Common.JsonHelper.ToJson(dt8);
|
|
//公务车信息
|
|
returnstr += ",\"dt9\":" + FangYar.Common.JsonHelper.ToJson(dt9);
|
|
//执勤车信息
|
|
returnstr += ",\"dt10\":" + FangYar.Common.JsonHelper.ToJson(dt10);
|
|
//摄像头信息
|
|
returnstr += ",\"dt11\":" + FangYar.Common.JsonHelper.ToJson(dt11);
|
|
//人脸门禁
|
|
returnstr += ",\"dt12\":" + FangYar.Common.JsonHelper.ToJson(dt12);
|
|
//车辆道闸
|
|
returnstr += ",\"dt13\":" + FangYar.Common.JsonHelper.ToJson(dt13);
|
|
//访客一体机
|
|
returnstr += ",\"dt14\":" + FangYar.Common.JsonHelper.ToJson(dt14);
|
|
//巡查点信息
|
|
returnstr += ",\"dt15\":" + FangYar.Common.JsonHelper.ToJson(dt15);
|
|
//查铺信息
|
|
returnstr += ",\"dt16\":" + FangYar.Common.JsonHelper.ToJson(dt16);
|
|
//查哨信息
|
|
returnstr += ",\"dt17\":" + FangYar.Common.JsonHelper.ToJson(dt17);
|
|
//消防栓信息
|
|
returnstr += ",\"dt18\":" + FangYar.Common.JsonHelper.ToJson(dt18);
|
|
//天然水源
|
|
returnstr += ",\"dt19\":" + FangYar.Common.JsonHelper.ToJson(dt19);
|
|
//消防水池
|
|
returnstr += ",\"dt20\":" + FangYar.Common.JsonHelper.ToJson(dt20);
|
|
//取水码头
|
|
returnstr += ",\"dt21\":" + FangYar.Common.JsonHelper.ToJson(dt21);
|
|
//应急联动单位
|
|
returnstr += ",\"dt22\":" + FangYar.Common.JsonHelper.ToJson(dt22);
|
|
//联勤保障单位
|
|
returnstr += ",\"dt23\":" + FangYar.Common.JsonHelper.ToJson(dt23);
|
|
//专家信息
|
|
returnstr += ",\"dt24\":" + FangYar.Common.JsonHelper.ToJson(dt24);
|
|
//人员血型缺失
|
|
returnstr += ",\"dt25\":" + FangYar.Common.JsonHelper.ToJson(dtBLOOD);
|
|
//人员血型缺失
|
|
returnstr += ",\"dt26\":" + FangYar.Common.JsonHelper.ToJson(dtTAGS);
|
|
|
|
|
|
returnstr += "}";
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "导出操作请求", "导出缺失项统计数据异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "导出操作请求", "导出缺失项统计数据");
|
|
return returnstr;
|
|
}
|
|
|
|
//导出缺失项统计数据
|
|
public string expLackStatistics(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
|
|
string sql = "";
|
|
DataTable dt1 = FangYar.Common.MySqlHelper.QueryTable(sql);
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "导出操作请求", "导出缺失项统计数据异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "导出操作请求", "导出缺失项统计数据");
|
|
return returnstr;
|
|
}
|
|
|
|
|
|
//导出缺失项统计数据(支队)
|
|
public string expLackStatisticsZhidui(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
string sql = @"
|
|
select l1.ORG_NAME , IFNULL(a1.countNum,0) a1countNum , IFNULL(a2.countNum,0) a2countNum, IFNULL(a3.countNum,0) a3countNum ,
|
|
IFNULL(a4.countNum,0) a4countNum , IFNULL(a5.countNum,0) a5countNum, IFNULL(a6.countNum,0) a6countNum , IFNULL(a7.countNum,0) a7countNum ,
|
|
IFNULL(a8.countNum,0) a8countNum ,IFNULL(a9.countNum,0) a9countNum ,IFNULL(a10.countNum,0) a10countNum ,IFNULL(a11.countNum,0) a11countNum
|
|
,IFNULL(a12.countNum,0) a12countNum ,IFNULL(a13.countNum,0) a13countNum ,IFNULL(a14.countNum,0) a14countNum ,IFNULL(a15.countNum,0) a15countNum
|
|
,IFNULL(a16.countNum,0) a16countNum ,IFNULL(a17.countNum,0) a17countNum ,IFNULL(a18.countNum,0) a18countNum ,IFNULL(a19.countNum,0) a19countNum
|
|
,IFNULL(a20.countNum,0) a20countNum ,IFNULL(a21.countNum,0) a21countNum ,IFNULL(a22.countNum,0) a22countNum ,IFNULL(a23.countNum,0) a23countNum
|
|
,IFNULL(a24.countNum,0) a24countNum ,IFNULL(a25.countNum,0) a25countNum ,IFNULL(a26.countNum,0) a26countNum
|
|
from
|
|
(
|
|
select * from fire_org o,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids )s where find_in_set( o.org_id, cids ) and o.type='0'
|
|
)l1 left join ( -- 学历
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( CERT IS NULL OR CERT = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a1 on l1.ORG_ID=a1.ORG_ID
|
|
left join ( -- 民族
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( NATION IS NULL OR NATION = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a2 on l1.ORG_ID=a2.ORG_ID
|
|
|
|
left join ( -- 入伍时间
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( ENLISTED_TIME IS NULL OR ENLISTED_TIME = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a3 on l1.ORG_ID=a3.ORG_ID
|
|
|
|
left join ( -- 政治面貌
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( FACE IS NULL OR FACE = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a4 on l1.ORG_ID=a4.ORG_ID
|
|
|
|
left join ( -- 照片
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( PHOTO IS NULL OR PHOTO = '' or PHOTO = 'images/imgPerDefaut.jpg') AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a5 on l1.ORG_ID=a5.ORG_ID
|
|
|
|
|
|
left join ( -- 职位
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( PROF IS NULL OR PROF = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a6 on l1.ORG_ID=a6.ORG_ID
|
|
|
|
left join ( -- 消防救援衔
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( POL IS NULL OR POL = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a7 on l1.ORG_ID=a7.ORG_ID
|
|
|
|
left join ( -- 编号
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( EMP_NUM IS NULL OR EMP_NUM = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a8 on l1.ORG_ID=a8.ORG_ID
|
|
|
|
left join ( -- 血型
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( BLOOD_TYPE IS NULL OR BLOOD_TYPE = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a25 on l1.ORG_ID=a25.ORG_ID
|
|
|
|
left join ( -- 标签
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_emp e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND ( TAGS IS NULL OR TAGS = '' ) AND IS_DEL = '0' AND IS_ADMIN = '0'
|
|
GROUP BY ORG_ID
|
|
)a26 on l1.ORG_ID=a26.ORG_ID
|
|
|
|
left join ( -- 公务车
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_car e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND IS_DEL = '0' AND CLASS = '0'
|
|
GROUP BY ORG_ID
|
|
)a9 on l1.ORG_ID=a9.ORG_ID
|
|
|
|
left join ( -- 执勤车
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_sys_car e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) AND IS_DEL = '0' AND CLASS = '1'
|
|
GROUP BY ORG_ID
|
|
)a10 on l1.ORG_ID=a10.ORG_ID
|
|
|
|
left join ( -- 摄像头
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_camera e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids )
|
|
GROUP BY ORG_ID
|
|
)a11 on l1.ORG_ID=a11.ORG_ID
|
|
|
|
left join ( -- 门禁
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and EXTEND2= '0'
|
|
GROUP BY ORG_ID
|
|
)a12 on l1.ORG_ID=a12.ORG_ID
|
|
|
|
left join ( -- 车辆道闸
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and EXTEND2= '1'
|
|
GROUP BY ORG_ID
|
|
)a13 on l1.ORG_ID=a13.ORG_ID
|
|
|
|
left join ( -- 访客一体机
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM tbl_epuip_org e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and EXTEND2= '2'
|
|
GROUP BY ORG_ID
|
|
)a14 on l1.ORG_ID=a14.ORG_ID
|
|
|
|
left join ( -- 巡查点
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM oa_patrol_spot e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and EXTENDCODE1= '0'
|
|
GROUP BY ORG_ID
|
|
)a15 on l1.ORG_ID=a15.ORG_ID
|
|
|
|
left join ( -- 查铺点
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM oa_patrol_spot e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and EXTENDCODE1= '1'
|
|
GROUP BY ORG_ID
|
|
)a16 on l1.ORG_ID=a16.ORG_ID
|
|
|
|
left join ( -- 查哨点
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM oa_patrol_spot e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and EXTENDCODE1= '2'
|
|
GROUP BY ORG_ID
|
|
)a17 on l1.ORG_ID=a17.ORG_ID
|
|
|
|
left join ( -- 消火栓
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM fire_hydrant e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids )
|
|
GROUP BY ORG_ID
|
|
)a18 on l1.ORG_ID=a18.ORG_ID
|
|
|
|
left join ( -- 天然水源
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM fire_water_source e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids )
|
|
GROUP BY ORG_ID
|
|
)a19 on l1.ORG_ID=a19.ORG_ID
|
|
|
|
left join ( -- 消防水池
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM fire_pool e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids )
|
|
GROUP BY ORG_ID
|
|
)a20 on l1.ORG_ID=a20.ORG_ID
|
|
|
|
left join ( -- 取水码头
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM fire_intake_wharf e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids )
|
|
GROUP BY ORG_ID
|
|
)a21 on l1.ORG_ID=a21.ORG_ID
|
|
|
|
left join ( -- 应急联动单位
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM fire_e_l_unit e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and TYPE = '0'
|
|
GROUP BY ORG_ID
|
|
)a22 on l1.ORG_ID=a22.ORG_ID
|
|
|
|
left join ( -- 联勤保障单位
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM fire_e_l_unit e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids ) and TYPE = '1'
|
|
GROUP BY ORG_ID
|
|
)a23 on l1.ORG_ID=a23.ORG_ID
|
|
|
|
left join ( -- 专家信息
|
|
SELECT ORG_ID, count( ifnull( e.ORG_ID, 0 )) countNum FROM fire_expert e,( SELECT get_Org_child_list ( '" + orgId + @"' ) cids) s
|
|
WHERE find_in_set( e.org_id, cids )
|
|
GROUP BY ORG_ID
|
|
)a24 on l1.ORG_ID=a24.ORG_ID
|
|
ORDER BY ORG_NAME";
|
|
DataTable dt = FangYar.Common.MySqlHelper.QueryTable(sql);
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":" + FangYar.Common.JsonHelper.ToJson(dt) + "}";
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "导出操作请求", "导出缺失项统计数据异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "导出操作请求", "导出缺失项统计数据");
|
|
return returnstr;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询支队当天数据统计
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
/// <returns></returns>
|
|
public string GetCampDayStat(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
string DAY_STR = context.Request.Params["DAY_STR"];
|
|
|
|
if (!DateTime.TryParse(DAY_STR, out DateTime dtm))
|
|
{
|
|
DAY_STR = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
|
|
}
|
|
|
|
string sqlStr = " SELECT o.EXTENDCODE4,o.ORG_NAME,c.* from oa_camp_day_stat c LEFT JOIN fire_org o on c.ORG_ID = o.ORG_ID WHERE ORG_ID_ZD = '" + orgId +
|
|
"' and DAY_STR = '" + DAY_STR + "' ORDER BY o.EXTENDCODE4 ";
|
|
|
|
List<string> listZdOrg = new List<string>() {"36e8032be5f54a3cb994c4ac74ac3f77","40a1e65991764d4dac2d826bfbbfc849","5806465fa4e845998f31a10d023f332e",
|
|
"734389c7ae364584aea9918693bba3de","82487f0ebb6848e7ac4abc3d7cbc8504","833b28c12b42495a99a5e41068eb6805","9a1324ec8b244a7f9d6cbca88cd614fd",
|
|
"b5b00dfb27a34e0a8bd86270930e02d6","f4d9f25b27114172a66a9d04cc158b00" };
|
|
//判断是否总队
|
|
if (orgId == "D8DC637B8B984848A63F82A018AFAEB0")
|
|
{
|
|
|
|
sqlStr = @" SELECT o.ORG_NAME,t.* from ( SELECT ORG_ID_ZD ORG_ID
|
|
,sum(n1 ) n1
|
|
,sum(n2 ) n2
|
|
,sum(n3 ) n3
|
|
,sum(n4 ) n4
|
|
,sum(n5 ) n5
|
|
,sum(n6 ) n6
|
|
,sum(n7 ) n7
|
|
,sum(n8 ) n8
|
|
,sum(n9 ) n9
|
|
,sum(n10 ) n10
|
|
,sum(n11 ) n11
|
|
,sum(n12 ) n12
|
|
,sum(n13 ) n13
|
|
,sum(n14 ) n14
|
|
,sum(n15 ) n15
|
|
,sum(n16 ) n16
|
|
,sum(n17 ) n17
|
|
,sum(n20 ) n20
|
|
,sum(n21 ) n21
|
|
,sum(n22 ) n22
|
|
,sum(n23 ) n23
|
|
,sum(n24 ) n24
|
|
,sum(n25 ) n25
|
|
,sum(n26 ) n26
|
|
,sum(n30 ) n30
|
|
,sum(n31 ) n31
|
|
,sum(n40 ) n40
|
|
,sum(n60 ) n60
|
|
,sum(n61 ) n61
|
|
,sum(n70 ) n70
|
|
,sum(n71 ) n71
|
|
,sum(n80 ) n80
|
|
,sum(n81 ) n81
|
|
,sum(n90 ) n90
|
|
,sum(n91 ) n91
|
|
,sum(n92 ) n92
|
|
,sum(n93 ) n93
|
|
,sum(n100 ) n100
|
|
,sum(n101 ) n101
|
|
,sum(n130 ) n130
|
|
,sum(n131 ) n131
|
|
,sum(n132 ) n132
|
|
,sum(n133 ) n133
|
|
,sum(n134 ) n134
|
|
,sum(n135 ) n135
|
|
,sum(n136 ) n136
|
|
,sum(n137 ) n137
|
|
,sum(n138 ) n138
|
|
,sum(n139 ) n139
|
|
,sum(n1310 ) n1310
|
|
,sum(n1311 ) n1311
|
|
,sum(n1312 ) n1312
|
|
,sum(n1313 ) n1313
|
|
,sum(n1314 ) n1314
|
|
|
|
from ( SELECT ORG_ID,ORG_ID_ZD
|
|
,substring_index(group_concat(n1 order by day_str desc),',',1) n1
|
|
,substring_index(group_concat(n2 order by day_str desc),',',1) n2
|
|
,substring_index(group_concat(n3 order by day_str desc),',',1) n3
|
|
,substring_index(group_concat(n4 order by day_str desc),',',1) n4
|
|
,substring_index(group_concat(n5 order by day_str desc),',',1) n5
|
|
,substring_index(group_concat(n6 order by day_str desc),',',1) n6
|
|
,substring_index(group_concat(n7 order by day_str desc),',',1) n7
|
|
,substring_index(group_concat(n8 order by day_str desc),',',1) n8
|
|
,substring_index(group_concat(n9 order by day_str desc),',',1) n9
|
|
,substring_index(group_concat(n10 order by day_str desc),',',1) n10
|
|
,substring_index(group_concat(n11 order by day_str desc),',',1) n11
|
|
,substring_index(group_concat(n12 order by day_str desc),',',1) n12
|
|
,substring_index(group_concat(n13 order by day_str desc),',',1) n13
|
|
,substring_index(group_concat(n14 order by day_str desc),',',1) n14
|
|
,substring_index(group_concat(n15 order by day_str desc),',',1) n15
|
|
,substring_index(group_concat(n16 order by day_str desc),',',1) n16
|
|
,substring_index(group_concat(n17 order by day_str desc),',',1) n17
|
|
,sum(n20 ) n20
|
|
,sum(n21 ) n21
|
|
,sum(n22 ) n22
|
|
,sum(n23 ) n23
|
|
,sum(n24 ) n24
|
|
,sum(n25 ) n25
|
|
,sum(n26 ) n26
|
|
,sum(n30 ) n30
|
|
,sum(n31 ) n31
|
|
,sum(n40 ) n40
|
|
,sum(n60 ) n60
|
|
,sum(n61 ) n61
|
|
,sum(n70 ) n70
|
|
,sum(n71 ) n71
|
|
,sum(n80 ) n80
|
|
,sum(n81 ) n81
|
|
,sum(n90 ) n90
|
|
,sum(n91 ) n91
|
|
,sum(n92 ) n92
|
|
,sum(n93 ) n93
|
|
,sum(n100 ) n100
|
|
,sum(n101 ) n101
|
|
,sum(n130 ) n130
|
|
,sum(n131 ) n131
|
|
,sum(n132 ) n132
|
|
,sum(n133 ) n133
|
|
,sum(n134 ) n134
|
|
,sum(n135 ) n135
|
|
,sum(n136 ) n136
|
|
,sum(n137 ) n137
|
|
,sum(n138 ) n138
|
|
,sum(n139 ) n139
|
|
,sum(n1310 ) n1310
|
|
,sum(n1311 ) n1311
|
|
,sum(n1312 ) n1312
|
|
,sum(n1313 ) n1313
|
|
,sum(n1314 ) n1314
|
|
from oa_camp_day_stat
|
|
WHERE ORG_ID_ZD in (SELECT org_id from fire_org WHERE pid = '" + orgId + "') and DAY_STR = '" + DAY_STR + "' GROUP BY ORG_ID,ORG_ID_ZD ) t " +
|
|
" GROUP BY ORG_ID_ZD ) t LEFT JOIN fire_org o on t.ORG_ID=o.ORG_ID ORDER BY o.EXTENDCODE4 ";
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
//判断是否支队
|
|
if (!listZdOrg.Contains(orgId))
|
|
{
|
|
//不是支队,查询当前单位信息
|
|
sqlStr = " SELECT o.EXTENDCODE4,o.ORG_NAME,c.* from oa_camp_day_stat c LEFT JOIN fire_org o on c.ORG_ID = o.ORG_ID WHERE ORG_ID = '" + orgId +
|
|
"' and DAY_STR = '" + DAY_STR + "' ORDER BY o.EXTENDCODE4 ";
|
|
}
|
|
}
|
|
|
|
|
|
var dt = Common.MySqlHelper.QueryTable(sqlStr);
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(dt);
|
|
|
|
returnstr += "}";
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "导出操作请求", "导出缺失项统计数据异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "导出操作请求", "导出缺失项统计数据");
|
|
return returnstr;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
/// <returns></returns>
|
|
public string GetCampDayStatTimRange(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
string dtmStr = context.Request.Params["dtmStr"];
|
|
var arr = dtmStr.Split(new string[] { " - " }, StringSplitOptions.RemoveEmptyEntries);
|
|
string sTim = "";
|
|
string eTim = "";
|
|
if (arr.Length == 2)
|
|
{
|
|
sTim = arr[0];
|
|
eTim = arr[1];
|
|
}
|
|
|
|
|
|
string sqlStr = @" SELECT t.*,o.ORG_NAME from ( SELECT ORG_ID
|
|
,substring_index(group_concat(n1 order by day_str desc),',',1) n1
|
|
,substring_index(group_concat(n2 order by day_str desc),',',1) n2
|
|
,substring_index(group_concat(n3 order by day_str desc),',',1) n3
|
|
,substring_index(group_concat(n4 order by day_str desc),',',1) n4
|
|
,substring_index(group_concat(n5 order by day_str desc),',',1) n5
|
|
,substring_index(group_concat(n6 order by day_str desc),',',1) n6
|
|
,substring_index(group_concat(n7 order by day_str desc),',',1) n7
|
|
,substring_index(group_concat(n8 order by day_str desc),',',1) n8
|
|
,substring_index(group_concat(n9 order by day_str desc),',',1) n9
|
|
,substring_index(group_concat(n10 order by day_str desc),',',1) n10
|
|
,substring_index(group_concat(n11 order by day_str desc),',',1) n11
|
|
,substring_index(group_concat(n12 order by day_str desc),',',1) n12
|
|
,substring_index(group_concat(n13 order by day_str desc),',',1) n13
|
|
,substring_index(group_concat(n14 order by day_str desc),',',1) n14
|
|
,substring_index(group_concat(n15 order by day_str desc),',',1) n15
|
|
,substring_index(group_concat(n16 order by day_str desc),',',1) n16
|
|
,substring_index(group_concat(n17 order by day_str desc),',',1) n17
|
|
,sum(n20 ) n20
|
|
,sum(n21 ) n21
|
|
,sum(n22 ) n22
|
|
,sum(n23 ) n23
|
|
,sum(n24 ) n24
|
|
,sum(n25 ) n25
|
|
,sum(n26 ) n26
|
|
,sum(n30 ) n30
|
|
,sum(n31 ) n31
|
|
,sum(n40 ) n40
|
|
,sum(n60 ) n60
|
|
,sum(n61 ) n61
|
|
,sum(n70 ) n70
|
|
,sum(n71 ) n71
|
|
,sum(n80 ) n80
|
|
,sum(n81 ) n81
|
|
,sum(n90 ) n90
|
|
,sum(n91 ) n91
|
|
,sum(n92 ) n92
|
|
,sum(n93 ) n93
|
|
,sum(n100 ) n100
|
|
,sum(n101 ) n101
|
|
,sum(n130 ) n130
|
|
,sum(n131 ) n131
|
|
,sum(n132 ) n132
|
|
,sum(n133 ) n133
|
|
,sum(n134 ) n134
|
|
,sum(n135 ) n135
|
|
,sum(n136 ) n136
|
|
,sum(n137 ) n137
|
|
,sum(n138 ) n138
|
|
,sum(n139 ) n139
|
|
,sum(n1310 ) n1310
|
|
,sum(n1311 ) n1311
|
|
,sum(n1312 ) n1312
|
|
,sum(n1313 ) n1313
|
|
,sum(n1314 ) n1314
|
|
from oa_camp_day_stat
|
|
WHERE ORG_ID_ZD = '" + orgId + "'and DAY_STR >= '" + sTim + "' and DAY_STR <= '" + eTim + "' GROUP BY ORG_ID ) t " +
|
|
" LEFT JOIN fire_org o on t.ORG_ID=o.ORG_ID ORDER BY o.EXTENDCODE4 ";
|
|
|
|
var dt = Common.MySqlHelper.QueryTable(sqlStr);
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(dt);
|
|
|
|
returnstr += "}";
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "导出操作请求", "导出缺失项统计数据异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "导出操作请求", "导出缺失项统计数据");
|
|
return returnstr;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
/// <returns></returns>
|
|
public string GetCampDayStatTimRangeZD(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string orgId = context.Request.Params["OrgId"];
|
|
string dtmStr = context.Request.Params["dtmStr"];
|
|
var arr = dtmStr.Split(new string[] { " - " }, StringSplitOptions.RemoveEmptyEntries);
|
|
string sTim = "";
|
|
string eTim = "";
|
|
if (arr.Length == 2)
|
|
{
|
|
sTim = arr[0];
|
|
eTim = arr[1];
|
|
}
|
|
|
|
|
|
string sqlStr = @" SELECT o.ORG_NAME,t.* from ( SELECT ORG_ID_ZD ORG_ID
|
|
,sum(n1 ) n1
|
|
,sum(n2 ) n2
|
|
,sum(n3 ) n3
|
|
,sum(n4 ) n4
|
|
,sum(n5 ) n5
|
|
,sum(n6 ) n6
|
|
,sum(n7 ) n7
|
|
,sum(n8 ) n8
|
|
,sum(n9 ) n9
|
|
,sum(n10 ) n10
|
|
,sum(n11 ) n11
|
|
,sum(n12 ) n12
|
|
,sum(n13 ) n13
|
|
,sum(n14 ) n14
|
|
,sum(n15 ) n15
|
|
,sum(n16 ) n16
|
|
,sum(n17 ) n17
|
|
,sum(n20 ) n20
|
|
,sum(n21 ) n21
|
|
,sum(n22 ) n22
|
|
,sum(n23 ) n23
|
|
,sum(n24 ) n24
|
|
,sum(n25 ) n25
|
|
,sum(n26 ) n26
|
|
,sum(n30 ) n30
|
|
,sum(n31 ) n31
|
|
,sum(n40 ) n40
|
|
,sum(n60 ) n60
|
|
,sum(n61 ) n61
|
|
,sum(n70 ) n70
|
|
,sum(n71 ) n71
|
|
,sum(n80 ) n80
|
|
,sum(n81 ) n81
|
|
,sum(n90 ) n90
|
|
,sum(n91 ) n91
|
|
,sum(n92 ) n92
|
|
,sum(n93 ) n93
|
|
,sum(n100 ) n100
|
|
,sum(n101 ) n101
|
|
,sum(n130 ) n130
|
|
,sum(n131 ) n131
|
|
,sum(n132 ) n132
|
|
,sum(n133 ) n133
|
|
,sum(n134 ) n134
|
|
,sum(n135 ) n135
|
|
,sum(n136 ) n136
|
|
,sum(n137 ) n137
|
|
,sum(n138 ) n138
|
|
,sum(n139 ) n139
|
|
,sum(n1310 ) n1310
|
|
,sum(n1311 ) n1311
|
|
,sum(n1312 ) n1312
|
|
,sum(n1313 ) n1313
|
|
,sum(n1314 ) n1314
|
|
|
|
from ( SELECT ORG_ID,ORG_ID_ZD
|
|
,substring_index(group_concat(n1 order by day_str desc),',',1) n1
|
|
,substring_index(group_concat(n2 order by day_str desc),',',1) n2
|
|
,substring_index(group_concat(n3 order by day_str desc),',',1) n3
|
|
,substring_index(group_concat(n4 order by day_str desc),',',1) n4
|
|
,substring_index(group_concat(n5 order by day_str desc),',',1) n5
|
|
,substring_index(group_concat(n6 order by day_str desc),',',1) n6
|
|
,substring_index(group_concat(n7 order by day_str desc),',',1) n7
|
|
,substring_index(group_concat(n8 order by day_str desc),',',1) n8
|
|
,substring_index(group_concat(n9 order by day_str desc),',',1) n9
|
|
,substring_index(group_concat(n10 order by day_str desc),',',1) n10
|
|
,substring_index(group_concat(n11 order by day_str desc),',',1) n11
|
|
,substring_index(group_concat(n12 order by day_str desc),',',1) n12
|
|
,substring_index(group_concat(n13 order by day_str desc),',',1) n13
|
|
,substring_index(group_concat(n14 order by day_str desc),',',1) n14
|
|
,substring_index(group_concat(n15 order by day_str desc),',',1) n15
|
|
,substring_index(group_concat(n16 order by day_str desc),',',1) n16
|
|
,substring_index(group_concat(n17 order by day_str desc),',',1) n17
|
|
,sum(n20 ) n20
|
|
,sum(n21 ) n21
|
|
,sum(n22 ) n22
|
|
,sum(n23 ) n23
|
|
,sum(n24 ) n24
|
|
,sum(n25 ) n25
|
|
,sum(n26 ) n26
|
|
,sum(n30 ) n30
|
|
,sum(n31 ) n31
|
|
,sum(n40 ) n40
|
|
,sum(n60 ) n60
|
|
,sum(n61 ) n61
|
|
,sum(n70 ) n70
|
|
,sum(n71 ) n71
|
|
,sum(n80 ) n80
|
|
,sum(n81 ) n81
|
|
,sum(n90 ) n90
|
|
,sum(n91 ) n91
|
|
,sum(n92 ) n92
|
|
,sum(n93 ) n93
|
|
,sum(n100 ) n100
|
|
,sum(n101 ) n101
|
|
,sum(n130 ) n130
|
|
,sum(n131 ) n131
|
|
,sum(n132 ) n132
|
|
,sum(n133 ) n133
|
|
,sum(n134 ) n134
|
|
,sum(n135 ) n135
|
|
,sum(n136 ) n136
|
|
,sum(n137 ) n137
|
|
,sum(n138 ) n138
|
|
,sum(n139 ) n139
|
|
,sum(n1310 ) n1310
|
|
,sum(n1311 ) n1311
|
|
,sum(n1312 ) n1312
|
|
,sum(n1313 ) n1313
|
|
,sum(n1314 ) n1314
|
|
from oa_camp_day_stat
|
|
WHERE ORG_ID_ZD in (SELECT org_id from fire_org WHERE pid = '" + orgId + "') and DAY_STR >= '" + sTim + "' and DAY_STR <= '" + eTim + "' GROUP BY ORG_ID,ORG_ID_ZD ) t " +
|
|
" GROUP BY ORG_ID_ZD ) t LEFT JOIN fire_org o on t.ORG_ID=o.ORG_ID ORDER BY o.EXTENDCODE4 ";
|
|
|
|
var dt = Common.MySqlHelper.QueryTable(sqlStr);
|
|
|
|
returnstr = "{\"code\":0,\"msg\":\"\",\"data\":";
|
|
|
|
returnstr += FangYar.Common.JsonHelper.ToJson(dt);
|
|
|
|
returnstr += "}";
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "导出操作请求", "导出缺失项统计数据异常:" + e);
|
|
}
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "导出操作请求", "导出缺失项统计数据");
|
|
return returnstr;
|
|
}
|
|
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|