Search in sources :

Example 1 with UpdateAllById

use of top.tangyh.basic.database.injector.method.UpdateAllById in project lamp-util by zuihou.

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[] { SuperEntity.CREATE_TIME_COLUMN, SuperEntity.CREATED_BY_COLUMN }, field.getColumn())));
    return methodList;
}
Also used : 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) SuperEntity(top.tangyh.basic.base.entity.SuperEntity) UpdateAllById(top.tangyh.basic.database.injector.method.UpdateAllById) DefaultSqlInjector(com.baomidou.mybatisplus.core.injector.DefaultSqlInjector) UpdateAllById(top.tangyh.basic.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 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 SuperEntity (top.tangyh.basic.base.entity.SuperEntity)1 UpdateAllById (top.tangyh.basic.database.injector.method.UpdateAllById)1