--- Cause: java.sql.SQLException: ORA-00907: missing right parenthesis

小沈阳 2011-12-13 03:13:29
<select id="statisticsGift" parameterClass="java.util.Map" resultMap="StatisticsDetailQueryVOGift-map">
<![CDATA[
select * from (
select rownum rowcount,a.city_code city_code,a.order_id order_id,a.create_date create_date,a.gift_package_name gift_package_name,b.product_name product_name,a.number_resource number_resource,a.fee_value fee_value,a.PAY_WAY_NAME
from(
select a.city_code,a.order_id,a.resource_id,a.create_date,a.gift_package_name,b.number_resource,a.fee_value,a.PAY_WAY_NAME
from(
select a.city_code,a.order_id,a.resource_id,a.create_date,b.gift_package_name gift_package_name,a.fee_value,a.PAY_WAY_NAME
from(
select a.city_code,a.order_id,d.resource_id,f.create_date,e.fee_value,g.PAY_WAY_NAME
from es_order_info_t a,es_order_prod_inst_t b,es_product_inst_t c,es_prod_item_inst_t d,es_pay_fee_item_t e,es_shop_alipay_control_t f,es_pay_way_t g
where a.order_id = b.order_id
and b.product_inst_id = c.product_inst_id
and c.product_inst_id = d.product_inst_id
and d.product_inst_id = e.product_inst_id
and a.order_id = f.register_number
and a.PAY_WAY = g.PAY_WAY
and c.product_id = #productId#
<isEqual property ="payWay" compareValue ="0" >
and a.pay_way in (1,2)
</isEqual>
<isNotEqual property = "payWay" compareValue ="0" >
and a.pay_way = #payWay#
</isNotEqual>
and a.complete_status in ('1','2')
and f.accept_status in ('1','0')
) a inner join es_mobile_package_t b on a.resource_id = b.gift_package_id
) a left join
(
select a.city_code,a.order_id,a.resource_id,a.create_date,b.number_resource number_resource,a.PAY_WAY_NAME
from(
select a.city_code,a.order_id,d.resource_id,f.create_date,e.fee_value,g.PAY_WAY_NAME
from es_order_info_t a,es_order_prod_inst_t b,es_product_inst_t c,es_prod_item_inst_t d,es_pay_fee_item_t e,es_shop_alipay_control_t f,es_pay_way_t g
where a.order_id = b.order_id
and b.product_inst_id = c.product_inst_id
and c.product_inst_id = d.product_inst_id
and d.product_inst_id = e.product_inst_id
and a.order_id = f.register_number
and a.PAY_WAY = g.PAY_WAY
and c.product_id = #productId#
<isEqual property ="payWay" compareValue ="0" >
and a.pay_way in (1,2)
</isEqual>
<isNotEqual property = "payWay" compareValue ="0" >
and a.pay_way = #payWay#
</isNotEqual>
and a.complete_status in ('1','2')
and f.accept_status in ('1','0')
) a inner join es_number_resource_t b on a.resource_id = b.number_resource
) b on a.order_id = b.order_id
) a left join
(
select a.city_code,a.order_id,a.resource_id,a.create_date,b.product_name product_name,a.fee_value,a.PAY_WAY_NAME
from(
select a.city_code,a.order_id,d.resource_id,f.create_date,e.fee_value,g.PAY_WAY_NAME
from es_order_info_t a,es_order_prod_inst_t b,es_product_inst_t c,es_prod_item_inst_t d,es_pay_fee_item_t e,es_shop_alipay_control_t f,es_pay_way_t g
where a.order_id = b.order_id
and b.product_inst_id = c.product_inst_id
and c.product_inst_id = d.product_inst_id
and d.product_inst_id = e.product_inst_id
and a.order_id = f.register_number
and a.PAY_WAY = g.PAY_WAY
and c.product_id = #productId#
<isEqual property ="payWay" compareValue ="0" >
and a.pay_way in (1,2)
</isEqual>
<isNotEqual property = "payWay" compareValue ="0" >
and a.pay_way = #payWay#
</isNotEqual>
and a.complete_status in ('1','2')
and f.accept_status in ('1','0')
) a inner join es_main_product_t b on a.resource_id = b.product_suite_id
) b on a.order_id = b.order_id
where a.city_code = #cityCode#
and a.create_date >= to_date(#beginDate#,'yyyy-mm-dd hh24:mi:ss')
and a.create_date <= to_date(#endDate#,'yyyy-mm-dd hh24:mi:ss')
and rownum < #endRowCount#
) where rowcount >= #beginRowCount#
]]>
</select>



本来可以正常运行但是加上<isEqual property ="payWay" compareValue ="0" >
and a.pay_way in (1,2)
</isEqual>
<isNotEqual property = "payWay" compareValue ="0" >
and a.pay_way = #payWay#
</isNotEqual>
就会报题目的异常 哪个大侠给看看
...全文
192 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
仲兴轩 2011-12-13
  • 打赏
  • 举报
回复
<isEqual property ="payWay" compareValue ="0" >
and a.pay_way in (1,2)
</isEqual>
<isNotEqual property = "payWay" compareValue ="0" >
and a.pay_way = #payWay#
</isNotEqual>

你的这个a.pay_way 是啥呀,
看你最后的SQL是啥咯, 放在数据库里执行一下,
and a.pay_way in (1,2), 这里不行的话, 就改成 and a.pay_way in ('1','2')
and a.pay_way = #payWay# 这里改成 and a.pay_way = '#payWay#'

10,608

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧