mybatis执行多条SQL脚本

例如:

<choose>
                    <when test="fplx != null and fplx == 'dzpt'.toString()">
                        delete from xs_dzptfp_jx where fpdm=#{fpdm} and fphm=#{fphm};
                        delete from xs_dzptfp_jx_qd where fpdm=#{fpdm} and fphm=#{fphm}
                    </when>

运行时报错:

Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 

解决方法;

在数据库连接中增加&allowMultiQueries=true

 

posted @ 2023-07-10 11:21  yshy  阅读(114)  评论(0编辑  收藏  举报