管道基础大数据平台系统开发-【后端】-Server
1
sws
2022-11-26 ab849f796bdc17236a95ea5fe5c166fb8f24a75c
src/main/java/com/lf/server/extend/CustomizedSqlInjector.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package com.lf.server.extend;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import java.util.List;
/**
 * è‡ªå®šä¹‰æ–¹æ³•SQL注入器
 * @author WWW
 */
public class CustomizedSqlInjector extends DefaultSqlInjector {
    /**
     * å¦‚果只需增加方法,保留mybatis plus自带方法,
     * å¯ä»¥å…ˆèŽ·å–super.getMethodList(),再添加add
     */
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        methodList.add(new InsertBatchMethod());
        methodList.add(new UpdateBatchMethod());
        return methodList;
    }
}