报错信息:
org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the PriceAccuracyinfo.forRepot-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-01747: user.table.column, table.column 或列说明无效
如图,在PL/SQL中能正常执行 可是放在程序里面却报 ORA-01747: user.table.column, table.column 或列说明无效
列名仔细核对过了 除了ID 字段 其他字段没有用到关键字 求解!!!!以下是SQL
<select id="forRepot" resultClass="hashMap" parameterClass="PriceAccuracy" >
SELECT rownum,e.* FROM (
SELECT A.*, ROWNUM RN FROM (
SELECT * FROM (select t.#groupBy# groupName,(
select count(tt.targetpricebiasrate) from t_priceaccuracy_info tt
where t.#groupBy#=tt.#groupBy# and <![CDATA[To_Number(tt.targetpricebiasrate)<10]]>
<isNotEmpty property="PROJECTNAME" prepend="and">tt.projectname=#PROJECTNAME#</isNotEmpty>
<isNotEmpty property="CALCULATEWAY" prepend="and">tt.CALCULATEWAY=#CALCULATEWAY#</isNotEmpty>
<isNotEmpty property="RESPONSIBLE" prepend="and">tt.RESPONSIBLE=#RESPONSIBLE#</isNotEmpty>
<isNotEmpty property="PRICINGDATE" prepend="and"><![CDATA[tt.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]></isNotEmpty>
<isNotEmpty property="PRICINGDATE" prepend="and"><![CDATA[tt.PRICINGDATE<to_date(#overDate#,'yyyy-MM-dd')]]></isNotEmpty>
group by t.#groupBy#
) biasRate1,(
select count(tt.targetpricebiasrate) from t_priceaccuracy_info tt
where t.#groupBy#=tt.#groupBy# and <![CDATA[To_Number(tt.targetpricebiasrate)<20]]> and <![CDATA[To_Number(tt.targetpricebiasrate)>=10]]>
<isNotEmpty property="PROJECTNAME" prepend="and">tt.projectname=#PROJECTNAME#</isNotEmpty>
<isNotEmpty property="CALCULATEWAY" prepend="and">tt.CALCULATEWAY=#CALCULATEWAY#</isNotEmpty>
<isNotEmpty property="RESPONSIBLE" prepend="and">tt.RESPONSIBLE=#RESPONSIBLE#</isNotEmpty>
<isNotEmpty property="PRICINGDATE" prepend="and"><![CDATA[tt.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]></isNotEmpty>
<isNotEmpty property="PRICINGDATE" prepend="and"><![CDATA[tt.PRICINGDATE<to_date(#overDate#,'yyyy-MM-dd')]]></isNotEmpty>
group by t.#groupBy#
) biasRate2,(
select count(tt.targetpricebiasrate) from t_priceaccuracy_info tt
where t.#groupBy#=tt.#groupBy# and <![CDATA[To_Number(tt.targetpricebiasrate)>20]]>
tt.projectname=#PROJECTNAME#
tt.CALCULATEWAY=#CALCULATEWAY#
tt.RESPONSIBLE=#RESPONSIBLE#
<![CDATA[tt.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]>
<![CDATA[tt.PRICINGDATE
group by t.#groupBy#
) biasRate3,(
select count(tt.targetpricebiasrate) from t_priceaccuracy_info tt
where t.#groupBy#=tt.#groupBy#
tt.projectname=#PROJECTNAME#
tt.CALCULATEWAY=#CALCULATEWAY#
tt.RESPONSIBLE=#RESPONSIBLE#
<![CDATA[tt.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]>
<![CDATA[tt.PRICINGDATE
group by t.#groupBy#
) allNum,(
select (
select count(b.targetpricebiasrate) from t_priceaccuracy_info b
where t.#groupBy#=b.#groupBy# and <![CDATA[To_Number(b.targetpricebiasrate)
b.projectname=#PROJECTNAME#
b.CALCULATEWAY=#CALCULATEWAY#
b.RESPONSIBLE=#RESPONSIBLE#
<![CDATA[b.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]>
<![CDATA[b.PRICINGDATE
group by t.#groupBy#
)/(
select count(c.targetpricebiasrate) from t_priceaccuracy_info c
where t.#groupBy#=c.#groupBy# group by t.#groupBy#
) from t_priceaccuracy_info a where t.#groupBy#=a.#groupBy# group by t.#groupBy#
) biasRateRatio1,(
select (
select count(b.targetpricebiasrate) from t_priceaccuracy_info b
where t.#groupBy#=b.#groupBy# and <![CDATA[To_Number(b.targetpricebiasrate) and <![CDATA[To_Number(b.targetpricebiasrate)>=10]]>
b.projectname=#PROJECTNAME#
b.CALCULATEWAY=#CALCULATEWAY#
b.RESPONSIBLE=#RESPONSIBLE#
<![CDATA[b.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]>
<![CDATA[b.PRICINGDATE
group by t.#groupBy#
)/(
select count(c.targetpricebiasrate) from t_priceaccuracy_info c
where t.#groupBy#=c.#groupBy# group by t.#groupBy#
) from t_priceaccuracy_info a where t.#groupBy#=a.#groupBy# group by t.#groupBy#
) biasRateRatio2,(
select (
select count(b.targetpricebiasrate) from t_priceaccuracy_info b
where t.#groupBy#=b.#groupBy# and <![CDATA[To_Number(b.targetpricebiasrate)>20]]>
b.projectname=#PROJECTNAME#
b.CALCULATEWAY=#CALCULATEWAY#
b.RESPONSIBLE=#RESPONSIBLE#
<![CDATA[b.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]>
<![CDATA[b.PRICINGDATE
group by t.#groupBy#
)/(
select count(c.targetpricebiasrate) from t_priceaccuracy_info c
where t.#groupBy#=c.#groupBy# group by t.#groupBy#
) from t_priceaccuracy_info a where t.#groupBy#=a.#groupBy# group by t.#groupBy#
) biasRateRatio3
from t_priceaccuracy_info t
where 1=1
t.projectname=#PROJECTNAME#
t.CALCULATEWAY=#CALCULATEWAY#
t.RESPONSIBLE=#RESPONSIBLE#
<![CDATA[t.PRICINGDATE>to_date(#startDate#,'yyyy-MM-dd')]]>
<![CDATA[t.PRICINGDATE
group by t.#groupBy#)
)A WHERE <![CDATA[ROWNUM <= #page#*#rows#]]>
) e
WHERE <![CDATA[RN > (#page#-1)*#rows#]]>
order by ROWNUM desc
</sele