com.diboot.core.methods.GetOneInRecycleBin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of diboot-core Show documentation
Show all versions of diboot-core Show documentation
diboot core extend by begcode
package com.diboot.core.methods;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.sql.SqlScriptUtils;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;
import com.diboot.core.methods.RecycleBinSqlMethod;
import org.apache.ibatis.scripting.defaults.RawSqlSource;
public class GetOneInRecycleBin extends AbstractMethod {
public GetOneInRecycleBin() {
this(RecycleBinSqlMethod.SELECT_BY_ID.name());
}
public GetOneInRecycleBin(String name) {
super(name);
}
@Override
public MappedStatement injectMappedStatement(Class> mapperClass, Class> modelClass, TableInfo tableInfo) {
RecycleBinSqlMethod sqlMethod = RecycleBinSqlMethod.SELECT_BY_ID;
SqlSource sqlSource = new RawSqlSource(this.configuration, String.format(sqlMethod.getSql(), this.sqlSelectColumns(tableInfo, false), tableInfo.getTableName(), tableInfo.getKeyColumn(), tableInfo.getKeyProperty(), " AND NOT (" + tableInfo.getLogicDeleteSql(true, true) + ") "), Object.class);
return this.addSelectMappedStatementForTable(mapperClass, this.methodName, sqlSource, tableInfo);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy