xiangpei
2025-04-18 23da057f35cea1ee061adc23ccb9b7511635133b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.monkeylessey.framework.plugins;
 
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
 
import java.sql.SQLException;
 
/**
 * mybatis plus 插件demo
 * 只有 plus的内置方法会走该插件
 *
 * @author xp
 * @data 2023/11/14
 */
public class MybatisPlusPluginDemo implements InnerInterceptor {
 
    @Override
    public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
        System.out.println("mybatis plus 插件执行前");
    }
}