提交 07ebbb1f 编写于 作者: sq3536's avatar sq3536

提交,实体层编码结束

上级 b059a384
...@@ -719,6 +719,17 @@ public class POSchema { ...@@ -719,6 +719,17 @@ public class POSchema {
} }
} }
public List<BaseData> trans(List<BaseData> source)
{
if(!needTrans)
return source;
else {
List<BaseData> target = new ArrayList<>();
source.forEach(item->target.add(trans(item)));
return target;
}
}
public POSchema writeTo(Path path) public POSchema writeTo(Path path)
{ {
......
...@@ -219,7 +219,7 @@ public class DbDataServiceImpl implements IDataService { ...@@ -219,7 +219,7 @@ public class DbDataServiceImpl implements IDataService {
rt.addAll(dbDataMapper.getBatchData(link.getName(),poSchema,batch)); rt.addAll(dbDataMapper.getBatchData(link.getName(),poSchema,batch));
batch.clear(); batch.clear();
} }
return rt; return poSchema.trans(rt);
} }
@Override @Override
...@@ -321,7 +321,7 @@ public class DbDataServiceImpl implements IDataService { ...@@ -321,7 +321,7 @@ public class DbDataServiceImpl implements IDataService {
if(StringUtils.isEmpty(datasource))datasource=model.getDefaultDataSource(); if(StringUtils.isEmpty(datasource))datasource=model.getDefaultDataSource();
DSLink link=dsSettingService.getDataSource(datasource); DSLink link=dsSettingService.getDataSource(datasource);
POSchema poSchema=model.getPOSchema(link.getType()); POSchema poSchema=model.getPOSchema(link.getType());
return dbDataMapper.selectData(link.getName(),poSchema,et); return poSchema.trans(dbDataMapper.selectData(link.getName(),poSchema,et));
} }
@Override @Override
...@@ -331,7 +331,7 @@ public class DbDataServiceImpl implements IDataService { ...@@ -331,7 +331,7 @@ public class DbDataServiceImpl implements IDataService {
DSLink link=dsSettingService.getDataSource(datasource); DSLink link=dsSettingService.getDataSource(datasource);
POSchema poSchema=model.getPOSchema(link.getType()); POSchema poSchema=model.getPOSchema(link.getType());
com.baomidou.mybatisplus.extension.plugins.pagination.Page<BaseData> pages=dbDataMapper.selectData(link.getName(),poSchema,et,FilterData.getPages(poSchema,pageable)); com.baomidou.mybatisplus.extension.plugins.pagination.Page<BaseData> pages=dbDataMapper.selectData(link.getName(),poSchema,et,FilterData.getPages(poSchema,pageable));
return new PageImpl<BaseData>(pages.getRecords(), pageable, pages.getTotal()); return new PageImpl<BaseData>(poSchema.trans(pages.getRecords()), pageable, pages.getTotal());
} }
@Override @Override
...@@ -341,7 +341,7 @@ public class DbDataServiceImpl implements IDataService { ...@@ -341,7 +341,7 @@ public class DbDataServiceImpl implements IDataService {
DSLink link=dsSettingService.getDataSource(datasource); DSLink link=dsSettingService.getDataSource(datasource);
POSchema poSchema=model.getPOSchema(link.getType()); POSchema poSchema=model.getPOSchema(link.getType());
context.setPOSchema(poSchema); context.setPOSchema(poSchema);
return dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-dq-"+dataQuery+"-"),context,context.getSearchCond()); return poSchema.trans(dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-dq-"+dataQuery+"-"),context,context.getSearchCond()));
} }
@Override @Override
...@@ -357,7 +357,7 @@ public class DbDataServiceImpl implements IDataService { ...@@ -357,7 +357,7 @@ public class DbDataServiceImpl implements IDataService {
pageable=context.getPageable(); pageable=context.getPageable();
com.baomidou.mybatisplus.extension.plugins.pagination.Page<BaseData> pages= com.baomidou.mybatisplus.extension.plugins.pagination.Page<BaseData> pages=
dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-dq-"+dataQuery+"-"),context,context.getSearchCond(),context.getPages()); dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-dq-"+dataQuery+"-"),context,context.getSearchCond(),context.getPages());
return new PageImpl<BaseData>(pages.getRecords(), pageable, pages.getTotal()); return new PageImpl<BaseData>(poSchema.trans(pages.getRecords()), pageable, pages.getTotal());
} }
@Override @Override
...@@ -385,7 +385,7 @@ public class DbDataServiceImpl implements IDataService { ...@@ -385,7 +385,7 @@ public class DbDataServiceImpl implements IDataService {
DSLink link=dsSettingService.getDataSource(datasource); DSLink link=dsSettingService.getDataSource(datasource);
POSchema poSchema=model.getPOSchema(link.getType()); POSchema poSchema=model.getPOSchema(link.getType());
context.setPOSchema(poSchema); context.setPOSchema(poSchema);
return dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-ds-"+dataSet+"-"),context,context.getSearchCond()); return poSchema.trans(dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-ds-"+dataSet+"-"),context,context.getSearchCond()));
} }
@Override @Override
...@@ -401,7 +401,7 @@ public class DbDataServiceImpl implements IDataService { ...@@ -401,7 +401,7 @@ public class DbDataServiceImpl implements IDataService {
pageable=context.getPageable(); pageable=context.getPageable();
com.baomidou.mybatisplus.extension.plugins.pagination.Page<BaseData> pages= com.baomidou.mybatisplus.extension.plugins.pagination.Page<BaseData> pages=
dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-ds-"+dataSet+"-"),context,context.getSearchCond(),context.getPages()); dbDataMapper.queryData(link.getName(),poSchema,context.getSql("-ds-"+dataSet+"-"),context,context.getSearchCond(),context.getPages());
return new PageImpl<BaseData>(pages.getRecords(), pageable, pages.getTotal()); return new PageImpl<BaseData>(poSchema.trans(pages.getRecords()), pageable, pages.getTotal());
} }
@Override @Override
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</select> </select>
<select id="getBatchKey" parameterType="java.util.List" resultType="cn.ibizlab.core.data.dto.BaseData"> <select id="getBatchKey" parameterType="java.util.List" resultType="cn.ibizlab.core.data.dto.BaseData">
select <foreach collection="schema.keyMap" item="value" index="key" separator=",">${key}</foreach> from ${schema.name} t1 where select <foreach collection="schema.keyMap" item="value" index="key" separator=",">${key} as ${value}</foreach> from ${schema.name} t1 where
<if test="schema.logicValidColumn!=null"> <if test="schema.logicValidColumn!=null">
${schema.logicValidCond} and ${schema.logicValidCond} and
</if> </if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册