Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
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
zhangkb
indicators
Commits
a7423b56
Commit
a7423b56
authored
Jul 02, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改根据关键字查找目录接口
parent
9bb7fd0c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
14 deletions
+31
-14
IndCatalogCtrl.java
...om/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
+6
-4
DriveIndCatalogMapper.java
...icators/model/mapper/indmapper/DriveIndCatalogMapper.java
+1
-1
IndCatalogMapper.java
...e/indicators/model/mapper/indmapper/IndCatalogMapper.java
+1
-1
DriveIndCatalogService.java
.../indicators/service/hytobacco/DriveIndCatalogService.java
+5
-3
IndCatalogService.java
...obile/indicators/service/hytobacco/IndCatalogService.java
+5
-2
DriveIndCatalogMapper.xml
src/main/resources/mybatis/mapping/DriveIndCatalogMapper.xml
+6
-1
IndCatalogMapper.xml
src/main/resources/mybatis/mapping/IndCatalogMapper.xml
+7
-2
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
View file @
a7423b56
...
@@ -48,8 +48,9 @@ public class IndCatalogCtrl {
...
@@ -48,8 +48,9 @@ public class IndCatalogCtrl {
@ApiOperation
(
value
=
"根据关键字搜索获取基础指标目录"
,
notes
=
"根据关键字搜索获取基础指标目录"
)
@ApiOperation
(
value
=
"根据关键字搜索获取基础指标目录"
,
notes
=
"根据关键字搜索获取基础指标目录"
)
@PostMapping
(
value
=
"/getBaseIndCatalogByKeyword"
)
@PostMapping
(
value
=
"/getBaseIndCatalogByKeyword"
)
public
List
<
IndCatalog
>
getBaseIndCatalogByKeyword
(
@RequestParam
(
required
=
false
)
String
keyword
){
public
List
<
IndCatalog
>
getBaseIndCatalogByKeyword
(
@RequestParam
(
required
=
false
)
String
keyword
,
return
indCatalogService
.
getCatalogByKeyword
(
keyword
);
@RequestParam
List
<
String
>
codes
){
return
indCatalogService
.
getCatalogByKeyword
(
keyword
,
codes
);
}
}
//考核指标目录
//考核指标目录
...
@@ -75,7 +76,8 @@ public class IndCatalogCtrl {
...
@@ -75,7 +76,8 @@ public class IndCatalogCtrl {
@ApiOperation
(
value
=
"根据关键字搜索获取考核指标目录"
,
notes
=
"根据关键字搜索获取考核指标目录"
)
@ApiOperation
(
value
=
"根据关键字搜索获取考核指标目录"
,
notes
=
"根据关键字搜索获取考核指标目录"
)
@PostMapping
(
value
=
"/getDriveIndCatalogByKeyword"
)
@PostMapping
(
value
=
"/getDriveIndCatalogByKeyword"
)
public
List
<
DriveIndCatalog
>
getDriveIndCatalogByKeyword
(
@RequestParam
(
required
=
false
)
String
keyword
){
public
List
<
DriveIndCatalog
>
getDriveIndCatalogByKeyword
(
@RequestParam
(
required
=
false
)
String
keyword
,
return
driveIndCatalogService
.
getCatalogByKeyword
(
keyword
);
@RequestParam
List
<
String
>
codes
){
return
driveIndCatalogService
.
getCatalogByKeyword
(
keyword
,
codes
);
}
}
}
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndCatalogMapper.java
View file @
a7423b56
...
@@ -17,5 +17,5 @@ public interface DriveIndCatalogMapper extends BaseMapper<DriveIndCatalog>{
...
@@ -17,5 +17,5 @@ public interface DriveIndCatalogMapper extends BaseMapper<DriveIndCatalog>{
public
List
<
DriveIndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
public
List
<
DriveIndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
public
List
<
DriveIndCatalog
>
findByKeyword
(
@Param
(
"keyword"
)
String
keyword
);
public
List
<
DriveIndCatalog
>
findByKeyword
(
Map
<
String
,
Object
>
params
);
}
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndCatalogMapper.java
View file @
a7423b56
...
@@ -18,5 +18,5 @@ public interface IndCatalogMapper extends BaseMapper<IndCatalog>{
...
@@ -18,5 +18,5 @@ public interface IndCatalogMapper extends BaseMapper<IndCatalog>{
public
List
<
IndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
public
List
<
IndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
public
List
<
IndCatalog
>
findByKeyword
(
@Param
(
"keyword"
)
String
keyword
);
public
List
<
IndCatalog
>
findByKeyword
(
Map
<
String
,
Object
>
params
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCatalogService.java
View file @
a7423b56
...
@@ -84,11 +84,13 @@ public class DriveIndCatalogService {
...
@@ -84,11 +84,13 @@ public class DriveIndCatalogService {
}
}
//根据关键字获取目录树
//根据关键字获取目录树
public
List
<
DriveIndCatalog
>
getCatalogByKeyword
(
String
keyword
){
public
List
<
DriveIndCatalog
>
getCatalogByKeyword
(
String
keyword
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
keyword
))
{
if
(
StringUtils
.
isBlank
(
keyword
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
else
{
return
driveIndCatalogMapper
.
findByKeyword
(
"%"
+
keyword
+
"%"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"keyword"
,
"%"
+
keyword
+
"%"
);
params
.
put
(
"codes"
,
codes
);
return
driveIndCatalogMapper
.
findByKeyword
(
params
);
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndCatalogService.java
View file @
a7423b56
...
@@ -83,10 +83,13 @@ public class IndCatalogService {
...
@@ -83,10 +83,13 @@ public class IndCatalogService {
}
}
//根据目录树获取
//根据目录树获取
public
List
<
IndCatalog
>
getCatalogByKeyword
(
String
keyword
){
public
List
<
IndCatalog
>
getCatalogByKeyword
(
String
keyword
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
keyword
))
{
if
(
StringUtils
.
isBlank
(
keyword
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
return
indCatalogMapper
.
findByKeyword
(
"%"
+
keyword
+
"%"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"keyword"
,
"%"
+
keyword
+
"%"
);
params
.
put
(
"codes"
,
codes
);
return
indCatalogMapper
.
findByKeyword
(
params
);
}
}
}
}
src/main/resources/mybatis/mapping/DriveIndCatalogMapper.xml
View file @
a7423b56
...
@@ -30,6 +30,10 @@
...
@@ -30,6 +30,10 @@
<select
id=
"findByKeyword"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCatalog"
>
<select
id=
"findByKeyword"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCatalog"
>
select *
select *
from drive_ind_catalog
from drive_ind_catalog
where catalog_name like #{keyword}
where catalog_name like #{keyword} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndCatalogMapper.xml
View file @
a7423b56
...
@@ -27,9 +27,13 @@
...
@@ -27,9 +27,13 @@
where parent_id = #{pid}
where parent_id = #{pid}
</select>
</select>
<select
id=
"findByKeyword"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndCatalog"
>
<select
id=
"findByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndCatalog"
>
select *
select *
from base_ind_catalog
from base_ind_catalog
where catalog_name like #{keyword}
where catalog_name like #{keyword} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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