Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdata
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdata
提交
07ebbb1f
提交
07ebbb1f
编写于
3年前
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交,实体层编码结束
上级
b059a384
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
8 行删除
+19
-8
POSchema.java
...re/src/main/java/cn/ibizlab/core/data/model/POSchema.java
+11
-0
DbDataServiceImpl.java
.../cn/ibizlab/core/data/service/impl/DbDataServiceImpl.java
+7
-7
DbDataMapper.xml
...re/src/main/resources/mapper/data/DbData/DbDataMapper.xml
+1
-1
未找到文件。
ibzdata-core/src/main/java/cn/ibizlab/core/data/model/POSchema.java
浏览文件 @
07ebbb1f
...
@@ -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
)
{
{
...
...
This diff is collapsed.
Click to expand it.
ibzdata-core/src/main/java/cn/ibizlab/core/data/service/impl/DbDataServiceImpl.java
浏览文件 @
07ebbb1f
...
@@ -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
>(
p
ages
.
getRecords
(
),
pageable
,
pages
.
getTotal
());
return
new
PageImpl
<
BaseData
>(
p
oSchema
.
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
>(
p
ages
.
getRecords
(
),
pageable
,
pages
.
getTotal
());
return
new
PageImpl
<
BaseData
>(
p
oSchema
.
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
>(
p
ages
.
getRecords
(
),
pageable
,
pages
.
getTotal
());
return
new
PageImpl
<
BaseData
>(
p
oSchema
.
trans
(
pages
.
getRecords
()
),
pageable
,
pages
.
getTotal
());
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
ibzdata-core/src/main/resources/mapper/data/DbData/DbDataMapper.xml
浏览文件 @
07ebbb1f
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录