com.github.yulichang.method.SelectJoinCount Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-plus-join-core Show documentation
Show all versions of mybatis-plus-join-core Show documentation
An enhanced toolkit of Mybatis-Plus to simplify development.
package com.github.yulichang.method;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;
/**
* copy {@link com.baomidou.mybatisplus.core.injector.methods.SelectCount}
*
* @author yulichang
* @since 1.1.8
*/
public class SelectJoinCount extends MPJAbstractMethod {
@SuppressWarnings("deprecation")
public SelectJoinCount() {
super();
}
@SuppressWarnings("unused")
public SelectJoinCount(String name) {
super(name);
}
@Override
public MappedStatement injectMappedStatement(Class> mapperClass, Class> modelClass, TableInfo tableInfo) {
SqlMethod sqlMethod = SqlMethod.SELECT_JOIN_COUNT;
String sql = String.format(sqlMethod.getSql(), sqlFirst(), sqlCount(),
mpjTableName(tableInfo), sqlAlias(), sqlFrom(), sqlWhereEntityWrapper(true, tableInfo), sqlComment());
SqlSource sqlSource = languageDriver.createSqlSource(configuration, removeExtraWhitespaces(sql), modelClass);
return this.addSelectMappedStatementForOther(mapperClass, sqlMethod.getMethod(), sqlSource, Long.class);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy