废话不多说直接上正题 一看就一目了然
//报错的代码 mybatis会把'B'解析为字符 所以会报错
<if test=" paramCondition.gsjrb == 'B' ">
and xxxx = xxx
</if>
//正确的代码 给B加双引号
<if test=" paramCondition.gsjrb == "B" ">
and xxxx = xxx
</if>
//正确的代码 或写多个字符 'BB'
<if test=" paramCondition.gsjrb == "B" ">
and xxxx = xxx
</if>