When I checked the log today, I found that the following exceptions occurred many times. After consulting the data, I found that IN
the maximum number of expressions written in the statement cannot exceed 1000.
Solutions: 1. Split IN
the conditions inside, control the number of expressions within 1000, and then OR
connect them through statements.
2. As a subquery.
I used the second method:
<if test="createBy != null and createBy.name != null and createBy.name != ''"> AND a.create_by in (select u.id as "createBy.id" FROM sys_user u where u.name LIKE <if test="dbName == 'oracle'">'%'||#{createBy.name}||'%'</if> <if test="dbName == 'mssql'">'%'+#{createBy.name}+'%'</if> <if test="dbName == 'mysql'">concat('%',#{createBy.name},'%')</if> ) </if>
The first method has time to try again