|
版本: |
X5.2.6 |
小版本号: |
|
|
|
数据库: |
|
服务器操作系统: |
|
应用服务器: |
|
客户端操作系统: |
|
浏览器: |
|
|
|
- public static Table LZBHZ(){
- String mssql= "select * from (select count(t6.fSQZLMC)as p42,"+
- "count(case when t6.fZLLX like '%发明专利%' then t6.fZLLX else null end) as p43 from KJ_SLZL t6 where t6.fDW = '冷轧部')a,"+
- "(select sum(t5.fZLSYQZRJXKSR)as p47,count(case when t5.fJWSQ like '%是%'then t5.fJWSQ else null end)AS P45,"+
- "count(case when t5.fSFZR like '%是%'then t5.fSFZR else null end)AS p46, "+
- "count(case when t5.fZLLX like '%发明专利%'then t5.fZLLX else null end)AS p44 from KJ_SQZL t5 where t5.fDW = '冷轧部')b,"+
- "(select count(t8.fSBMC)as p49,count(case when t8.fJWZCC like '%是%'then t8.fJWZCC else null end)AS P50 from KJ_SB t8 where t8.fDW = '冷轧部')c,"+
- "(select count(t9.fLWTM)as p48 from KJ_LWXX t9 where t9.fDW = '冷轧部')d,"+
- "(select count(t10.fBZMC)as p51 from KJ_BZXX t10 where t10.fDW = '冷轧部')e,"+
- "(select count(t11.fHJMC)as p52 from KJ_HJXX t11 where t11.fDW = '冷轧部')f,"+
- "(select sum(t70.fKCJMS)as p53,sum(t70.fGXJSQYJMS)as p54,sum(t70.fJSGZJFZC)as p58 from KJ_JSMY t70 where t70.fDW = '冷轧部')g,"+
- "(select count(t1.fXM)as p1,"+
- "count(case when t1.fJSZW = '项目人员' then t1.fJSZW else null end)as p2,"+
- "count(case when (t1.fJSZW = '服务人员'or t1.fJSZW = '管理人员') then t1.fJSZW else null end)as p3,"+
- "count(case when t1.fXB = '女' then t1.fXB else null end)as p4,"+
- "count(case when (t1.fZC = '高级职称'or t1.fZC = '中级职称') then t1.fZC else null end)as p5,"+
- "count(case when t1.fCYKJHDSJ - t1.fJZKJHDSJ > 9 then t1.fXM else null end)p6,"+
- "count(case when t1.fXL = '博士' then t1.fXL else null end)as p7,"+
- "count(case when t1.fXL = '硕士' then t1.fXL else null end)as p8,"+
- "count(case when t1.fXL = '本科' then t1.fXL else null end)as p9, "+
- "sum(t1.fYGZE)as p13 from KJ_KJHDRYMXB t1 where t1.fDW = '冷轧部')l,"+
- "(select count(case when (t2.fZJLX = '市级专家') then t2.fZC else null end)p11,"+
- "count(case when (t2.fZJLX = '省级专家') then t2.fZC else null end)p12 from KJ_DWNBZJ t2 where fDW = '冷轧部')m,"+
- "(select sum(t3.fGZSJRYS)as p14 from KJ_WBZJ t3 where t3.fDW = '冷轧部')n,"+
- "(select sum(CASE WHEN t12.fXMCGXS<5 or t12.fXMCGXS=8 or t12.fXMJSJJMB<3 THEN t12.fxmry ELSE 0 END)as p10,"+
- "sum(t12.fLWF+t12.fYCLXHF+t12.fQQLZF+t12.fDYCLF+t12.fBGF+t12.fZLTSF+t12.fKYSBWXF+t12.fYSF+t12.fZTHYF+t12.fCGJDF+t12.fKYFZF+t12.fJJLWF+t12.fPXF+t12.fQTNBZC+t12.fSDF+t12.fSBZJYCQFYTX+t12.fYYKYZYJZWDZJFY+t12.fWXZCTX)as p15,"+
- "sum(t12.fLWF)as p16,"+
- "sum(t12.fYCLXHF)as p17,"+
- "sum(t12.fSBZJYCQFYTX+t12.fYYKYZYJZWDZJFY)as p18,"+
- "sum(t12.fWXZCTX)as p19,"+
- "sum(t12.fQQLZF+t12.fDYCLF+t12.fBGF+t12.fZLTSF+t12.fKYSBWXF+t12.fYSF+t12.fZTHYF+t12.fCGJDF+t12.fKYFZF+t12.fJJLWF+t12.fPXF+t12.fQTNBZC+t12.fSDF)as p20,"+
- "sum(t12.fGNYJJGZC+t12.fGNGDXXZC+t12.fJWZC+fGNQYZC)as p21,"+
- "sum(t12.fGNYJJGZC)as p22,"+
- "sum(t12.fGNGDXXZC)as p23,"+
- "sum(t12.fJWZC)as p24,"+
- "sum(t12.fDNZC)as p25,"+
- "sum(t12.fGMYZZSBF)as p26,"+
- "sum(t12.fPXF)as p31,"+
- "count(case when (fXMCGXS>0 and fXMCGXS<5) or fXMCGXS=8 then 1 else null end)+count(case when fXMJSJJMB>0 AND fXMJSJJMB<5 then 1 else null end)as p34,"+
- "count(case when t12.fXMJSJJMB = '3' or t12.fXMJSJJMB = '4' then t12.fXMJSJJMB else null end)as p35,"+
- "sum(case when t12.fXMJSJJMB = '3' or t12.fXMJSJJMB = '4' then t12.fLWF+t12.fYCLXHF+t12.fQQLZF+t12.fDYCLF+t12.fBGF+t12.fZLTSF+t12.fKYSBWXF+t12.fYSF+t12.fZTHYF+t12.fCGJDF+t12.fKYFZF+t12.fJJLWF+t12.fPXF+t12.fQTNBZC+t12.fSDF+t12.fGMYZZSBF else 0 end)as p36,"+
- "sum(t12.fLWF+t12.fYCLXHF+t12.fQQLZF+t12.fDYCLF+t12.fBGF+t12.fZLTSF+t12.fKYSBWXF+t12.fYSF+t12.fZTHYF+t12.fCGJDF+t12.fKYFZF+t12.fJJLWF+t12.fPXF+t12.fQTNBZC+t12.fSDF+t12.fGMYZZSBF)as p37,"+
- "sum(case when (fXMCGXS>0 and fXMCGXS<5) or fXMCGXS=8 then t12.fLWF+t12.fYCLXHF+t12.fQQLZF+t12.fDYCLF+t12.fBGF+t12.fZLTSF+t12.fKYSBWXF+t12.fYSF+t12.fZTHYF+t12.fCGJDF+t12.fKYFZF+t12.fJJLWF+t12.fPXF+t12.fQTNBZC+t12.fSDF+t12.fGMYZZSBF else 0 end) + sum(case when fXMJSJJMB>0 AND fXMJSJJMB<3 then t12.fLWF+t12.fYCLXHF+t12.fQQLZF+t12.fDYCLF+t12.fBGF+t12.fZLTSF+t12.fKYSBWXF+t12.fYSF+t12.fZTHYF+t12.fCGJDF+t12.fKYFZF+t12.fJJLWF+t12.fPXF+t12.fQTNBZC+t12.fSDF+t12.fGMYZZSBF else 0 end)as p38,"+
- "sum(t12.fYJJSXSJFZC)as p56,"+
- "sum(t12.fYJGWZC)as p55,"+
- "sum(t12.fGMGNJFZC)as p57 from KJ_XMJB t12 where t12.fDW = '冷轧部')o,"+
- "(select sum(t4.fZFZJZED)as p27 FROM KJ_ZFZJ t4 where t4.fDW = '冷轧部')q,"+
- "(select sum(t20.fYQSBYJ)as p28,"+
- "sum(t20.fYQSBYJ)as p29,"+
- "sum(case when t20.fJKGC = '进口' then t20.fYQSBYJ else 0 end)as p30 from KJ_YQSB t20 where t20.fDW = '冷轧部')r,"+
- "(select count(case when t24.fXMLY like '%对外合作%' then t24.fXMLY else null end)as p39,"+
- "count(fXMMC)as p32,"+
- "count(case when fXMLY like '%省级项目%' then fXMLY else null end)as p33,"+
- "count(case when t24.fXMLY like '%三年以上%' then t24.fXMLY else null end)as p40,"+
- "count(case when t24.fXMLY like '%完成%' then t24.fXMLY else null end)as p41 "+
- "from KJ_QBXM t24 where t24.fDW = '冷轧部')s";
- HashMap<String,String> sqlMap=new HashMap<String,String>();
- System.out.println(mssql);
- sqlMap.put(DatabaseProduct.MYSQL.name(), mssql);
- return SQL.select(sqlMap, null, "/KJXM/kjxm/data");
- }
复制代码 做了一个报表,写了action,查询数据库数据,用mysq管理器l查询的时候,也就一秒,为什么到了功能页面需要这么久。。。可不可以优化一下,谢谢。
|
|