|
版本: |
X5.2.6 |
小版本号: |
|
|
|
数据库: |
MySQL |
服务器操作系统: |
|
应用服务器: |
|
客户端操作系统: |
|
浏览器: |
|
|
|
public static Table LZBHZ(){
String mssql= "select * from (select count(t36.fZLLX)as p1 from KJ_SQZL t36 where t36.fZLLX like '%发明专利%'and t36.fDW = '冷轧部')a," +
"(select count(t37.fLWTM)as p2 from KJ_LWXX t37 where t37.fDW = '冷轧部')b," +
"(select count(t38.fSBMC)as p3 from KJ_SB t38 where t38.fDW = '冷轧部')c," +
"(select count(t39.fBZMC)as p4 from KJ_BZXX t39 where t39.fDW = '冷轧部')d," +
"(select count(t40.fHJMC)as p4 from KJ_HJXX t40 where t40.fDW = '冷轧部')e," +
"(select sum(t19.fZFZJZED)as p5 from KJ_ZFZJ t19 where t19.fDW = '冷轧部')f," +
"(select sum(t10.fGZSJRYS)as p6 from KJ_WBZJ t10 where t10.fDW = '冷轧部')g," +
"(select count(t34.fSQZLMC)as p7,count(case when fZLLX like '%发明专利%' then fZLLX else null end)as p8 from KJ_SLZL t34 where t34.fDW = '冷轧部')h," +
"(select count(fXMMC)as p9," +
"count(case when fXMLY like '%省级项目%' then fXMLY else null end)as p10," +
"count(case when fXMLY like '%对外合作%' then fXMLY else null end)as p11," +
"count(case when fXMLY like '%三年以上%' then fXMJZ else null end)as p12," +
"count(case when fXMLY like '%完成%' then fXMJZ else null end)as p13" +
"from KJ_QBXM where fDW = '冷轧部')i," +
"(select sum(t20.fYQSBYJ)p14," +
"sum(case when t20.fJKGC = '进口' then t20.fYQSBYJ else 0 end)p15 from KJ_YQSB t20 where t20.fDW = '冷轧部')j," +
"(select sum(CASE WHEN t12. fXMCGXS<5 or t12.fXMCGXS=8 or t12.fXMJSJJMB<3 THEN t12.fxmry ELSE 0 END)as p16," +
"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 p17," +
"sum(t12.fLWF)as p18," +
"sum(t12.fYCLXHF)as p19,"+
"sum(t12.fSBZJYCQFYTX+t12.fYYKYZYJZWDZJFY)as p20,"+
"sum(t12.fWXZCTX)as p21,"+
"sum(t12.fDNZC)as p22,"+
"sum(t12.fGMYZZSBF)as p23,"+
"count(case when (fXMCGXS>0 and fXMCGXS<5) or fXMCGXS=8 then 1 else null end)+count(case when fXMJSJJMB>0 AND fXMJSJJMB<3 then 1 else null end)as p24," +
"count(case when t12.fXMJSJJMB = '3' or t12.fXMJSJJMB = '4' then t12.fXMJSJJMB else null end)as p25," +
"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 p26," +
"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 p27," +
"sum(t12.fPXF)as p28," +
"sum(t12.fYJJSXSJFZC)as p29," +
"sum(t12.fGMGNJFZC)as p30 from KJ_XMJB t12 where t12.fDW = '冷轧部')k," +
"(select count(t1.fXM)as p31," +
"count(case when t1.fJSZW = '项目人员' and t1.fDW = '冷轧部' then t1.fJSZW else null end)as p32," +
"count(case when (t1.fJSZW = '服务人员'or t1.fJSZW = '管理人员') then t1.fJSZW else null end)as p33," +
"count(case when t1.fXB = '女' then t1.fXB else null end)as p34," +
"count(case when (t1.fZC = '高级职称'or t1.fZC = '中级职称') then t1.fZC else null end)as p35," +
"count(t1.fXM)as p36," +
"count(case when t1.fXL = '博士' then t1.fXL else null end)as p37," +
"count(case when t1.fXL = '硕士' then t1.fXL else null end)as p38," +
"count(case when t1.fXL = '本科' then t1.fXL else null end)as p39 from KJ_KJHDRYMXB t1 where t1.fDW = '冷轧部')l";
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上怎么就获取失败呢,求大神看一下。谢谢- 执行sqlQueryAction时报错!select * from (select count(t36.fZLLX)as p1 from KJ_SQZL t36 where t36.fZLLX like '%发明专利%'and t36.fDW = '冷轧部')a,(select count(t37.fLWTM)as p2 from KJ_LWXX t37 where t37.fDW = '冷轧部')b,(select count(t38.fSBMC)as p3 from KJ_SB t38 where t38.fDW = '冷轧部')c,(select count(t39.fBZMC)as p4 from KJ_BZXX t39 where t39.fDW = '冷轧部')d,(select count(t40.fHJMC)as p4 from KJ_HJXX t40 where t40.fDW = '冷轧部')e,(select sum(t19.fZFZJZED)as p5 from KJ_ZFZJ t19 where t19.fDW = '冷轧部')f,(select sum(t10.fGZSJRYS)as p6 from KJ_WBZJ t10 where t10.fDW = '冷轧部')g,(select count(t34.fSQZLMC)as p7,count(case when fZLLX like '%发明专利%' then fZLLX else null end)as p8 from KJ_SLZL t34 where t34.fDW = '冷轧部')h,(select count(fXMMC)as p9,count(case when fXMLY like '%省级项目%' then fXMLY else null end)as p10,count(case when fXMLY like '%对外合作%' then fXMLY else null end)as p11,count(case when fXMLY like '%三年以上%' then fXMJZ else null end)as p12,count(case when fXMLY like '%完成%' then fXMJZ else null end)as p13from KJ_QBXM where fDW = '冷轧部')i,(select sum(t20.fYQSBYJ)p14,sum(case when t20.fJKGC = '进口' then t20.fYQSBYJ else 0 end)p15 from KJ_YQSB t20 where t20.fDW = '冷轧部')j,(select sum(CASE WHEN t12. fXMCGXS<5 or t12.fXMCGXS=8 or t12.fXMJSJJMB<3 THEN t12.fxmry ELSE 0 END)as p16,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 p17,sum(t12.fLWF)as p18,sum(t12.fYCLXHF)as p19,sum(t12.fSBZJYCQFYTX+t12.fYYKYZYJZWDZJFY)as p20,sum(t12.fWXZCTX)as p21,sum(t12.fDNZC)as p22,sum(t12.fGMYZZSBF)as p23,count(case when (fXMCGXS>0 and fXMCGXS<5) or fXMCGXS=8 then 1 else null end)+count(case when fXMJSJJMB>0 AND fXMJSJJMB<3 then 1 else null end)as p24,count(case when t12.fXMJSJJMB = '3' or t12.fXMJSJJMB = '4' then t12.fXMJSJJMB else null end)as p25,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 p26,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 p27,sum(t12.fPXF)as p28,sum(t12.fYJJSXSJFZC)as p29,sum(t12.fGMGNJFZC)as p30 from KJ_XMJB t12 where t12.fDW = '冷轧部')k,(select count(t1.fXM)as p31,count(case when t1.fJSZW = '项目人员' and t1.fDW = '冷轧部' then t1.fJSZW else null end)as p32,count(case when (t1.fJSZW = '服务人员'or t1.fJSZW = '管理人员') then t1.fJSZW else null end)as p33,count(case when t1.fXB = '女' then t1.fXB else null end)as p34,count(case when (t1.fZC = '高级职称'or t1.fZC = '中级职称') then t1.fZC else null end)as p35,count(t1.fXM)as p36,count(case when t1.fXL = '博士' then t1.fXL else null end)as p37,count(case when t1.fXL = '硕士' then t1.fXL else null end)as p38,count(case when t1.fXL = '本科' then t1.fXL else null end)as p39 from KJ_KJHDRYMXB t1 where t1.fDW = '冷轧部')l
- at com.justep.report.controller.DataController.a(Unknown Source)
- at com.justep.report.controller.DataController.a(Unknown Source)
复制代码 |
|