mybatis执行多条SQL脚本

发布时间 2023-07-10 11:32:29作者: yshy

例如:

<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