我在调用oracle语句时,由于语句比较复杂,不得不选择在sql 模板中加入了cte。语句在数据库中执行是正常的,但是在jfinal中却运行错误,请问大家jfinal不支持使用cte吗?sql语句如下:
WITH BaseQuery AS ( SELECT sea.XZDQ_DM, xzdq.XZDQ_MC AS NAME, SUM(CASE WHEN sea.sblb IN ('1000', '2000', '3000', '4000', '5000', '6000', '9000') THEN 1 ELSE 0 END) AS all_sum, SUM(CASE WHEN sea.sblb = '1000' THEN 1 ELSE 0 END) AS gl_sum, SUM(CASE WHEN sea.sblb = '2000' THEN 1 ELSE 0 END) AS rq_sum, SUM(CASE WHEN sea.sblb = '3000' THEN 1 ELSE 0 END) AS dt_sum, SUM(CASE WHEN sea.sblb = '4000' THEN 1 ELSE 0 END) AS qzjx_sum, SUM(CASE WHEN sea.sblb = '5000' THEN 1 ELSE 0 END) AS cnjdcl_sum, SUM(CASE WHEN sea.sblb = '6000' THEN 1 ELSE 0 END) AS ylss_sum, SUM(CASE WHEN sea.sblb = '9000' THEN 1 ELSE 0 END) AS sd_sum, SUM(CASE WHEN sea.sblb2 = '2300' THEN 1 ELSE 0 END) AS qp_sum FROM (SELECT * FROM V_SB_SEARCHER WHERE sbsyzt NOT IN ('00080004', '00080008', '00080016') #for(x : cond) #if(com.jfinal.kit.StrKit::notBlank(x.value)) AND #(x.key) #para(x.value) #end #end ) sea LEFT JOIN FRM_XZDQ xzdq ON sea.XZDQ_DM = xzdq.XZDQ_DM WHERE xzdq.XZDQ_MC IS NOT NULL GROUP BY xzdq.XZDQ_MC, sea.XZDQ_DM ), GDZCDData AS ( SELECT XZDQ_DM, COALESCE(SUM(TO_NUMBER(GDZCD)),0) AS gd_sum FROM T_SB_GD WHERE sbsyzt NOT IN ('00080004', '00080008', '00080016') AND REGEXP_LIKE (GDZCD, '^[0-9]+$') #for(x : cond) #if(com.jfinal.kit.StrKit::notBlank(x.value)) AND #(x.key) #para(x.value) #end #end group by XZDQ_DM ) SELECT BQ.NAME, BQ.all_sum, BQ.gl_sum, BQ.rq_sum, BQ.dt_sum, BQ.qzjx_sum, BQ.cnjdcl_sum, BQ.ylss_sum, BQ.sd_sum, BQ.qp_sum, GD.gd_sum FROM BaseQuery BQ LEFT JOIN GDZCDData GD ON BQ.XZDQ_DM = GD.XZDQ_DM GROUP BY BQ.NAME, BQ.all_sum, BQ.gl_sum, BQ.rq_sum, BQ.dt_sum, BQ.qzjx_sum, BQ.cnjdcl_sum, BQ.ylss_sum, BQ.sd_sum, BQ.qp_sum,GD.gd_sum
项目:JFinal
异常信息以及调用代码都没有,无法进一步判断