Search in sources :

Example 1 with SelectById

use of com.baomidou.mybatisplus.core.injector.methods.SelectById in project mybatis-plus-samples by baomidou.

the class MyLogicSqlInjector method getMethodList.

/**
 * 如果只需增加方法,保留MP自带方法
 * 可以super.getMethodList() 再add
 * @return
 */
@Override
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
    List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
    methodList.add(new DeleteAll());
    methodList.add(new MyInsertAll());
    methodList.add(new MysqlInsertAllBatch());
    methodList.add(new SelectById());
    return methodList;
}
Also used : DeleteAll(com.baomidou.mybatisplus.samples.deluxe.methods.DeleteAll) AbstractMethod(com.baomidou.mybatisplus.core.injector.AbstractMethod) SelectById(com.baomidou.mybatisplus.core.injector.methods.SelectById) MyInsertAll(com.baomidou.mybatisplus.samples.deluxe.methods.MyInsertAll) MysqlInsertAllBatch(com.baomidou.mybatisplus.samples.deluxe.methods.MysqlInsertAllBatch)

Example 2 with SelectById

use of com.baomidou.mybatisplus.core.injector.methods.SelectById in project tutorials-java by Artister.

the class MyLogicSqlInjector method getMethodList.

/**
 * 如果只需增加方法,保留MP自带方法
 * 可以super.getMethodList() 再add
 * @return
 */
@Override
public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
    List<AbstractMethod> methodList = super.getMethodList(mapperClass);
    methodList.add(new DeleteAll());
    methodList.add(new MyInsertAll());
    methodList.add(new MysqlInsertAllBatch());
    methodList.add(new SelectById());
    return methodList;
}
Also used : DeleteAll(com.baomidou.mybatisplus.samples.deluxe.methods.DeleteAll) AbstractMethod(com.baomidou.mybatisplus.core.injector.AbstractMethod) SelectById(com.baomidou.mybatisplus.core.injector.methods.SelectById) MyInsertAll(com.baomidou.mybatisplus.samples.deluxe.methods.MyInsertAll) MysqlInsertAllBatch(com.baomidou.mybatisplus.samples.deluxe.methods.MysqlInsertAllBatch)

Aggregations

AbstractMethod (com.baomidou.mybatisplus.core.injector.AbstractMethod)2 SelectById (com.baomidou.mybatisplus.core.injector.methods.SelectById)2 DeleteAll (com.baomidou.mybatisplus.samples.deluxe.methods.DeleteAll)2 MyInsertAll (com.baomidou.mybatisplus.samples.deluxe.methods.MyInsertAll)2 MysqlInsertAllBatch (com.baomidou.mybatisplus.samples.deluxe.methods.MysqlInsertAllBatch)2