Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0cdd01e7
authored
Jan 08, 2024
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
模板新增/更新 接口使用手写sql
1 parent
a5fb1003
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/SopTplMapper.java
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopTplService.java
platform-process/src/main/resources/mapper/SopTplMapper.xml
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/SopTplMapper.java
View file @
0cdd01e
...
...
@@ -15,4 +15,8 @@ public interface SopTplMapper extends CommonBaseMapper<SopTpl> {
List
<
SopTplDTO
>
page
(
SopTplSearch
search
);
SopTplDTO
getById
(
@Param
(
"tplId"
)
String
tplId
);
int
insertCustom
(
SopTpl
sopTpl
);
int
updateByPrimaryKeyCustom
(
SopTpl
sopTpl
);
}
\ No newline at end of file
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopTplService.java
View file @
0cdd01e
...
...
@@ -91,12 +91,12 @@ public class SopTplService {
if
(
StrUtil
.
isEmpty
(
tplId
))
{
tplId
=
StrUtil
.
sub
(
SnowFlake
.
nextSerialNumber
(),
0
,
8
);
sopTpl
.
setTplId
(
tplId
);
sopTplMapper
.
insert
(
sopTpl
);
sopTplMapper
.
insert
Custom
(
sopTpl
);
}
else
{
sopTplNodeMapper
.
deleteByExample
(
Example
.
builder
(
SopTplNode
.
class
).
where
(
Sqls
.
custom
().
andEqualTo
(
"tplId"
,
tplId
)).
build
());
sopTplLinkMapper
.
deleteByExample
(
Example
.
builder
(
SopTplLink
.
class
).
where
(
Sqls
.
custom
().
andEqualTo
(
"tplId"
,
tplId
)).
build
());
sopTplMapper
.
updateByPrimaryKey
(
sopTpl
);
sopTplMapper
.
updateByPrimaryKey
Custom
(
sopTpl
);
}
List
<
SopTplNode
>
nodes
=
sopTplDTO
.
getNodes
();
...
...
platform-process/src/main/resources/mapper/SopTplMapper.xml
View file @
0cdd01e
...
...
@@ -26,6 +26,24 @@
tpl_id, tpl_name, tpl_cron, tpl_remark, tpl_status, tpl_param_def, tpl_result_def,
tpl_singleton, create_time, update_time
</sql>
<insert
id=
"insertCustom"
>
insert into sop_tpl(
tpl_id, tpl_name, tpl_cron, tpl_remark, tpl_status, tpl_param_def, tpl_result_def, tpl_singleton
) values (
#{tplId}, #{tplName}, #{tplCron}, #{tplRemark}, #{tplStatus}, #{tplParamDef}, #{tplResultDef}, #{tplSingleton}
)
</insert>
<update
id=
"updateByPrimaryKeyCustom"
>
update sop_tpl set
tpl_name = #{tplName},
tpl_cron = #{tplCron},
tpl_remark = #{tplRemark},
tpl_status = #{tplStatus},
tpl_param_def = #{tplParamDef},
tpl_result_def = #{tplResultDef},
tpl_singleton = #{tplSingleton}
where tpl_id = #{tplId}
</update>
<select
id=
"page"
resultMap=
"BaseResultDTOMap"
>
select
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment