在MyBatis中使用String[]参数去查询时出现错误,把判断条件修改为.size > 0即可
<if test="feeCdRule!=null and feeCdRule!=''">
and inst.fee_cd in
<foreach item="feeCdRule" index="index" collection="feeCdRule" open="(" separator="," close=")">
#{feeCdRule}
</foreach>
</if>
解决方案: 将判断条件改为 : list.size >0
<if test="feeCdRule!=null and feeCdRule.size>0">
and inst.fee_cd in
<foreach item="feeCdRule" index="index" collection="feeCdRule" open="(" separator="," close=")">
#{feeCdRule}
</foreach>
</if>
参考:
https://www.cnblogs.com/GoQC/p/6217039.html
https://www.cnblogs.com/zx-n/p/7280306.html