本文主要是介绍Mybatis报错sql injection violation, syntax error: TODO :IDENTIFIER,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天被这个报错搞了一下午
<select id="getMmZxZffs" resultType="cn.vetech.asms.pay.service.freepwdpay.vo.ZxZffsQueryVO" parameterType="cn.vetech.asms.pay.service.freepwdpay.dto.ZxZffsQueryDTO">select t.A skFs,t.B,t.C skFsmc,t.D skKm,t.E skKmmc,t2.F,t2.id,t2.G,t3.H,t2.I,t3.J,t2.K,t.zt,t2.L,t2.M,t3.Nfrom<choose><when test='skdx == "3"'>((sm_smaa t INNER JOIN ZF_SH t2 ONt.sbb2 = t2.id )inner join kq_ddd t3on t2.BM= t3.zfdjm)INNER joinud_dfd t4 on t2.id = t4.zfshid</when><otherwise>(sm_smaa t INNER JOIN ZF_SH t2 ONt.zfshid = t2.id)inner join zf_jk_list t3on t2.ert = t3.zfdjm</otherwise></ch
mybatis版本:3.2.7
数据库:Oracle
解决办法:
去除join相关的所有括号
<select id="getMmZxZffs" resultType="cn.vetech.asms.pay.service.freepwdpay.vo.ZxZffsQueryVO" parameterType="cn.vetech.asms.pay.service.freepwdpay.dto.ZxZffsQueryDTO">select t.A skFs,t.B,t.C skFsmc,t.D skKm,t.E skKmmc,t2.F,t2.id,t2.G,t3.H,t2.I,t3.J,t2.K,t.zt,t2.L,t2.M,t3.Nfrom<choose><when test='skdx == "3"'>sm_smaa t INNER JOIN ZF_SH t2 ONt.sbb2 = t2.id inner join kq_ddd t3on t2.BM= t3.zfdjmINNER joinud_dfd t4 on t2.id = t4.zfshid</when><otherwise>sm_smaa t INNER JOIN ZF_SH t2 ONt.zfshid = t2.idinner join zf_jk_list t3on t2.ert = t3.zfdjm</otherwise></ch
希望对大家有所帮助吧
这篇关于Mybatis报错sql injection violation, syntax error: TODO :IDENTIFIER的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!