Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
41556b93
Commit
41556b93
authored
Dec 15, 2021
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:增加查询好办字典表数据接口
parent
f5fd2e61
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
11 deletions
+38
-11
DictApiService.java
...ava/com/gic/haoban/manage/api/service/DictApiService.java
+10
-0
DictMapper.java
.../com/gic/haoban/manage/service/dao/mapper/DictMapper.java
+0
-2
DictApiServiceImpl.java
...n/manage/service/service/out/impl/DictApiServiceImpl.java
+8
-5
DictMapper.xml
...-manage3-service/src/main/resources/mapper/DictMapper.xml
+5
-4
DictController.java
.../com/gic/haoban/manage/web/controller/DictController.java
+15
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DictApiService.java
View file @
41556b93
...
...
@@ -25,4 +25,14 @@ public interface DictApiService {
* @return
*/
List
<
DictDTO
>
queryList
(
List
<
String
>
dictKeys
);
/**
* 根据key 获取一条
*
* @param dictKey dict关键
* @return {@link DictDTO }
* @author mozhu
* @date 2021-12-15 19:47:51
*/
DictDTO
findOneDictByKey
(
String
dictKey
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DictMapper.java
View file @
41556b93
...
...
@@ -26,5 +26,4 @@ public interface DictMapper {
TabHaobanDict
selectByDictKey
(
String
dictKey
);
TabHaobanDict
selectByDictName
(
String
dictKey
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DictApiServiceImpl.java
View file @
41556b93
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DictDTO
;
import
com.gic.haoban.manage.api.service.DictApiService
;
import
com.gic.haoban.manage.service.dao.mapper.DictMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanDict
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -73,4 +71,9 @@ public class DictApiServiceImpl implements DictApiService{
List
<
TabHaobanDict
>
list
=
dictMapper
.
queryList
(
dictKeys
);
return
EntityUtil
.
changeEntityListByJSON
(
DictDTO
.
class
,
list
);
}
@Override
public
DictDTO
findOneDictByKey
(
String
dictKey
)
{
return
EntityUtil
.
changeEntity
(
DictDTO
.
class
,
dictMapper
.
selectByDictKey
(
dictKey
));
}
}
haoban-manage3-service/src/main/resources/mapper/DictMapper.xml
View file @
41556b93
...
...
@@ -140,13 +140,13 @@
<include
refid=
"Base_Column_List"
/>
from tab_haoban_dict
where dict_key = #{dictKey,jdbcType=VARCHAR}
and status_flag =
1
and status_flag = 1 limit
1
</select>
<select
id=
"selectByDictName"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByDictName"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_dict
where dict_name = #{dictName,jdbcType=VARCHAR}
and status_flag =
1
and status_flag = 1 limit
1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/DictController.java
View file @
41556b93
...
...
@@ -36,4 +36,19 @@ public class DictController extends WebBaseController {
List
<
DictDTO
>
ret
=
dictApiService
.
queryList
(
Arrays
.
asList
(
split
));
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
EntityUtil
.
changeEntityListByOrika
(
DictVo
.
class
,
ret
));
}
/**
* 根据key查询一条数据
*
* @param dictKey
* @return
*/
@RequestMapping
(
"/find-dict-key"
)
@ResponseBody
public
HaobanResponse
queryDictByKey
(
String
dictKey
)
{
if
(
StringUtils
.
isBlank
(
dictKey
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_5
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
dictApiService
.
findOneDictByKey
(
dictKey
));
}
}
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