Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
Project
Project
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
station
YeeAmosFireAutoSysRoot
Commits
8e195190
Commit
8e195190
authored
Apr 10, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据绑定查询接口为一个
parent
65e84da4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
18 deletions
+17
-18
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+8
-16
PlanVisual3dMapper.java
...join/amos/fas/business/dao/mapper/PlanVisual3dMapper.java
+1
-1
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+3
-0
dbTemplate_3d_plan_visual.xml
...rc/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
+5
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
8e195190
...
...
@@ -115,32 +115,24 @@ public class PlanVisual3dController extends BaseController {
* @return 资源设备 or 数据项
*/
@Authorization
(
ingore
=
true
)
@GetMapping
(
value
=
"
resource/common
"
)
@GetMapping
(
value
=
"
common/dataBind
"
)
@ApiOperation
(
value
=
"设备、数据项查询"
,
notes
=
"按照资源类型type查询设备,按照资源类型type和设备id查询数据项"
)
public
CommonResponse
getResourceCommon
(
@ApiParam
(
value
=
"资源类型"
)
@RequestParam
(
required
=
false
)
String
type
,
@ApiParam
(
value
=
"主键id"
)
@RequestParam
(
required
=
false
)
Long
id
)
{
if
(!
StringUtil
.
isNotEmpty
(
type
)){
return
CommonResponseUtil
.
success
();
//1.查询数据类型
if
(!
StringUtil
.
isNotEmpty
(
type
))
{
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getResourceTypeList
());
}
if
(
StringUtil
.
isNotEmpty
(
type
)
&&
!
StringUtil
.
isNotEmpty
(
id
)){
//2.查询类型对应数据
if
(
StringUtil
.
isNotEmpty
(
type
)
&&
!
StringUtil
.
isNotEmpty
(
id
))
{
return
planVisual3dService
.
getResourceListByType
(
type
);
}
if
(
StringUtil
.
isNotEmpty
(
type
)
&&
StringUtil
.
isNotEmpty
(
id
)){
//3.查询绑定项数据
if
(
StringUtil
.
isNotEmpty
(
type
)
&&
StringUtil
.
isNotEmpty
(
id
))
{
List
<
Map
<
String
,
Object
>>
list
=
planVisual3dService
.
getResourceById
(
type
,
id
);
return
CommonResponseUtil
.
success
(
list
);
}
return
CommonResponseUtil
.
success
();
}
/**
* 资源类型查询
* @return list
*/
@Authorization
(
ingore
=
true
)
@ApiOperation
(
value
=
"资源类型查询"
,
notes
=
"资源类型查询"
)
@GetMapping
(
value
=
"resource/type/list"
)
public
CommonResponse
getResourceList
(){
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getResourceTypeList
());
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanVisual3dMapper.java
View file @
8e195190
...
...
@@ -6,7 +6,7 @@ import java.util.List;
import
java.util.Map
;
public
interface
PlanVisual3dMapper
extends
BaseMapper
{
List
<
HashMap
<
String
,
String
>>
getResourceListByType
(
@Param
(
"type"
)
String
type
);
List
<
HashMap
<
String
,
Object
>>
getResourceListByType
(
@Param
(
"type"
)
String
type
);
Map
<
String
,
Object
>
queryOneByTypeAndId
(
@Param
(
"type"
)
String
type
,
@Param
(
"id"
)
Long
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
8e195190
...
...
@@ -191,6 +191,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
list
=
dictList
.
stream
().
map
(
e
->{
Map
<
String
,
Object
>
newMap
=
new
HashMap
<
String
,
Object
>();
newMap
.
put
(
"key"
,
e
.
getDictValue
());
newMap
.
put
(
"value"
,
e
.
getDictValue
());
//前端级联Cascader使用
newMap
.
put
(
"isLeaf"
,
false
);
////前端级联Cascader使用
newMap
.
put
(
"dataType"
,
"type"
);
newMap
.
put
(
"label"
,
e
.
getDictName
());
return
newMap
;
}).
collect
(
Collectors
.
toList
());
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
View file @
8e195190
...
...
@@ -5,7 +5,11 @@
<!--查询-->
<select
id=
"getResourceListByType"
resultType=
"java.util.HashMap"
>
SELECT
rs.id as `key` ,rs.name as label,rs.code
rs.id as `key` ,
rs.id AS `value`,
rs.name as label,
rs.code ,
'id' as dataType
from
<choose>
<when
test=
"type=='fireCar'"
>
...
...
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