Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
205db241
Commit
205db241
authored
Jun 28, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据字典接口
parent
81a14283
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
DictionaryBiz.java
...n/java/com/xxfc/platform/universal/biz/DictionaryBiz.java
+8
-3
DictionaryController.java
...c/platform/universal/controller/DictionaryController.java
+2
-2
DictionaryMapper.xml
...sal-server/src/main/resources/mapper/DictionaryMapper.xml
+4
-4
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/DictionaryBiz.java
View file @
205db241
...
...
@@ -79,13 +79,18 @@ public class DictionaryBiz extends BaseBiz<DictionaryMapper, Dictionary> {
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
getParent
()
{
Set
<
Dictionary
>
dictionaryList
=
mapper
.
selectByPid
(
0
);
public
ObjectRestResponse
getParent
(
String
type
)
{
if
(
StringUtils
.
isEmpty
(
type
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
Dictionary
dictionary
=
new
Dictionary
();
dictionary
.
setType
(
type
);
dictionary
.
setPid
(
0
);
List
<
Dictionary
>
dictionaryList
=
mapper
.
selectByCodeAndType
(
dictionary
);
for
(
Dictionary
parent
:
dictionaryList
)
{
Set
<
Dictionary
>
dictionaryVoList
=
buildTree
(
parent
.
getId
());
parent
.
setChildrens
(
dictionaryVoList
);
}
return
ObjectRestResponse
.
succ
(
dictionaryList
);
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/DictionaryController.java
View file @
205db241
...
...
@@ -42,7 +42,7 @@ public class DictionaryController {
@GetMapping
(
value
=
"/getParents"
)
@ApiOperation
(
value
=
"获取所有的父类元素 pid=0"
)
public
ObjectRestResponse
getParent
()
{
return
dictionaryBiz
.
getParent
();
public
ObjectRestResponse
getParent
(
String
type
)
{
return
dictionaryBiz
.
getParent
(
type
);
}
}
xx-universal/xx-universal-server/src/main/resources/mapper/DictionaryMapper.xml
View file @
205db241
...
...
@@ -14,22 +14,22 @@
</resultMap>
<select
id=
"selectByCodeAndType"
parameterType=
"com.xxfc.platform.universal.entity.Dictionary"
resultType=
"com.xxfc.platform.universal.entity.Dictionary"
>
select * from dictionary
select * from d
ata_d
ictionary
<where>
<if
test=
"type != null"
>
and type = #{type}
</if>
<if
test=
"code"
>
<if
test=
"code
!= null
"
>
and code = #{code}
</if>
<if
test=
"pid"
>
<if
test=
"pid
!= null
"
>
and pid = #{pid}
</if>
</where>
</select>
<select
id =
"selectByPid"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.universal.entity.Dictionary"
>
select * from dictionary
select * from d
ata_d
ictionary
where pid = #{pid}
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment