Commit 334e67f1 authored by 李丛阳's avatar 李丛阳

查询封装

parent 9f5914ec
package org.rcisoft.core.druid; package org.rcisoft.config;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import org.rcisoft.core.druid.DruidProperties;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
...@@ -22,7 +23,7 @@ import java.sql.SQLException; ...@@ -22,7 +23,7 @@ import java.sql.SQLException;
@ConditionalOnClass(DruidDataSource.class) @ConditionalOnClass(DruidDataSource.class)
@ConditionalOnProperty(prefix = "druid", name = "username")//name 随便 druid 下有对应属性即可 @ConditionalOnProperty(prefix = "druid", name = "username")//name 随便 druid 下有对应属性即可
@AutoConfigureBefore(DataSourceAutoConfiguration.class) @AutoConfigureBefore(DataSourceAutoConfiguration.class)
public class DruidAutoConfiguration { public class DruidConfig {
@Autowired @Autowired
private DruidProperties properties; private DruidProperties properties;
......
...@@ -94,6 +94,8 @@ public class ${table.entityName}ServiceImpl implements ${table.entityName}Servic ...@@ -94,6 +94,8 @@ public class ${table.entityName}ServiceImpl implements ${table.entityName}Servic
*/ */
public List<${table.entityName}> findAllByPagination(PageUtil<${table.entityName}> paginationUtility, public List<${table.entityName}> findAllByPagination(PageUtil<${table.entityName}> paginationUtility,
${table.entityName} ${table.entityName?uncap_first}){ ${table.entityName} ${table.entityName?uncap_first}){
${table.entityName?uncap_first}.setStart();
${table.entityName?uncap_first}.setNotDeleted();
return ${table.entityName?uncap_first}Repository.query${table.entityName}s(${table.entityName?uncap_first}); return ${table.entityName?uncap_first}Repository.query${table.entityName}s(${table.entityName?uncap_first});
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment