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

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

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

报告相同问题?

悬赏问题

  • ¥30 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目
  • ¥15 数电几道习题,写出作答过程,ai一律不采用
  • ¥15 利用pthon计算薄膜结构的光导纳
  • ¥15 海康hlss视频流怎么播放
  • ¥15 Paddleocr:out of memory error on GPU
  • ¥30 51单片机C语言数码管驱动单片机为AT89C52