invalid comparison: java.util.Arrays$ArrayList and java.lang.String

mybatis报错:invalid comparison: java.util.Arrays$ArrayList and java.lang.String

传入参数为数组判断时当字符串处理了



 <if test="operationNo!=''">
                and o.operation_no in
                <foreach collection="operationNo" item="operationNo" separator="," open="(" close=")">
                    #{operationNo,jdbcType=VARCHAR}
                </foreach>
 </if>

正确写法

   <if test="operationNo!=null">
                and o.operation_no in
                <foreach collection="operationNo" item="operationNo" separator="," open="(" close=")">
                    #{operationNo,jdbcType=VARCHAR}
                </foreach>
 </if>

 

 
上一篇:使用Java创建PACT我无法在主体中设置numberType的最小值


下一篇:invalid character in identifier