岁月如灬风 2019-09-04 11:45 采纳率: 0%
浏览 1627
已采纳

ORA-00921: 未预期的 SQL 命令结尾,帮忙看一下这个语句哪里错了?

报错如下
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred while applying a parameter map.  
--- Check the TpostUpexamreg.findTpostUpexamregDetailList-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: ORA-00921: 未预期的 SQL 命令结尾

语句如下:

<select id="findTpostUpexamregDetailList" parameterClass="map" resultClass="tpostUpexamregBean">
    select  
        upexam.year,upexam.currentgrade,upexam.id,
        upexam.targetgrade,upexam.flowsta,upexam.chksign,
        us.username username_,us.idcard,
        up.chgradeyear chgradeyear_,up.year year_,up.effstayear effstayear_,up.effendyear effendyear_,
        co.codename spostname_
    from 
        tb_tpost_upexamreg upexam,pxgl_users us,
        tb_tpost_userpost up,tb_tpost_code co,pxgl_unit un
    where 
        upexam.year = #year#
        <isNotEmpty property="unitid">
            and upexam.unitid = #unitid#
        </isNotEmpty>
        <!-- 不为被废弃数据 -->  
        and upexam.flowsta!=-99
        and upexam.idcard = us.idcard(+)
        and us.idcard= up.idcard(+)
        and us.unitid = un.unitid(+)
        and up.dataflag!=99
        <isNotEmpty prepend="and" property="flowsta">
            <isEmpty property="flowsta21">
                <![CDATA[upexam.flowsta >= #flowsta#]]>
            </isEmpty>
            <isNotEmpty property="flowsta21">
                (<![CDATA[upexam.flowsta >= #flowsta#]]> or upexam.flowsta=#flowsta21#)
            </isNotEmpty>
            <isEqual compareValue="21" property="flowsta" prepend="and">
                un.f_unitid is not null
            </isEqual>
        </isNotEmpty>
        and upexam.mpostid = up.mpostid 
        and upexam.spostid = up.spostid
        and up.spostid = co.id
    <isNotEmpty prepend="" property="mpostid">
        and upexam.mpostid = #mpostid#
        <isNotEmpty property="spostid">
            and upexam.spostid = #spostid#
        </isNotEmpty>   
    </isNotEmpty>
    <isNotEmpty property="targetGrade">
        and upexam.targetgrade = #targetGrade#
    </isNotEmpty>   
    <isNotEmpty prepend="and" property="keyword">
        us.username like '%'||#keyword#||'%'
    </isNotEmpty>
    <isNotEmpty prepend="and" property="filterChk">
        upexam.flowsta != 99
    </isNotEmpty>
    <!-- <isNotEmpty property="sortfield"> -->
        order by upexam.flowsta
    <!-- </isNotEmpty> -->
</select>
  • 写回答

1条回答 默认 最新

  • Tiarnach 2019-09-04 11:55
    关注

    '%'||#keyword#||'%' 这个字符串不对,要匹配内部'要转以,where里少4个and

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥65 LineageOs-21.0系统编译问题
  • ¥30 关于#c++#的问题,请各位专家解答!
  • ¥15 App的会员连续扣费
  • ¥15 不同数据类型的特征融合应该怎么做
  • ¥15 用proteus软件设计一个基于8086微处理器的简易温度计
  • ¥15 用联想小新14Pro
  • ¥15 multisim中关于74ls192n和DSWPK开关仿真图分析(减法计数器)
  • ¥15 w3wp,exe 中发生未处理的 Microsoft ,NETFramework 异常。
  • ¥20 C51单片机程序及仿真(加减器)
  • ¥15 AQWA | 水动力分析 二阶波浪力