| | |
| | | { |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and A.wkshp_code=@style "; |
| | | search += "and A.wkshp_code=@wkshopcode "; |
| | | dynamicParams.Add("@wkshopcode", wkshopcode); |
| | | } |
| | | if (calltypecode != "" && calltypecode != null) |
| | |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | search = search.Substring(3);//截取索引2后面的字符 |
| | | //search = search.Substring(3);//截取索引2后面的字符 |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select A.wkshp_code,T.org_name as wkshp_name,A.eqp_code,E.name as eqp_name,Y.name as typename, |
| | |
| | | + CAST(CAST(datediff(second,A.start_date,A.resp_date) % 86400 / 3600 AS INT) AS VARCHAR) + '小时' |
| | | + CAST(CAST(datediff(second,A.start_date,A.resp_date) % 3600 / 60 AS INT) AS VARCHAR) + '分' |
| | | + CAST(CAST(datediff(second,A.start_date,A.resp_date) % 60 AS INT) AS VARCHAR) + '秒' AS respondcont, |
| | | (case when A.resp_user is null then '待响应' else '以响应' end) as status |
| | | (case when A.resp_user is null then '待响应' else '已响应' end) as status |
| | | from TAnDon_Task_Info A |
| | | left join TOrganization T on A.wkshp_code=T.org_code |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | |
| | | { |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and A.wkshp_code=@style "; |
| | | search += "and A.wkshp_code=@wkshopcode "; |
| | | dynamicParams.Add("@wkshopcode", wkshopcode); |
| | | } |
| | | if (calltypecode != "" && calltypecode != null) |
| | |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | search = search.Substring(3);//截取索引2后面的字符 |
| | | //search = search.Substring(3);//截取索引2后面的字符 |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select A.wkshp_code as 车间编码,T.org_name as 车间名称,A.eqp_code as 设备编码,E.name as 设备名称,Y.name as 呼叫类型, |
| | |
| | | + CAST(CAST(datediff(second,A.start_date,A.resp_date) % 86400 / 3600 AS INT) AS VARCHAR) + '小时' |
| | | + CAST(CAST(datediff(second,A.start_date,A.resp_date) % 3600 / 60 AS INT) AS VARCHAR) + '分' |
| | | + CAST(CAST(datediff(second,A.start_date,A.resp_date) % 60 AS INT) AS VARCHAR) + '秒' AS 响应时长, |
| | | (case when A.resp_user is null then '待响应' else '以响应' end) as 状态 |
| | | (case when A.resp_user is null then '待响应' else '已响应' end) as 状态 |
| | | from TAnDon_Task_Info A |
| | | left join TOrganization T on A.wkshp_code=T.org_code |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | |
| | | |
| | | |
| | | #region[安灯报表汇总] |
| | | public static ToMessage AnDonReportSumSearch(string wkshopcode, string calltypecode, string callopendate, string callclosedate, string respondopendate, string respondclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage AnDonReportSumSearch(string wkshopcode,string eqpcode, string calltypecode, string callopendate, string callclosedate, string respondopendate, string respondclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | { |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and A.wkshp_code=@style "; |
| | | search += "and A.wkshp_code=@wkshopcode "; |
| | | dynamicParams.Add("@wkshopcode", wkshopcode); |
| | | } |
| | | if (eqpcode != "" && eqpcode != null) |
| | | { |
| | | search += "and A.eqp_code=@eqpcode "; |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | | } |
| | | if (calltypecode != "" && calltypecode != null) |
| | | { |
| | |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | search = search.Substring(3);//截取索引2后面的字符 |
| | | //search = search.Substring(3);//截取索引2后面的字符 |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select T.org_name as wkshp_name,Y.name as calltypename, |
| | | (select count(*) callcount from TAnDon_Task_Info AA where AA.wkshp_code=A.wkshp_code and AA.type=A.type) as callcount, |
| | | (select count(*) repondcount from TAnDon_Task_Info BB where BB.wkshp_code=A.wkshp_code and BB.type=A.type and BB.status='CLOSED') as repondcount, |
| | | (select CAST(DATEDIFF(ss, start_date,resp_date)/60 as INT) from TAnDon_Task_Info CC where CC.wkshp_code=A.wkshp_code and CC.type=A.type and CC.status='CLOSED') as repondtime |
| | | from TAnDon_Task_Info A |
| | | left join TOrganization T on A.wkshp_code=T.org_code |
| | | left join TAnDonType Y on A.type=Y.code |
| | | where T.description='W' "+search+" group by A.wkshp_code,T.org_name,A.type,Y.name "; |
| | | var sql = @"select top 100 percent T.org_name as wkshp_name,A.eqp_code,E.name as eqp_name,Y.name as calltypename, |
| | | (select count(*) callcount from TAnDon_Task_Info AA where AA.wkshp_code=A.wkshp_code and AA.type=A.type) as callcount, |
| | | (select count(*) repondcount from TAnDon_Task_Info BB where BB.wkshp_code=A.wkshp_code and BB.type=A.type and BB.status='CLOSED') as repondcount, |
| | | (select ISNULL(SUM(CAST(DATEDIFF(ss, CC.start_date,CC.resp_date)/60 as INT)),0) from TAnDon_Task_Info CC where CC.wkshp_code=A.wkshp_code and CC.eqp_code=A.eqp_code and CC.type=A.type) as repondtime |
| | | from TAnDon_Task_Info A |
| | | left join TOrganization T on A.wkshp_code=T.org_code |
| | | left join TAnDonType Y on A.type=Y.code |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | where T.description='W' " + search+" group by A.wkshp_code,T.org_name,A.type,Y.name,A.eqp_code,E.name order by T.org_name,A.eqp_code "; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.Message = "查询成功!"; |
| | |
| | | #endregion |
| | | |
| | | #region[安灯报表汇总导出] |
| | | public static ToMessage AnDonReportSumExcelSearch(string wkshopcode, string calltypecode, string callopendate, string callclosedate, string respondopendate, string respondclosedate) |
| | | public static ToMessage AnDonReportSumExcelSearch(string wkshopcode,string eqpcode, string calltypecode, string callopendate, string callclosedate, string respondopendate, string respondclosedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | { |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and A.wkshp_code=@style "; |
| | | search += "and A.wkshp_code=@wkshopcode "; |
| | | dynamicParams.Add("@wkshopcode", wkshopcode); |
| | | } |
| | | if (eqpcode != "" && eqpcode != null) |
| | | { |
| | | search += "and A.eqp_code=@eqpcode "; |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | | } |
| | | if (calltypecode != "" && calltypecode != null) |
| | | { |
| | |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | search = search.Substring(3);//截取索引2后面的字符 |
| | | //search = search.Substring(3);//截取索引2后面的字符 |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select T.org_name as 生产车间,Y.name as 呼叫类型, |
| | | (select count(*) callcount from TAnDon_Task_Info AA where AA.wkshp_code=A.wkshp_code and AA.type=A.type) as 呼叫次数, |
| | | (select count(*) repondcount from TAnDon_Task_Info BB where BB.wkshp_code=A.wkshp_code and BB.type=A.type and BB.status='CLOSED') as 响应次数, |
| | | (select CAST(DATEDIFF(ss, start_date,resp_date)/60 as INT) from TAnDon_Task_Info CC where CC.wkshp_code=A.wkshp_code and CC.type=A.type and CC.status='CLOSED') as 响应时长(分) |
| | | from TAnDon_Task_Info A |
| | | left join TOrganization T on A.wkshp_code=T.org_code |
| | | left join TAnDonType Y on A.type=Y.code |
| | | where T.description='W' " + search + " group by A.wkshp_code,T.org_name,A.type,Y.name "; |
| | | var sql = @"select top 100 percent T.org_name as 生产车间,E.name as 设备名称,Y.name as 呼叫类型, |
| | | (select count(*) callcount from TAnDon_Task_Info AA where AA.wkshp_code=A.wkshp_code and AA.eqp_code=A.eqp_code and AA.type=A.type) as 总呼叫次数, |
| | | (select count(*) repondcount from TAnDon_Task_Info BB where BB.wkshp_code=A.wkshp_code and BB.eqp_code=A.eqp_code and BB.type=A.type and BB.status='CLOSED') as 总响应次数, |
| | | (select ISNULL(SUM(CAST(DATEDIFF(ss, CC.start_date,CC.resp_date)/60 as INT)),0) from TAnDon_Task_Info CC where CC.wkshp_code=A.wkshp_code and CC.eqp_code=A.eqp_code and CC.type=A.type) 总响应时长 |
| | | from TAnDon_Task_Info A |
| | | left join TOrganization T on A.wkshp_code=T.org_code |
| | | left join TAnDonType Y on A.type=Y.code |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | where T.description='W' " + search+" group by A.wkshp_code,T.org_name,A.type,Y.name,A.eqp_code,E.name order by T.org_name,A.eqp_code "; |
| | | DataTable data = DapperHelper.selectdata(sql, dynamicParams); |
| | | data.TableName = "Table"; //设置DataTable的名称 |
| | | string msg = DownLoad.DataTableToExcel(data, "安灯汇总报表"); |