之前写的<=的逻辑, 只处理了删改查你可以试试改成 in,
```java
@
Slf4jpublic class Demo extends JsqlParserSupport implements InnerInterceptor {
@
Override public void beforePrepare(
StatementHandler sh, Connection connection, Integer transactionTimeout) {
PluginUtils.MPStatementHandler mpSh = PluginUtils.mpStatementHandler(sh);
MappedStatement ms = mpSh.mappedStatement();
SqlCommandType commandType = ms.getSqlCommandType();
if (commandType == SqlCommandType.SELECT || commandType == SqlCommandType.UPDATE || commandType == SqlCommandType.DELETE) {
mpSh.mPBoundSql().sql(parserMulti(mpSh.mPBoundSql().sql(), null));
}
}
@
Override protected void processSelect(Select select, int index, String sql, Object obj) {
PlainSelect plainSelect = (PlainSelect) select.getSelectBody();
MinorThanEquals minorThanEquals = getMinorThanEquals();
Expression where = plainSelect.getWhere();
plainSelect.setWhere(
where == null ? minorThanEquals : new AndExpression(where, minorThanEquals));
}
@
Override protected void processUpdate(Update update, int index, String sql, Object obj) {
....
}
@
Override protected void processDelete(Delete delete, int index, String sql, Object obj) {
....
}
@
NotNull private static MinorThanEquals getMinorThanEquals() {
MinorThanEquals minorThanEquals = new MinorThanEquals();
minorThanEquals.setLeftExpression(new Column("column_name"));
minorThanEquals.setRightExpression(new LongValue(4));
return minorThanEquals;
}
}
```