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;
|
}
|
}
|