mybatis .xml中 判断集合是否为空

先看报错信息:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, Error SQL: SELECT count(*) FROM m_work_order_plan mp
where mp.work_status = 1
and mp.actual_end_time between and
and mp.executor_id in

通过debug和数据追源发现 不应该拼接and mp.executor_id in

排查到问题代码 集合判断失败导致拼接多余代码

问题代码:

and mp.executor\_id in #{executorId}

修正后:

and mp.executor\_id in #{executorId}

问题出现原因:

数组判空问题

你可能感兴趣的:(java,mybatis,xml,java,运维,开发语言)