提交 7f802de5 编写于 作者: sq3536's avatar sq3536

debug

上级 f4bafd8a
...@@ -10,8 +10,5 @@ import java.util.List; ...@@ -10,8 +10,5 @@ import java.util.List;
public interface DbEntityMapper extends BaseMapper<EntityObj>{ public interface DbEntityMapper extends BaseMapper<EntityObj>{
@Select("${sql} \n" +
"<where><if test=\"ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere\">${ew.sqlSegment}</if></where> \n" +
"<if test=\"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere\">${ew.sqlSegment}</if> ")
List<EntityObj> search(@Param("sql") String sql,@Param("ew") Wrapper<EntityObj> wrapper); List<EntityObj> search(@Param("sql") String sql,@Param("ew") Wrapper<EntityObj> wrapper);
} }
\ No newline at end of file
...@@ -46,8 +46,6 @@ public class DstDataSourceExService extends DstDataSourceServiceImpl { ...@@ -46,8 +46,6 @@ public class DstDataSourceExService extends DstDataSourceServiceImpl {
{ {
DataSourceProperty dataSourceProperty = new DataSourceProperty(); DataSourceProperty dataSourceProperty = new DataSourceProperty();
DynamicRoutingDataSource ds = dataSource; DynamicRoutingDataSource ds = dataSource;
DataSource dataSource = druidDataSourceCreator.createDataSource(dataSourceProperty);
List<Setting> settings= JSONArray.parseArray(dstDataSource.getDsCfg(),Setting.class); List<Setting> settings= JSONArray.parseArray(dstDataSource.getDsCfg(),Setting.class);
for(Setting setting:settings) for(Setting setting:settings)
{ {
...@@ -62,6 +60,8 @@ public class DstDataSourceExService extends DstDataSourceServiceImpl { ...@@ -62,6 +60,8 @@ public class DstDataSourceExService extends DstDataSourceServiceImpl {
else if(setting.getProperty().equalsIgnoreCase("defaultSchema")) else if(setting.getProperty().equalsIgnoreCase("defaultSchema"))
dataSourceProperty.setSchema(setting.getValue()); dataSourceProperty.setSchema(setting.getValue());
} }
DataSource dataSource = druidDataSourceCreator.createDataSource(dataSourceProperty);
ds.addDataSource(dstDataSource.getDsName(), dataSource); ds.addDataSource(dstDataSource.getDsName(), dataSource);
} }
...@@ -79,7 +79,7 @@ public class DstDataSourceExService extends DstDataSourceServiceImpl { ...@@ -79,7 +79,7 @@ public class DstDataSourceExService extends DstDataSourceServiceImpl {
public void initDataSource(String dsName) public void initDataSource(String dsName)
{ {
if(dataSource.getDataSource(dsName)==null) // if(dataSource.getDataSource(dsName)==null)
{ {
DstDataSource dstDataSource=this.getOne(Wrappers.<DstDataSource>lambdaQuery().eq(DstDataSource::getDsId,dsName).or().eq(DstDataSource::getDsName,dsName),false); DstDataSource dstDataSource=this.getOne(Wrappers.<DstDataSource>lambdaQuery().eq(DstDataSource::getDsId,dsName).or().eq(DstDataSource::getDsName,dsName),false);
if(dstDataSource!=null) if(dstDataSource!=null)
......
...@@ -100,8 +100,8 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl ...@@ -100,8 +100,8 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
FieldModel lastModifyField=entityModel.getLastModifyField(); FieldModel lastModifyField=entityModel.getLastModifyField();
QueryFilter filter=new QueryFilter(); QueryFilter filter=new QueryFilter();
if(lastModifyField!=null) //if(lastModifyField!=null)
filter.ge(lastModifyField.getColumnName(), lastModify); // filter.ge(lastModifyField.getColumnName(), lastModify);
List<EntityObj> kEntityObjs=this.selectCore(entityModel, filter); List<EntityObj> kEntityObjs=this.selectCore(entityModel, filter);
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.extensions.mapper.DbEntityMapper">
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.lite.extensions.filter.DbEntitySearchContext" resultType="cn.ibizlab.core.lite.extensions.domain.EntityObj">
${sql}
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
</mapper>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册