|
@ -24,6 +24,7 @@ import org.springframework.orm.hibernate5.HibernateTemplate;
|
|
|
import org.springframework.orm.hibernate5.LocalSessionFactoryBean;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.persistence.Table;
|
|
|
import java.io.IOException;
|
|
@ -821,6 +822,10 @@ public class SQLGeneralDAO implements XSQLGeneralDAO {
|
|
|
|
|
|
|
|
|
public List searchPage(Class tClass,String dataType, String version, String condition, String order, Integer offset, Integer limit,boolean isStandard) throws IOException {
|
|
|
return searchPage(tClass,null,dataType,version,condition,order,offset,limit,isStandard);
|
|
|
}
|
|
|
|
|
|
public List searchPage(Class tClass,List<String> fields,String dataType, String version, String condition, String order, Integer offset, Integer limit,boolean isStandard) throws IOException {
|
|
|
String tableName;
|
|
|
if(isStandard){
|
|
|
StandardVersion standardVersion = new StandardVersion(version);
|
|
@ -878,7 +883,12 @@ public class SQLGeneralDAO implements XSQLGeneralDAO {
|
|
|
sqlCreator.order(elem.substring(1), value);
|
|
|
}
|
|
|
}
|
|
|
String sql = sqlCreator.selectData(tableName);
|
|
|
String sql = "";
|
|
|
if(CollectionUtils.isEmpty(fields)){
|
|
|
sql = sqlCreator.selectData(tableName);
|
|
|
}else{
|
|
|
sql = sqlCreator.selectData(tableName,fields);
|
|
|
}
|
|
|
Query query = getQuery(sqlCreator, sql);
|
|
|
if (limit != null) {
|
|
|
query.setMaxResults(limit);
|
|
@ -889,6 +899,7 @@ public class SQLGeneralDAO implements XSQLGeneralDAO {
|
|
|
return query.list();
|
|
|
}
|
|
|
|
|
|
|
|
|
public boolean isExistByField(Class tClass, String stdVersion,String dataType,String field, Object val) throws IOException {
|
|
|
|
|
|
return isExistByFields(
|