Search in sources :

Example 1 with UpdateAllById

use of com.albedo.java.plugins.database.injector.method.UpdateAllById in project albedo by somowhere.

the class LampSqlInjector method getMethodList.

@Override
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
    List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
    // 增加自定义方法
    methodList.add(new InsertBatchSomeColumn(i -> i.getFieldFill() != FieldFill.UPDATE));
    methodList.add(new UpdateAllById(field -> !ArrayUtil.containsAny(new String[] { BaseDo.F_SQL_CREATED_DATE, BaseDo.F_SQL_CREATED_BY }, field.getColumn())));
    return methodList;
}
Also used : UpdateAllById(com.albedo.java.plugins.database.injector.method.UpdateAllById) List(java.util.List) TableInfo(com.baomidou.mybatisplus.core.metadata.TableInfo) InsertBatchSomeColumn(com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn) ArrayUtil(cn.hutool.core.util.ArrayUtil) FieldFill(com.baomidou.mybatisplus.annotation.FieldFill) AbstractMethod(com.baomidou.mybatisplus.core.injector.AbstractMethod) BaseDo(com.albedo.java.common.core.basic.domain.BaseDo) DefaultSqlInjector(com.baomidou.mybatisplus.core.injector.DefaultSqlInjector) UpdateAllById(com.albedo.java.plugins.database.injector.method.UpdateAllById) AbstractMethod(com.baomidou.mybatisplus.core.injector.AbstractMethod) InsertBatchSomeColumn(com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn)

Aggregations

ArrayUtil (cn.hutool.core.util.ArrayUtil)1 BaseDo (com.albedo.java.common.core.basic.domain.BaseDo)1 UpdateAllById (com.albedo.java.plugins.database.injector.method.UpdateAllById)1 FieldFill (com.baomidou.mybatisplus.annotation.FieldFill)1 AbstractMethod (com.baomidou.mybatisplus.core.injector.AbstractMethod)1 DefaultSqlInjector (com.baomidou.mybatisplus.core.injector.DefaultSqlInjector)1 TableInfo (com.baomidou.mybatisplus.core.metadata.TableInfo)1 InsertBatchSomeColumn (com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn)1 List (java.util.List)1