All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mybatis.pj.provider.MySelectProvider Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package com.mybatis.pj.provider;

import org.apache.ibatis.mapping.MappedStatement;

import com.mybatis.pj.util.MyExampleSqlHelp;

import tk.mybatis.mapper.mapperhelper.MapperHelper;
import tk.mybatis.mapper.mapperhelper.MapperTemplate;  

public class MySelectProvider extends MapperTemplate{
	
	public MySelectProvider(Class mapperClass, MapperHelper mapperHelper) {
		super(mapperClass, mapperHelper);
	}

     public String selectPage(MappedStatement ms)  
      {  
    	 Class entityClass = getEntityClass(ms);
         //修改返回值类型为实体类型
         setResultType(ms, entityClass);
         StringBuilder sql = new StringBuilder("SELECT ");
         sql.append(MyExampleSqlHelp.getColumn());
         sql.append(MyExampleSqlHelp.isUseAlias());
         sql.append(MyExampleSqlHelp.isUseLeftJoin());
         sql.append(MyExampleSqlHelp.useWhereAndEqualsWhere());
         sql.append(MyExampleSqlHelp.useGreaterThan());
         sql.append(MyExampleSqlHelp.useLessThan());
         sql.append(MyExampleSqlHelp.useNotEquals());
         sql.append(MyExampleSqlHelp.notUseWhere());
         sql.append(MyExampleSqlHelp.useIn());
         sql.append(MyExampleSqlHelp.useLike());
         sql.append(MyExampleSqlHelp.useGroup());
         sql.append(MyExampleSqlHelp.useOrder());
        return sql.toString();  
      }  
}  




© 2015 - 2024 Weber Informatics LLC | Privacy Policy