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个回答

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

LiuK94
岁月如灬风 不是的,我重新导了下公司项目就好了,可能之前改了什么吧,谢谢了。
11 个月之前 回复
Tiarnach
Tiarnach 回复岁月如灬风: 是转义的问题吗
11 个月之前 回复
Tiarnach
Tiarnach 回复岁月如灬风: 转义的这个你试下,其他的也找不出了
11 个月之前 回复
LiuK94
岁月如灬风 帮忙再看下呗,谢谢了。。。
11 个月之前 回复
LiuK94
岁月如灬风 语句前排复制错了,有加判断加AND的。。。
11 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐