Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
huazheng-project-flink
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
huazheng
huazheng-project-flink
Commits
c74fb658
提交
c74fb658
authored
11月 11, 2020
作者:
think
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增afvc表
上级
e50d9b0f
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
301 行增加
和
166 行删除
+301
-166
HZDataStream.java
src/main/java/com/huazheng/project/HZDataStream.java
+25
-0
GPMapper.java
.../java/com/huazheng/project/greenplum/mapper/GPMapper.java
+10
-0
DeleteUpdateJobServiceImpl.java
...ct/greenplum/service/impl/DeleteUpdateJobServiceImpl.java
+46
-6
GPServiceImpl.java
...uazheng/project/greenplum/service/impl/GPServiceImpl.java
+27
-0
JobServiceImpl.java
...azheng/project/greenplum/service/impl/JobServiceImpl.java
+27
-0
AfvcSource.java
...om/huazheng/project/greenplum/source/hana/AfvcSource.java
+72
-0
BsadSource.java
...om/huazheng/project/greenplum/source/hana/BsadSource.java
+6
-5
BsidSource.java
...om/huazheng/project/greenplum/source/hana/BsidSource.java
+6
-5
SapMapper.java
...main/java/com/huazheng/project/hana/mapper/SapMapper.java
+3
-0
Afvc.java
src/main/java/com/huazheng/project/hana/model/Afvc.java
+33
-0
hana.sql
src/main/resources/devtools/dev/hana.sql
+4
-145
华正项目-数据库表设计20201107.xlsx
src/main/resources/devtools/doc/华正项目-数据库表设计20201107.xlsx
+0
-0
新建表.xlsx
src/main/resources/devtools/doc/新建表.xlsx
+0
-0
afvc.sql
src/main/resources/devtools/table/hana/afvc.sql
+11
-0
GPMapper_greenplum.xml
src/main/resources/mapper/greenplum/GPMapper_greenplum.xml
+19
-0
SapMapper_hana.xml
src/main/resources/mapper/hana/SapMapper_hana.xml
+12
-5
没有找到文件。
src/main/java/com/huazheng/project/HZDataStream.java
浏览文件 @
c74fb658
...
...
@@ -18,6 +18,7 @@ import com.huazheng.project.greenplum.richsink.GreenPlumRichSinkFunction;
import
com.huazheng.project.greenplum.service.impl.GPServiceImpl
;
import
com.huazheng.project.greenplum.source.hana.AfkoSource
;
import
com.huazheng.project.greenplum.source.hana.AfpoSource
;
import
com.huazheng.project.greenplum.source.hana.AfvcSource
;
import
com.huazheng.project.greenplum.source.hana.AufkSource
;
import
com.huazheng.project.greenplum.source.hana.AufmSource
;
import
com.huazheng.project.greenplum.source.hana.BsadSource
;
...
...
@@ -64,6 +65,7 @@ import com.huazheng.project.greenplum.source.mysql.TransformHistoryNodeSource;
import
com.huazheng.project.greenplum.source.mysql.TransformNewNodeSource
;
import
com.huazheng.project.hana.model.Afko
;
import
com.huazheng.project.hana.model.Afpo
;
import
com.huazheng.project.hana.model.Afvc
;
import
com.huazheng.project.hana.model.Aufk
;
import
com.huazheng.project.hana.model.Aufm
;
import
com.huazheng.project.hana.model.Bsad
;
...
...
@@ -190,6 +192,7 @@ redis-cli -n 1 --raw keys "huazheng*ikp*" | xargs redis-cli -n 1 del
private
static
T023tSource
t023tSource
;
private
static
Kna1Source
kna1Source
;
private
static
KnvvSource
knvvSource
;
private
static
AfvcSource
afvcSource
;
private
static
KnkkSource
knkkSource
;
private
static
MaraSource
maraSource
;
private
static
MaktSource
maktSource
;
...
...
@@ -251,6 +254,7 @@ redis-cli -n 1 --raw keys "huazheng*ikp*" | xargs redis-cli -n 1 del
t023tSource
=
(
T023tSource
)
context
.
getBean
(
"t023tSource"
);
kna1Source
=
(
Kna1Source
)
context
.
getBean
(
"kna1Source"
);
knvvSource
=
(
KnvvSource
)
context
.
getBean
(
"knvvSource"
);
afvcSource
=
(
AfvcSource
)
context
.
getBean
(
"afvcSource"
);
knkkSource
=
(
KnkkSource
)
context
.
getBean
(
"knkkSource"
);
maraSource
=
(
MaraSource
)
context
.
getBean
(
"maraSource"
);
maktSource
=
(
MaktSource
)
context
.
getBean
(
"maktSource"
);
...
...
@@ -676,6 +680,26 @@ redis-cli -n 1 --raw keys "huazheng*ikp*" | xargs redis-cli -n 1 del
}
}).
setParallelism
(
1
).
name
(
"拉取Knvv数据"
).
addSink
(
greenPlumRichSinkFunction
).
setParallelism
(
1
).
name
(
"输出Knvv数据"
);
// ================= AfvcSource 队列 =================
// DataStream<String> afvcRedis = env.addSource(afvcSource).setParallelism(1).name("输入AfvcSource队列");
// // 客户主记录销售数据
// afvcRedis.flatMap(new FlatMapFunction<String, Afvc>() {
// private static final long serialVersionUID = 1L;
//
// @Override
// public void flatMap(String value, Collector<Afvc> out) throws Exception {
// gpserviceImpl.processAfvc(value, out);
// }
// }).setParallelism(1).name("拉取Afvc数据").addSink(greenPlumRichSinkFunction).setParallelism(1).name("输出Afvc数据");
// ================= AfvcSource 队列 =================
// ================= KnkkSource 队列 =================
DataStream
<
String
>
knkkRedis
=
env
.
addSource
(
knkkSource
).
setParallelism
(
1
).
name
(
"输入KnkkSource队列"
);
// 客户主数据信贷管理控制范围数据
...
...
@@ -874,6 +898,7 @@ redis-cli -n 1 --raw keys "huazheng*ikp*" | xargs redis-cli -n 1 del
env
.
addSource
(
bsadSource
).
setParallelism
(
1
).
name
(
"输入bsad队列"
).
flatMap
(
greenPlumFlatMapFunction
).
returns
(
Bsad
.
class
).
setParallelism
(
1
).
name
(
"拉取Bsad数据"
).
addSink
(
greenPlumRichSinkFunction
).
setParallelism
(
1
).
name
(
"输出Bsad数据"
);
env
.
addSource
(
personCompSource
).
setParallelism
(
1
).
name
(
"输入PersonComp队列"
).
flatMap
(
greenPlumFlatMapFunction
).
returns
(
PersonComp
.
class
).
setParallelism
(
1
).
name
(
"拉取PersonComp数据"
).
addSink
(
greenPlumRichSinkFunction
).
setParallelism
(
1
).
name
(
"输出PersonComp数据"
);
env
.
addSource
(
afvcSource
).
setParallelism
(
1
).
name
(
"输入Afvc队列"
).
flatMap
(
greenPlumFlatMapFunction
).
returns
(
Afvc
.
class
).
setParallelism
(
1
).
name
(
"拉取Afvc数据"
).
addSink
(
greenPlumRichSinkFunction
).
setParallelism
(
1
).
name
(
"输出Afvc数据"
);
env
.
execute
(
"华正数据迁移任务"
);
}
...
...
src/main/java/com/huazheng/project/greenplum/mapper/GPMapper.java
浏览文件 @
c74fb658
...
...
@@ -10,6 +10,7 @@ import org.springframework.cache.annotation.Cacheable;
import
com.huazheng.project.hana.model.Afko
;
import
com.huazheng.project.hana.model.Afpo
;
import
com.huazheng.project.hana.model.Afvc
;
import
com.huazheng.project.hana.model.Aufk
;
import
com.huazheng.project.hana.model.Aufm
;
import
com.huazheng.project.hana.model.Bsad
;
...
...
@@ -127,6 +128,15 @@ public interface GPMapper {
public
void
updateKnvv
(
Knvv
element
);
public
List
<
Knvv
>
selectKnvvCheck
(
Knvv
build
);
@Cacheable
(
key
=
"#root.method.name+':'+#p0.mandt+','+#p0.aufpl+','+#p0.aplzl"
,
unless
=
"#result == null"
)
public
Afvc
selectAfvc
(
Afvc
afvc
);
// 查询替代删除
public
void
insertAfvc
(
Afvc
element
);
@CacheEvict
(
key
=
"'selectAfvc'+':'+#p0.mandt+','+#p0.aufpl+','+#p0.aplzl"
)
public
void
deleteAfvc
(
Afvc
item
);
@CacheEvict
(
key
=
"'selectAfvc'+':'+#p0.mandt+','+#p0.aufpl+','+#p0.aplzl"
)
public
void
updateAfvc
(
Afvc
element
);
public
List
<
Afvc
>
selectAfvcCheck
(
Afvc
build
);
@Cacheable
(
key
=
"#root.method.name+':'+#p0.mandt+','+#p0.knumv+','+#p0.kposn+','+#p0.stunr+','+#p0.zaehk"
,
unless
=
"#result == null"
)
public
Konv
selectKonv
(
Konv
konv
);
// 查询替代删除
public
void
insertKonv
(
Konv
element
);
...
...
src/main/java/com/huazheng/project/greenplum/service/impl/DeleteUpdateJobServiceImpl.java
浏览文件 @
c74fb658
...
...
@@ -18,6 +18,7 @@ import com.huazheng.project.greenplum.mapper.GPMapper;
import
com.huazheng.project.hana.mapper.SapMapper
;
import
com.huazheng.project.hana.model.Afko
;
import
com.huazheng.project.hana.model.Afpo
;
import
com.huazheng.project.hana.model.Afvc
;
import
com.huazheng.project.hana.model.Aufk
;
import
com.huazheng.project.hana.model.Aufm
;
import
com.huazheng.project.hana.model.Bsad
;
...
...
@@ -954,6 +955,7 @@ public class DeleteUpdateJobServiceImpl {
selectZsd06Check
();
// 39
selectZsdfhzlCheck
();
// 40
selectTvkbtCheck
();
//
selectAfvcCheck
();
}
private
void
selectAfkoCheck
()
{
try
{
...
...
@@ -1103,6 +1105,7 @@ public class DeleteUpdateJobServiceImpl {
redis1Template
.
opsForValue
().
set
(
"huazheng:checkError:Aufk:rowNum"
,
getErrorInfoFromException
(
e
));
}
}
// 数据量过大不再执行任务
private
void
selectAufmCheck
()
{
try
{
ValueOperations
<
String
,
String
>
opsForValue
=
redis1Template
.
opsForValue
();
...
...
@@ -1331,6 +1334,49 @@ public class DeleteUpdateJobServiceImpl {
redis1Template
.
opsForValue
().
set
(
"huazheng:checkError:Knvv:rowNum"
,
getErrorInfoFromException
(
e
));
}
}
private
void
selectAfvcCheck
()
{
try
{
ValueOperations
<
String
,
String
>
opsForValue
=
redis1Template
.
opsForValue
();
opsForValue
.
setIfAbsent
(
"huazheng:check:Afvc:rowNum"
,
"0"
);
String
rowNum
=
opsForValue
.
get
(
"huazheng:check:Afvc:rowNum"
);
Afvc
build
=
Afvc
.
builder
().
rowNum
(
rowNum
).
build
();
List
<
Afvc
>
list
=
gpMapper
.
selectAfvcCheck
(
build
);
// 从数仓中查询一组数据
if
(
list
.
size
()
==
0
)
{
redis1Template
.
opsForValue
().
set
(
"huazheng:check:Afvc:rowNum"
,
"0"
);
// 计数器复位
ThreadUtil
.
sleep
(
1000
);
// 没有数据了,休眠一下
}
list
.
forEach
(
target
->
{
// 遍历要检查的数据
Afvc
source
=
sapMapper
.
selectAfvcById
(
target
);
// 根据主键查询源库中的数据
String
operator
=
"none"
;
if
(
source
==
null
)
{
// 如果源库中没有数据
gpMapper
.
deleteAfvc
(
target
);
// 删除数仓中的数据
operator
=
"delete"
;
}
else
{
// 源库中有数据
String
shash
=
SecureUtil
.
md5
(
JSONUtil
.
toJsonStr
(
source
));
// 源库中数据的hash结果
String
thash
=
target
.
getHashResult
();
// 数仓中数据的hash结果
if
(!
shash
.
equals
(
thash
))
{
// 如果hash结果不一致
source
.
setHashResult
(
shash
);
while
(
true
)
{
try
{
gpMapper
.
updateAfvc
(
source
);
// 更新数据到数仓中
break
;
}
catch
(
RuntimeException
e
)
{
log
.
error
(
e
.
getMessage
());
ThreadUtil
.
safeSleep
(
500
);
}
}
ThreadUtil
.
safeSleep
(
500
);
}
}
redis1Template
.
opsForValue
().
set
(
"huazheng:check:Afvc:rowNum"
,
target
.
getRowNum
());
if
(!
operator
.
equals
(
"none"
))
{
log
.
info
(
String
.
format
(
"selectAfvcCheck --> rowNum:%s, operator:%s"
,
target
.
getRowNum
(),
operator
));
}
});
}
catch
(
Exception
e
)
{
redis1Template
.
opsForValue
().
set
(
"huazheng:checkError:Afvc:rowNum"
,
getErrorInfoFromException
(
e
));
}
}
// 数据量过大不再执行任务
private
void
selectKonvCheck
()
{
try
{
ValueOperations
<
String
,
String
>
opsForValue
=
redis1Template
.
opsForValue
();
...
...
@@ -2702,15 +2748,12 @@ public class DeleteUpdateJobServiceImpl {
}
list
.
forEach
(
target
->
{
// 遍历要检查的数据
Vbap
source
=
sapMapper
.
selectVbapById
(
target
);
// 根据主键查询源库中的数据
log
.
info
(
"=========== vbap ===== list"
+
source
.
getVbeln
());
String
operator
=
"none"
;
if
(
source
==
null
)
{
// 如果源库中没有数据
log
.
info
(
"=========== vbap ===== delete"
+
target
.
getVbeln
());
gpMapper
.
deleteVbap
(
target
);
// 删除数仓中的数据
gpMapper
.
deleteVbapAdv
(
target
);
operator
=
"delete"
;
}
else
{
// 源库中有数据
log
.
info
(
"=========== vbap ===== update"
+
source
.
getVbeln
());
String
shash
=
SecureUtil
.
md5
(
JSONUtil
.
toJsonStr
(
source
));
// 源库中数据的hash结果
String
thash
=
target
.
getHashResult
();
// 数仓中数据的hash结果
if
(!
shash
.
equals
(
thash
))
{
// 如果hash结果不一致
...
...
@@ -2727,7 +2770,6 @@ public class DeleteUpdateJobServiceImpl {
// ===============================
while
(
true
)
{
try
{
log
.
info
(
"=========== vbap ===== while"
+
source
.
getVbeln
());
gpMapper
.
updateVbap
(
source
);
// 更新数据到数仓中
gpMapper
.
updateVbapAdv
(
source
);
break
;
...
...
@@ -2786,7 +2828,6 @@ public class DeleteUpdateJobServiceImpl {
vbapAdv
.
setHtsl
(
source
.
getKwmeng
());
vbapAdv
.
setPssj
(
source
.
getErdat1
());
vbapAdv
.
setPcsj
(
source
.
getErdat1
());
log
.
info
(
"=========== vbap ===== updatevbapAdv4CaAll"
+
source
.
getVbeln
());
gpMapper
.
updatevbapAdv4CaAll
(
vbapAdv
);
// Future<String> s1 = service.submit(() -> {
...
...
@@ -2904,7 +2945,6 @@ public class DeleteUpdateJobServiceImpl {
}
}
}
log
.
info
(
"=========== vbap ===== set"
);
String
mode
=
null
;
String
isUpdateList
=
opsForValue
.
get
(
"huazheng:check:Vbap:isUpdateList"
);
if
(
isUpdateList
==
null
)
{
// 非更新模式下的列表才更新计数器
...
...
src/main/java/com/huazheng/project/greenplum/service/impl/GPServiceImpl.java
浏览文件 @
c74fb658
...
...
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import
com.huazheng.project.greenplum.mapper.GPMapper
;
import
com.huazheng.project.hana.model.Afko
;
import
com.huazheng.project.hana.model.Afpo
;
import
com.huazheng.project.hana.model.Afvc
;
import
com.huazheng.project.hana.model.Aufk
;
import
com.huazheng.project.hana.model.Aufm
;
import
com.huazheng.project.hana.model.Bsad
;
...
...
@@ -1944,5 +1945,31 @@ public class GPServiceImpl {
log
.
error
(
e
.
getMessage
());
}
}
public
void
processAfvc
(
Afvc
data
,
Collector
<
Afvc
>
out
)
{
try
{
Afvc
exist
=
gpMapper
.
selectAfvc
(
data
);
if
(
exist
!=
null
)
{
data
.
setExist
(
true
);
// 已经在库
}
out
.
collect
(
data
);
}
catch
(
Exception
e
)
{
redis1Template
.
opsForHash
().
put
(
"huazheng:Afvc:error"
,
"processAfvc"
,
getErrorInfoFromException
(
e
));
log
.
error
(
e
.
getMessage
());
}
}
public
void
sinkAfvc
(
Afvc
element
)
{
try
{
if
(
element
.
isExist
()
==
false
)
{
log
.
debug
(
"GPServiceImpl.sinkAfvc()"
);
gpMapper
.
insertAfvc
(
element
);
}
}
catch
(
RuntimeException
e
)
{
redis1Template
.
opsForHash
().
put
(
"huazheng:Afvc:error"
,
"sinkAfvc"
,
getErrorInfoFromException
(
e
));
log
.
error
(
e
.
getMessage
());
}
catch
(
Exception
e
)
{
redis1Template
.
opsForHash
().
put
(
"huazheng:Afvc:error"
,
"sinkAfvc"
,
getErrorInfoFromException
(
e
));
log
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/com/huazheng/project/greenplum/service/impl/JobServiceImpl.java
浏览文件 @
c74fb658
...
...
@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import
com.huazheng.project.hana.mapper.SapMapper
;
import
com.huazheng.project.hana.model.Afko
;
import
com.huazheng.project.hana.model.Afpo
;
import
com.huazheng.project.hana.model.Afvc
;
import
com.huazheng.project.hana.model.Aufk
;
import
com.huazheng.project.hana.model.Aufm
;
import
com.huazheng.project.hana.model.Bsad
;
...
...
@@ -120,6 +121,7 @@ public class JobServiceImpl {
selectLipsNew
();
selectAfkoNew
();
selectAfpoNew
();
selectAfvcNew
();
selectVbepNew
();
selectT023tNew
();
selectKna1New
();
...
...
@@ -535,6 +537,31 @@ public class JobServiceImpl {
}
}
}
private
void
selectAfvcNew
()
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
script
.
setScriptSource
(
new
ResourceScriptSource
(
new
ClassPathResource
(
"luascript/vbap4send.lua"
)));
List
<
String
>
keys
=
Arrays
.
asList
(
"huazheng:Afvc:sendcount"
,
"huazheng:Afvc:rowids"
,
"huazheng:list:Afvc"
);
ValueOperations
<
String
,
String
>
opsForValue
=
redis1Template
.
opsForValue
();
opsForValue
.
setIfAbsent
(
"huazheng:Afvc:sendcount"
,
"0"
);
// 不存在则创建,存在则么有操作
opsForValue
.
setIfAbsent
(
"huazheng:Afvc:receivecount"
,
"0"
);
// 不存在则创建,存在则么有操作
opsForValue
.
setIfAbsent
(
"huazheng:Afvc:rowids"
,
"0"
);
// 不存在则创建,存在则么有操作
Long
sendcount
=
Long
.
valueOf
(
opsForValue
.
get
(
"huazheng:Afvc:sendcount"
));
Long
receivecount
=
Long
.
valueOf
(
opsForValue
.
get
(
"huazheng:Afvc:receivecount"
));
if
(
sendcount
-
receivecount
<=
20
)
{
// 如果发送数和消费数的差小于5则往队列中写数据
String
rowids
=
opsForValue
.
get
(
"huazheng:Afvc:rowids"
);
// 标记id
Afvc
afvc
=
Afvc
.
builder
().
rowids
(
Long
.
valueOf
(
rowids
)).
build
();
List
<
Afvc
>
list
=
sapMapper
.
selectAfvcNew
(
afvc
);
if
(!
list
.
isEmpty
())
{
list
.
forEach
(
item
->
{
JSONObject
json
=
JSONUtil
.
parseObj
(
item
,
false
);
String
execute
=
redis1Template
.
execute
(
script
,
keys
,
item
.
getRowids
().
toString
(),
json
.
toString
());
log
.
info
(
"标记时间回写 --> "
+
execute
);
});
}
}
}
private
void
selectAfpoNew
()
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
...
...
src/main/java/com/huazheng/project/greenplum/source/hana/AfvcSource.java
0 → 100644
浏览文件 @
c74fb658
package
com
.
huazheng
.
project
.
greenplum
.
source
.
hana
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.apache.flink.streaming.api.functions.source.SourceFunction
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.data.redis.core.script.DefaultRedisScript
;
import
org.springframework.scripting.support.ResourceScriptSource
;
import
org.springframework.stereotype.Service
;
import
com.huazheng.project.HZDataStream
;
import
com.huazheng.project.hana.model.Afvc
;
import
cn.hutool.core.thread.ThreadUtil
;
import
cn.hutool.json.JSONUtil
;
import
lombok.extern.log4j.Log4j2
;
@Log4j2
@Service
public
class
AfvcSource
implements
SourceFunction
<
Afvc
>
{
private
static
final
long
serialVersionUID
=
1L
;
public
String
getErrorInfoFromException
(
Exception
e
)
{
try
{
StringWriter
sw
=
new
StringWriter
();
PrintWriter
pw
=
new
PrintWriter
(
sw
);
e
.
printStackTrace
(
pw
);
return
"\r\n"
+
sw
.
toString
()
+
"\r\n"
;
}
catch
(
Exception
e2
)
{
return
"bad getErrorInfoFromException"
;
}
}
@Override
public
void
run
(
SourceContext
<
Afvc
>
ctx
)
throws
Exception
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
script
.
setScriptSource
(
new
ResourceScriptSource
(
new
ClassPathResource
(
"luascript/vbap.lua"
)));
List
<
String
>
keys
=
Arrays
.
asList
(
"huazheng:Afvc:sendcount"
,
"huazheng:Afvc:id"
,
"huazheng:list:Afvc"
,
"huazheng:Afvc:receivecount"
);
while
(
true
)
{
try
{
String
value
=
HZDataStream
.
redis1Template
.
execute
(
script
,
keys
,
""
);
String
[]
values
=
value
.
toString
().
split
(
"=========="
);
String
checkString
=
values
[
0
];
String
[]
split
=
checkString
.
split
(
", "
);
boolean
check
=
split
[
0
].
split
(
":"
)[
1
].
equals
(
split
[
1
].
split
(
":"
)[
1
]);
if
(
values
.
length
>
1
)
{
// 有数据字符串
// log.info(msg + " " + value.toString() + " " + check);
log
.
info
(
checkString
+
" "
+
check
);
Afvc
data
=
JSONUtil
.
toBean
(
values
[
1
],
Afvc
.
class
);
ctx
.
collect
(
data
);
}
else
{
// 没有数据字符串
ThreadUtil
.
sleep
(
1000
);
// 没有数据了,休眠一下
}
}
catch
(
Exception
e
)
{
HZDataStream
.
redis1Template
.
opsForHash
().
put
(
"huazheng:Afvc:error"
,
"receivecount_elseerror"
,
getErrorInfoFromException
(
e
));
}
}
}
@Override
public
void
cancel
()
{
}
}
src/main/java/com/huazheng/project/greenplum/source/hana/BsadSource.java
浏览文件 @
c74fb658
...
...
@@ -5,7 +5,6 @@ import java.io.StringWriter;
import
java.util.Arrays
;
import
java.util.List
;
import
org.apache.flink.streaming.api.functions.source.SourceFunction
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.data.redis.core.script.DefaultRedisScript
;
...
...
@@ -13,14 +12,15 @@ import org.springframework.scripting.support.ResourceScriptSource;
import
org.springframework.stereotype.Service
;
import
com.huazheng.project.HZDataStream
;
import
com.huazheng.project.hana.model.Bsad
;
import
cn.hutool.core.thread.ThreadUtil
;
import
cn.hutool.json.JSONUtil
;
import
lombok.extern.log4j.Log4j2
;
@Log4j2
@Service
public
class
BsadSource
implements
SourceFunction
<
String
>
{
public
class
BsadSource
implements
SourceFunction
<
Bsad
>
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -38,7 +38,7 @@ public class BsadSource implements SourceFunction<String> {
}
@Override
public
void
run
(
SourceContext
<
String
>
ctx
)
throws
Exception
{
public
void
run
(
SourceContext
<
Bsad
>
ctx
)
throws
Exception
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
script
.
setScriptSource
(
new
ResourceScriptSource
(
new
ClassPathResource
(
"luascript/vbap.lua"
)));
...
...
@@ -53,7 +53,8 @@ public class BsadSource implements SourceFunction<String> {
if
(
values
.
length
>
1
)
{
// 有数据字符串
// log.info(msg + " " + value.toString() + " " + check);
log
.
info
(
checkString
+
" "
+
check
);
ctx
.
collect
(
values
[
1
]);
Bsad
data
=
JSONUtil
.
toBean
(
values
[
1
],
Bsad
.
class
);
ctx
.
collect
(
data
);
}
else
{
// 没有数据字符串
ThreadUtil
.
sleep
(
1000
);
// 没有数据了,休眠一下
}
...
...
src/main/java/com/huazheng/project/greenplum/source/hana/BsidSource.java
浏览文件 @
c74fb658
...
...
@@ -5,7 +5,6 @@ import java.io.StringWriter;
import
java.util.Arrays
;
import
java.util.List
;
import
org.apache.flink.streaming.api.functions.source.SourceFunction
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.data.redis.core.script.DefaultRedisScript
;
...
...
@@ -13,14 +12,15 @@ import org.springframework.scripting.support.ResourceScriptSource;
import
org.springframework.stereotype.Service
;
import
com.huazheng.project.HZDataStream
;
import
com.huazheng.project.hana.model.Bsid
;
import
cn.hutool.core.thread.ThreadUtil
;
import
cn.hutool.json.JSONUtil
;
import
lombok.extern.log4j.Log4j2
;
@Log4j2
@Service
public
class
BsidSource
implements
SourceFunction
<
String
>
{
public
class
BsidSource
implements
SourceFunction
<
Bsid
>
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -38,7 +38,7 @@ public class BsidSource implements SourceFunction<String> {
}
@Override
public
void
run
(
SourceContext
<
String
>
ctx
)
throws
Exception
{
public
void
run
(
SourceContext
<
Bsid
>
ctx
)
throws
Exception
{
DefaultRedisScript
<
String
>
script
=
new
DefaultRedisScript
<
String
>();
script
.
setResultType
(
String
.
class
);
script
.
setScriptSource
(
new
ResourceScriptSource
(
new
ClassPathResource
(
"luascript/vbap.lua"
)));
...
...
@@ -53,7 +53,8 @@ public class BsidSource implements SourceFunction<String> {
if
(
values
.
length
>
1
)
{
// 有数据字符串
// log.info(msg + " " + value.toString() + " " + check);
log
.
info
(
checkString
+
" "
+
check
);
ctx
.
collect
(
values
[
1
]);
Bsid
data
=
JSONUtil
.
toBean
(
values
[
1
],
Bsid
.
class
);
ctx
.
collect
(
data
);
}
else
{
// 没有数据字符串
ThreadUtil
.
sleep
(
1000
);
// 没有数据了,休眠一下
}
...
...
src/main/java/com/huazheng/project/hana/mapper/SapMapper.java
浏览文件 @
c74fb658
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
com.huazheng.project.hana.model.Afko
;
import
com.huazheng.project.hana.model.Afpo
;
import
com.huazheng.project.hana.model.Afvc
;
import
com.huazheng.project.hana.model.Aufk
;
import
com.huazheng.project.hana.model.Aufm
;
import
com.huazheng.project.hana.model.Bsad
;
...
...
@@ -53,6 +54,7 @@ public interface SapMapper {
public
List
<
Lips
>
selectLipsNew
(
Lips
lips
);
public
List
<
Afko
>
selectAfkoNew
(
Afko
afko
);
public
List
<
Afpo
>
selectAfpoNew
(
Afpo
afpo
);
public
List
<
Afvc
>
selectAfvcNew
(
Afvc
afvc
);
public
List
<
Vbep
>
selectVbepNew
(
Vbep
vbep
);
public
List
<
T023t
>
selectT023tNew
(
T023t
t023t
);
public
List
<
Kna1
>
selectKna1New
(
Kna1
kna1
);
...
...
@@ -70,6 +72,7 @@ public interface SapMapper {
public
Afko
selectAfkoById
(
Afko
target
);
public
Afpo
selectAfpoById
(
Afpo
target
);
public
Afvc
selectAfvcById
(
Afvc
target
);
public
Aufk
selectAufkById
(
Aufk
target
);
public
Aufm
selectAufmById
(
Aufm
target
);
public
Kna1
selectKna1ById
(
Kna1
target
);
...
...
src/main/java/com/huazheng/project/hana/model/Afvc.java
0 → 100644
浏览文件 @
c74fb658
package
com
.
huazheng
.
project
.
hana
.
model
;
import
java.io.Serializable
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors
(
chain
=
true
)
@Builder
public
class
Afvc
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/* === 组合键 === */
private
String
mandt
;
// 集团
private
String
aufpl
;
// 订单中工序的工艺路线号
private
String
aplzl
;
// 订单的通用计数器
/* === 组合键 === */
private
String
steus
;
// 控制码
private
Long
rowids
;
// sap那边的rowid
private
boolean
exist
;
// 用于标记,不是字段
private
String
hashResult
;
// 数据hash标记
private
String
rowNum
;
// 用于标记,不是字段
}
src/main/resources/devtools/dev/hana.sql
浏览文件 @
c74fb658
select
top
20
"$rowid$"
as
rowids
,
vbeln
,
mandt
,
erdat
,
wadat_ist
,
ctlpc
,
kunnr
,
aedat
,
lfuhr
,
case
wadat_ist
when
'00000000'
then
null
else
(
to_date
(
wadat_ist
)
||
' '
||
to_time
(
lfuhr
))
end
as
wadat_ist2lfuhr
from
sapabap1
.
likp
where
wadat_ist
=
'00000000'
;
select
top
10
a
.
vbeln
,
a
.
mandt
,
a
.
vbtyp
,
a
.
audat
,
a
.
waerk
,
a
.
kalsm
,
a
.
ctlpc
,
a
.
kunnr
,
a
.
bukrs_vf
,
a
.
bstnk
,
a
.
bname
,
a
.
telf1
,
a
.
netwr
,
a
.
vkbur
,
a
.
knumv
,
a
.
vkorg
,
a
.
vtweg
,
a
.
kkber
,
a
.
auart
,
a
.
aedat
,
b
.
pernr
,
case
a
.
erdat
when
'00000000'
then
null
else
(
to_date
(
a
.
erdat
)
||
' '
||
to_time
(
a
.
erzet
))
end
as
erdat2erzet
from
sapabap1
.
vbak
a
left
join
(
select
q
.
vbeln
,
q
.
posnr
,
r
.
pernr
from
sapabap1
.
vbap
q
left
join
(
select
vbeln
,
posnr
,
pernr
from
sapabap1
.
vbpa
where
mandt
=
'800'
and
pernr
!=
'00000000'
group
by
vbeln
,
posnr
,
pernr
)
r
on
q
.
vbeln
=
r
.
vbeln
and
q
.
posnr
=
r
.
posnr
where
q
.
mandt
=
'800'
)
b
on
a
.
vbeln
=
b
.
vbeln
where
a
.
mandt
=
'800'
and
a
.
erdat
=
'00000000'
select
a
.
vbeln
,
a
.
mandt
,
a
.
vbtyp
,
a
.
audat
,
a
.
waerk
,
a
.
kalsm
,
a
.
ctlpc
,
a
.
kunnr
,
a
.
bukrs_vf
,
a
.
bstnk
,
a
.
bname
,
a
.
telf1
,
a
.
netwr
,
a
.
vkbur
,
a
.
knumv
,
a
.
vkorg
,
a
.
vtweg
,
a
.
kkber
,
a
.
auart
,
a
.
aedat
,
b
.
pernr
,
case
a
.
erdat
when
'00000000'
then
null
else
(
to_date
(
a
.
erdat
)
||
' '
||
to_time
(
a
.
erzet
))
end
as
erdat2erzet
,
a
.
erdat
,
a
.
erzet
from
sapabap1
.
vbak
a
left
join
(
select
q
.
vbeln
,
r
.
pernr
from
sapabap1
.
vbap
q
left
join
(
select
vbeln
,
posnr
,
pernr
from
sapabap1
.
vbpa
where
mandt
=
'800'
and
pernr
!=
'00000000'
group
by
vbeln
,
posnr
,
pernr
)
r
on
q
.
vbeln
=
r
.
vbeln
and
q
.
posnr
=
r
.
posnr
where
q
.
mandt
=
'800'
group
by
q
.
vbeln
,
r
.
pernr
)
b
on
a
.
vbeln
=
b
.
vbeln
where
a
.
vbeln
=
'0010042311'
and
a
.
mandt
=
'800'
----
select
a
.
vbeln
,
a
.
mandt
,
a
.
vbtyp
,
a
.
audat
,
a
.
waerk
,
a
.
kalsm
,
a
.
ctlpc
,
a
.
kunnr
,
a
.
bukrs_vf
,
a
.
bstnk
,
a
.
bname
,
a
.
telf1
,
a
.
netwr
,
a
.
vkbur
,
a
.
knumv
,
a
.
vkorg
,
a
.
vtweg
,
a
.
kkber
,
a
.
auart
,
a
.
aedat
,
b
.
pernr
,
case
a
.
erdat
when
'00000000'
then
null
else
(
to_date
(
a
.
erdat
)
||
' '
||
to_time
(
a
.
erzet
))
end
as
erdat2erzet
,
a
.
erdat
,
a
.
erzet
from
sapabap1
.
vbak
a
left
join
(
select
q
.
vbeln
,
r
.
pernr
from
sapabap1
.
vbap
q
left
join
(
select
vbeln
,
posnr
,
pernr
from
sapabap1
.
vbpa
where
mandt
=
'800'
and
pernr
!=
'00000000'
group
by
vbeln
,
posnr
,
pernr
)
r
on
q
.
vbeln
=
r
.
vbeln
and
q
.
posnr
=
r
.
posnr
where
q
.
mandt
=
'800'
and
r
.
pernr
is
not
null
group
by
q
.
vbeln
,
r
.
pernr
)
b
on
a
.
vbeln
=
b
.
vbeln
where
a
.
vbeln
=
'0010009580'
and
a
.
mandt
=
'800'
----------------------------
select
p
.
vbeln
,
p
.
posnr
,
p
.
matnr
,
p
.
mandt
,
p
.
matkl
,
p
.
spart
,
p
.
kwmeng
,
p
.
netwr
,
p
.
mwsbp
,
p
.
waerk
,
p
.
vrkme
,
p
.
abgru
,
p
.
uebto
,
p
.
untto
,
p
.
werks
,
p
.
vstel
,
p
.
mvgr1
,
p
.
plavo
,
p
.
mvgr4
,
p
.
mvgr5
,
p
.
ulxh
,
p
.
zma_ftb_02
,
p
.
zma_ftb_03
,
p
.
zma_ftb_45
,
p
.
zma_ftb_06
,
p
.
zma_ftb_07
,
p
.
zma_ftb_08
,
p
.
zma_jyb_02
,
p
.
zma_jyb_03
,
p
.
zma_jyb_45
,
p
.
zma_jyb_06
,
p
.
zma_jyb_07
,
p
.
zma_ljb_03
,
p
.
zma_ljb_04
,
p
.
zma_ljb_06
,
p
.
zma_ljb_07
,
p
.
zma_ljb_08
,
p
.
zma_ljb_11
,
p
.
zma_ljb_12
,
p
.
zma_ljb_13
,
p
.
zma_yhbg_02
,
p
.
zma_yhbg_04
,
p
.
zma_yhbg_05
,
p
.
zma_yhbg_06
,
p
.
tbpz
,
p
.
ws
,
p
.
cu_maktx
,
p
.
cu_pcdst
,
p
.
ztype
,
p
.
barcode
,
p
.
gdno
,
p
.
lh
,
p
.
dgxx
,
p
.
zklx
,
p
.
erdat
,
p
.
erzet
,
p
.
netpr
,
p
.
aedat
,
q
.
pernr
from
sapabap1
.
vbap
p
left
join
(
select
a
.
vbeln
,
b
.
posnr
,
b
.
pernr
from
sapabap1
.
vbak
a
left
join
()
b
on
a
.
vbeln
=
b
.
vbeln
where
b
.
pernr
is
not
null
and
a
.
mandt
=
'800'
and
a
.
vbeln
=
'0010041154'
group
by
a
.
vbeln
,
b
.
posnr
,
b
.
pernr
)
q
on
p
.
vbeln
=
q
.
vbeln
where
p
.
vbeln
=
'0010041154'
and
p
.
posnr
=
'000010'
and
p
.
mandt
=
'800'
and
p
.
erdat
=
'20190606'
;
select
p
.
vbeln
,
p
.
posnr
,
p
.
matnr
,
p
.
mandt
,
p
.
matkl
,
p
.
spart
,
p
.
kwmeng
,
p
.
netwr
,
p
.
mwsbp
,
p
.
waerk
,
p
.
vrkme
,
p
.
abgru
,
p
.
uebto
,
p
.
untto
,
p
.
werks
,
p
.
vstel
,
p
.
mvgr1
,
p
.
plavo
,
p
.
mvgr4
,
p
.
mvgr5
,
p
.
ulxh
,
p
.
zma_ftb_02
,
p
.
zma_ftb_03
,
p
.
zma_ftb_45
,
p
.
zma_ftb_06
,
p
.
zma_ftb_07
,
p
.
zma_ftb_08
,
p
.
zma_jyb_02
,
p
.
zma_jyb_03
,
p
.
zma_jyb_45
,
p
.
zma_jyb_06
,
p
.
zma_jyb_07
,
p
.
zma_ljb_03
,
p
.
zma_ljb_04
,
p
.
zma_ljb_06
,
p
.
zma_ljb_07
,
p
.
zma_ljb_08
,
p
.
zma_ljb_11
,
p
.
zma_ljb_12
,
p
.
zma_ljb_13
,
p
.
zma_yhbg_02
,
p
.
zma_yhbg_04
,
p
.
zma_yhbg_05
,
p
.
zma_yhbg_06
,
p
.
tbpz
,
p
.
ws
,
p
.
cu_maktx
,
p
.
cu_pcdst
,
p
.
ztype
,
p
.
barcode
,
p
.
gdno
,
p
.
lh
,
p
.
dgxx
,
p
.
zklx
,
p
.
erdat
,
p
.
erzet
,
p
.
netpr
,
p
.
aedat
,
q
.
pernr
from
sapabap1
.
vbap
p
left
join
(
select
a
.
vbeln
,
a
.
posnr
,
a
.
pernr
from
sapabap1
.
vbpa
a
left
join
sapabap1
.
vbak
b
on
a
.
vbeln
=
b
.
vbeln
where
a
.
mandt
=
'800'
and
a
.
pernr
!=
'00000000'
group
by
a
.
vbeln
,
a
.
posnr
,
a
.
pernr
)
q
on
p
.
vbeln
=
q
.
vbeln
and
p
.
posnr
=
q
.
posnr
where
p
.
vbeln
=
'0010041154'
and
p
.
posnr
=
'000010'
and
p
.
mandt
=
'800'
and
p
.
erdat
=
'20190606'
;
select
p
.
vbeln
,
p
.
posnr
,
p
.
matnr
,
p
.
mandt
,
p
.
matkl
,
p
.
spart
,
p
.
kwmeng
,
p
.
netwr
,
p
.
mwsbp
,
p
.
waerk
,
p
.
vrkme
,
p
.
abgru
,
p
.
uebto
,
p
.
untto
,
p
.
werks
,
p
.
vstel
,
p
.
mvgr1
,
p
.
plavo
,
p
.
mvgr4
,
p
.
mvgr5
,
p
.
ulxh
,
p
.
zma_ftb_02
,
p
.
zma_ftb_03
,
p
.
zma_ftb_45
,
p
.
zma_ftb_06
,
p
.
zma_ftb_07
,
p
.
zma_ftb_08
,
p
.
zma_jyb_02
,
p
.
zma_jyb_03
,
p
.
zma_jyb_45
,
p
.
zma_jyb_06
,
p
.
zma_jyb_07
,
p
.
zma_ljb_03
,
p
.
zma_ljb_04
,
p
.
zma_ljb_06
,
p
.
zma_ljb_07
,
p
.
zma_ljb_08
,
p
.
zma_ljb_11
,
p
.
zma_ljb_12
,
p
.
zma_ljb_13
,
p
.
zma_yhbg_02
,
p
.
zma_yhbg_04
,
p
.
zma_yhbg_05
,
p
.
zma_yhbg_06
,
p
.
tbpz
,
p
.
ws
,
p
.
cu_maktx
,
p
.
cu_pcdst
,
p
.
ztype
,
p
.
barcode
,
p
.
gdno
,
p
.
lh
,
p
.
dgxx
,
p
.
zklx
,
p
.
erdat
,
p
.
erzet
,
p
.
netpr
,
p
.
aedat
,
q
.
pernr
from
${
hana_user
}
.
vbap
p
left
join
(
select
a
.
vbeln
,
a
.
posnr
,
a
.
pernr
from
${
hana_user
}
.
vbpa
a
left
join
${
hana_user
}
.
vbak
b
on
a
.
vbeln
=
b
.
vbeln
where
a
.
mandt
=
#
{
mandt
}
and
a
.
pernr
!=
'00000000'
group
by
a
.
vbeln
,
a
.
posnr
,
a
.
pernr
)
q
on
p
.
vbeln
=
q
.
vbeln
and
p
.
posnr
=
q
.
posnr
where
p
.
vbeln
=
#
{
vbeln
}
and
p
.
posnr
=
#
{
posnr
}
and
p
.
mandt
=
#
{
mandt
}
and
p
.
erdat
=
#
{
erdat
}
select
top
20
"$rowid$"
as
rowids
,
p
.
vbeln
,
p
.
posnr
,
p
.
matnr
,
p
.
mandt
,
p
.
matkl
,
p
.
spart
,
p
.
kwmeng
,
p
.
netwr
,
p
.
mwsbp
,
p
.
waerk
,
p
.
vrkme
,
p
.
abgru
,
p
.
uebto
,
p
.
untto
,
p
.
werks
,
p
.
vstel
,
p
.
mvgr1
,
p
.
plavo
,
p
.
mvgr4
,
p
.
mvgr5
,
p
.
ulxh
,
p
.
zma_ftb_02
,
p
.
zma_ftb_03
,
p
.
zma_ftb_45
,
p
.
zma_ftb_06
,
p
.
zma_ftb_07
,
p
.
zma_ftb_08
,
p
.
zma_jyb_02
,
p
.
zma_jyb_03
,
p
.
zma_jyb_45
,
p
.
zma_jyb_06
,
p
.
zma_jyb_07
,
p
.
zma_ljb_03
,
p
.
zma_ljb_04
,
p
.
zma_ljb_06
,
p
.
zma_ljb_07
,
p
.
zma_ljb_08
,
p
.
zma_ljb_11
,
p
.
zma_ljb_12
,
p
.
zma_ljb_13
,
p
.
zma_yhbg_02
,
p
.
zma_yhbg_04
,
p
.
zma_yhbg_05
,
p
.
zma_yhbg_06
,
p
.
tbpz
,
p
.
ws
,
p
.
cu_maktx
,
p
.
cu_pcdst
,
p
.
ztype
,
p
.
barcode
,
p
.
gdno
,
p
.
lh
,
p
.
dgxx
,
p
.
zklx
,
p
.
erdat
,
p
.
erzet
,
p
.
netpr
,
p
.
aedat
,
q
.
pernr
from
sapabap1
.
vbap
p
left
join
(
select
a
.
vbeln
,
a
.
posnr
,
a
.
pernr
from
sapabap1
.
vbpa
a
left
join
sapabap1
.
vbak
b
on
a
.
vbeln
=
b
.
vbeln
where
a
.
mandt
=
'800'
and
a
.
pernr
!=
'00000000'
group
by
a
.
vbeln
,
a
.
posnr
,
a
.
pernr
)
q
on
p
.
vbeln
=
q
.
vbeln
and
p
.
posnr
=
q
.
posnr
where
p
.
"$rowid$"
>
10
and
p
.
mandt
=
'800'
order
by
p
.
"$rowid$"
mandt
,
AUFPL
,
aplzl
,
steus
from
sapabap1
.
Afvc
where
"$rowid$"
>
10
and
mandt
=
'800'
order
by
"$rowid$"
src/main/resources/devtools/doc/华正项目-数据库表设计20201107.xlsx
浏览文件 @
c74fb658
No preview for this file type
src/main/resources/devtools/doc/新建表.xlsx
0 → 100644
浏览文件 @
c74fb658
File added
src/main/resources/devtools/table/hana/afvc.sql
0 → 100644
浏览文件 @
c74fb658
drop
table
afvc
;
CREATE
TABLE
afvc
(
mandt
text
,
aufpl
text
,
aplzl
text
,
steus
text
,
hashResult
text
,
rowNum
serial
,
PRIMARY
KEY
(
mandt
,
aufpl
,
aplzl
)
)
Distributed
by
(
mandt
,
aufpl
,
aplzl
);
src/main/resources/mapper/greenplum/GPMapper_greenplum.xml
浏览文件 @
c74fb658
...
...
@@ -611,6 +611,25 @@
<select
id=
"selectKnvvCheck"
parameterType=
"com.huazheng.project.hana.model.Knvv"
resultType=
"com.huazheng.project.hana.model.Knvv"
>
select * from Knvv where rownum
>
#{rowNum} order by rownum limit 20
</select>
<select
id=
"selectAfvc"
parameterType=
"com.huazheng.project.hana.model.Afvc"
resultType=
"com.huazheng.project.hana.model.Afvc"
>
select * from Afvc where mandt = #{mandt} and aufpl = #{aufpl} and aplzl = #{aplzl}
</select>
<insert
id=
"insertAfvc"
parameterType=
"com.huazheng.project.hana.model.Afvc"
>
insert into Afvc (mandt, aufpl, aplzl, steus, hashResult)
values(#{mandt},#{aufpl},#{aplzl},#{steus},#{hashResult})
</insert>
<delete
id=
"deleteAfvc"
parameterType=
"com.huazheng.project.hana.model.Afvc"
>
delete from Afvc where mandt = #{mandt} and aufpl = #{aufpl} and aplzl = #{aplzl}
</delete>
<update
id=
"updateAfvc"
parameterType=
"com.huazheng.project.hana.model.Afvc"
>
update Afvc set
mandt = #{mandt}, aufpl = #{aufpl}, aplzl = #{aplzl}, steus = #{steus}, hashResult = #{hashResult}
where mandt = #{mandt} and aufpl = #{aufpl} and aplzl = #{aplzl}
</update>
<select
id=
"selectAfvcCheck"
parameterType=
"com.huazheng.project.hana.model.Afvc"
resultType=
"com.huazheng.project.hana.model.Afvc"
>
select * from Afvc where rownum
>
#{rowNum} order by rownum limit 20
</select>
<select
id=
"selectKonv"
parameterType=
"com.huazheng.project.hana.model.Konv"
resultType=
"com.huazheng.project.hana.model.Konv"
>
select * from Konv
...
...
src/main/resources/mapper/hana/SapMapper_hana.xml
浏览文件 @
c74fb658
...
...
@@ -20,7 +20,6 @@
where p."$rowid$" > 10 and p.mandt = #{mandt}
order by p."$rowid$"
</select>
<select
id=
"selectBsidNew"
parameterType=
"Bsid"
resultType=
"Bsid"
>
select top 20 a."$rowid$" as rowids,
a.vbeln,a.mandt,a.bukrs,a.kunnr,a.umsks,a.umskz,a.augdt as augdts,a.augbl,a.zuonr,a.gjahr,a.belnr,a.buzei,a.buzei as buzeis,
...
...
@@ -193,6 +192,13 @@
where "$rowid$"
>
#{rowids} ${hana_mandt}
order by "$rowid$"
</select>
<select
id=
"selectAfvcNew"
parameterType=
"Afvc"
resultType=
"Afvc"
>
select top 20 "$rowid$" as rowids,
mandt, aufpl, aplzl, steus
from ${hana_user}.Afvc
where "$rowid$"
>
#{rowids} ${hana_mandt}
order by "$rowid$"
</select>
<select
id=
"selectKnkkNew"
parameterType=
"Knkk"
resultType=
"Knkk"
>
select top 20 "$rowid$" as rowids,
mandt,kunnr,kkber,klimk,skfor,ssobl,aedat
...
...
@@ -318,6 +324,11 @@
from ${hana_user}.Knvv
where mandt = #{mandt} and kunnr = #{kunnr} and vkorg = #{vkorg} and vtweg = #{vtweg} and spart = #{spart}
</select>
<select
id=
"selectAfvcById"
parameterType=
"Afvc"
resultType=
"Afvc"
>
select mandt, aufpl, aplzl, steus
from ${hana_user}.Afvc
where mandt = #{mandt} and aufpl = #{aufpl} and aplzl = #{aplzl}
</select>
<select
id=
"selectKonvById"
parameterType=
"Konv"
resultType=
"Konv"
>
select mandt,knumv,kposn,stunr,zaehk,kntyp,kbetr
from ${hana_user}.Konv
...
...
@@ -487,8 +498,6 @@
and a.augdt = #{augdts} and a.augbl = #{augbl} and a.zuonr = #{zuonr} and a.gjahr = #{gjahr}
and a.belnr = #{belnr} and a.buzei = #{buzeis}
</select>
<select
id=
"selectVbapById"
parameterType=
"Vbap"
resultType=
"Vbap"
>
select
p.vbeln, p.posnr, p.matnr, p.mandt, p.matkl, p.spart, p.kwmeng, p.netwr, p.mwsbp, p.waerk, p.vrkme, p.abgru,
...
...
@@ -506,8 +515,6 @@
) q on p.vbeln = q.vbeln and p.posnr = q.posnr
where p.vbeln = #{vbeln} and p.posnr = #{posnr} and p.mandt = #{mandt} and p.erdat = #{erdat}
</select>
<select
id=
"selectTvkbtById"
parameterType=
"Tvkbt"
resultType=
"Tvkbt"
>
select mandt,spras,vkbur,bezei
from ${hana_user}.Tvkbt
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论