Go directly to SQL. The idea is very simple
select * from test_table
where 1 = 1
<!-- IdList -->
<if test="IdList != null and IdList.size > 0">
AND PK_ID IN
<!-- Handle the case where Oracle does not support in when the set of in exceeds 1000 entries -->
<trim suffixOverrides=" OR PK_ID IN()"> <!-- means delete the last condition -->
<foreach collection="IdList" item="Id" index="index" open="(" close=")">
<if test="index != 0">
<choose>
<when test="index % 1000 == 999">) OR PK_ID IN (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{Id}
</foreach>
</trim>
</if>
Read More:
- SQL server converts multiple lines into one line, separated by characters
- [Solved] Running in 64 bit mode with the 32 bit Oracle client installed
- Oracle-OrcleInstanctClient Install ODBC Error: Oracle ODBC Driver with same name already exists
- How To Change ASM SYS PASSWORD
- Tkmybatis uses Example.SetOrderByClause Use for sorting and multiple sort fields
- Error 1406 (22001) in MySQL: data too long for column (Fixed)
- MySQL 8.0 error 1114 (HY000): the table’sbtest1’is full (Fixed)
- [How to Fix] Database can’t open file (errno:24)
- The setobject() method reports an error. The parameter index out of range and MySQL syntax error exception report an error
- ERROR 1054(42S22) Unknown column ‘password’ in ‘field list’ (Fixed)
- Oracle creates a job and executes the stored procedure with parameters regularly
- linux mysql ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- Error creating foreign key in MySQL: 1215 cannot add the foreign key constraint
- View’s select contains a subquery in the from clause bug
- mysql ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- The attributes of Oracle batch modification sequence (such as cache)_size, increment_(by et al.)
- Introduction to Relational Databases in SQL
- Lock request time out period exceeded. (Microsoft SQL Server, Error: 1222)
- mysqli_ Error() has no return value (Fixed)