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
845352cf
Commit
845352cf
authored
Mar 01, 2020
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化关联设备指标添加编辑页面
parent
e8fa7dd2
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
70 additions
and
17 deletions
+70
-17
FmeaEquipmentPoint.java
...a/com/yeejoin/amos/fas/dao/entity/FmeaEquipmentPoint.java
+12
-0
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+2
-1
FmeaEquipmentPointMapper.java
...mos/fas/business/dao/mapper/FmeaEquipmentPointMapper.java
+2
-2
ImpEquipMapper.java
.../yeejoin/amos/fas/business/dao/mapper/ImpEquipMapper.java
+2
-1
FmeaBindParam.java
...va/com/yeejoin/amos/fas/business/param/FmeaBindParam.java
+10
-0
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+6
-2
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+5
-3
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+1
-1
fas-1.0.2.xml
...utoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
+13
-0
dbTemplate_fmea_equipment_point.xml
...n/resources/db/mapper/dbTemplate_fmea_equipment_point.xml
+11
-3
dbTemplate_impt_equip.xml
...rt/src/main/resources/db/mapper/dbTemplate_impt_equip.xml
+6
-4
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/FmeaEquipmentPoint.java
View file @
845352cf
...
...
@@ -24,6 +24,9 @@ public class FmeaEquipmentPoint extends BasicEntity {
@Column
(
name
=
"state"
)
private
Integer
state
;
@Column
(
name
=
"important_equipment_id"
)
private
Long
importantEquipmentId
;
public
Long
getEquipmentPointId
()
{
return
equipmentPointId
;
}
...
...
@@ -47,4 +50,12 @@ public class FmeaEquipmentPoint extends BasicEntity {
public
void
setState
(
Integer
state
)
{
this
.
state
=
state
;
}
public
Long
getImportantEquipmentId
()
{
return
importantEquipmentId
;
}
public
void
setImportantEquipmentId
(
Long
importantEquipmentId
)
{
this
.
importantEquipmentId
=
importantEquipmentId
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
845352cf
...
...
@@ -535,9 +535,10 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
value
=
"查询设备指标"
,
notes
=
"查询设备指标"
)
@GetMapping
(
value
=
"/listEquipmentPointById"
)
public
CommonResponse
listEquipmentPointById
(
@RequestParam
Long
fmeaId
,
@RequestParam
Long
importantEquipId
,
@RequestParam
Long
equimentId
,
@RequestParam
(
required
=
false
)
String
equipmentPointName
)
{
return
CommonResponseUtil
.
success
(
riskSourceService
.
listEquipmentPointById
(
fmeaId
,
equimentId
,
equipmentPointName
));
return
CommonResponseUtil
.
success
(
riskSourceService
.
listEquipmentPointById
(
fmeaId
,
importantEquipId
,
equimentId
,
equipmentPointName
));
}
@Authorization
(
ingore
=
true
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FmeaEquipmentPointMapper.java
View file @
845352cf
...
...
@@ -8,7 +8,7 @@ import java.util.Map;
public
interface
FmeaEquipmentPointMapper
extends
BaseMapper
{
void
deleteByFmeaIdAndEquipmentPointIds
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"equipmentPointIds"
)
List
<
Long
>
equipmentPointIds
);
void
deleteByFmeaIdAndEquipmentPointIds
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"
importantEquipId"
)
Long
importantEquipId
,
@Param
(
"
equipmentPointIds"
)
List
<
Long
>
equipmentPointIds
);
void
deleteByFmeaIds
(
Long
[]
fmeaIds
);
...
...
@@ -22,7 +22,7 @@ public interface FmeaEquipmentPointMapper extends BaseMapper {
List
<
Long
>
listEquipmentPointIdsByEquipmentId
(
Long
equipmentId
);
List
<
Map
<
String
,
Object
>>
listEquipmentPoint
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"equipmentId"
)
Long
equipmentId
,
@Param
(
"equipmentPointName"
)
String
equipmentPointName
);
List
<
Map
<
String
,
Object
>>
listEquipmentPoint
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"
importantEquipId"
)
Long
importantEquipId
,
@Param
(
"
equipmentId"
)
Long
equipmentId
,
@Param
(
"equipmentPointName"
)
String
equipmentPointName
);
List
<
FmeaEquipmentPoint
>
listByEquipmentPointId
(
Long
equipmentPointId
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ImpEquipMapper.java
View file @
845352cf
...
...
@@ -11,8 +11,9 @@ public interface ImpEquipMapper extends BaseMapper {
String
queryProtectObjNames
(
@Param
(
"fireEquipmentId"
)
Long
fireEquipmentId
);
List
<
Map
>
getEquipPage
(
@Param
(
"name"
)
String
name
,
@Param
(
"id"
)
String
id
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
Long
getEquipPageCount
(
@Param
(
"name"
)
String
name
);
Long
getEquipPageCount
(
@Param
(
"name"
)
String
name
,
@Param
(
"id"
)
String
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/param/FmeaBindParam.java
View file @
845352cf
...
...
@@ -14,6 +14,8 @@ public class FmeaBindParam {
private
List
<
Long
>
pointInputitemIds
;
private
Long
importantEquipmentId
;
public
Long
getFmeaId
()
{
return
fmeaId
;
}
...
...
@@ -53,4 +55,12 @@ public class FmeaBindParam {
public
void
setEquipmentId
(
Long
equipmentId
)
{
this
.
equipmentId
=
equipmentId
;
}
public
Long
getImportantEquipmentId
()
{
return
importantEquipmentId
;
}
public
void
setImportantEquipmentId
(
Long
importantEquipmentId
)
{
this
.
importantEquipmentId
=
importantEquipmentId
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
845352cf
...
...
@@ -138,13 +138,17 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Override
public
Page
<
Equipment
>
queryImpEquip
(
List
<
DaoCriteria
>
criterias
,
CommonPageable
commonPageable
)
{
String
name
=
""
;
String
id
=
""
;
for
(
DaoCriteria
criteria
:
criterias
)
{
if
(
criteria
.
getPropertyName
().
equals
(
"name"
))
{
name
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
}
if
(
criteria
.
getPropertyName
().
equals
(
"id"
))
{
id
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
}
}
Long
total
=
impEquipMapper
.
getEquipPageCount
(
name
);
List
<
Map
>
content
=
impEquipMapper
.
getEquipPage
(
name
,
commonPageable
.
getOffset
(),
Long
total
=
impEquipMapper
.
getEquipPageCount
(
name
,
id
);
List
<
Map
>
content
=
impEquipMapper
.
getEquipPage
(
name
,
id
,
commonPageable
.
getOffset
(),
commonPageable
.
getPageSize
());
Page
result
=
new
PageImpl
(
content
,
commonPageable
,
total
);
return
result
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
845352cf
...
...
@@ -403,14 +403,16 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
public
List
<
FmeaEquipmentPoint
>
bindFireEquiment
(
FmeaBindParam
fmeaBindParam
)
{
Long
fmeaId
=
fmeaBindParam
.
getFmeaId
();
Long
importantEquipId
=
fmeaBindParam
.
getImportantEquipmentId
();
List
<
Long
>
equipmentPointIds
=
fmeaEquipmentPointMapper
.
listEquipmentPointIdsByEquipmentId
(
fmeaBindParam
.
getEquipmentId
());
if
(!
CollectionUtils
.
isEmpty
(
equipmentPointIds
))
{
fmeaEquipmentPointMapper
.
deleteByFmeaIdAndEquipmentPointIds
(
fmeaId
,
equipmentPointIds
);
fmeaEquipmentPointMapper
.
deleteByFmeaIdAndEquipmentPointIds
(
fmeaId
,
importantEquipId
,
equipmentPointIds
);
}
List
<
FmeaEquipmentPoint
>
returnList
=
new
ArrayList
<>();
for
(
Long
equipmentPointId
:
fmeaBindParam
.
getEquipmentPointIds
())
{
FmeaEquipmentPoint
fmeaEquipmentPoint
=
new
FmeaEquipmentPoint
();
fmeaEquipmentPoint
.
setFmeaId
(
fmeaId
);
fmeaEquipmentPoint
.
setImportantEquipmentId
(
importantEquipId
);
fmeaEquipmentPoint
.
setEquipmentPointId
(
equipmentPointId
);
returnList
.
add
(
fmeaEquipmentPoint
);
}
...
...
@@ -459,8 +461,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
new
PageImpl
<>(
list
,
commonPageable
,
total
);
}
public
List
<
Map
<
String
,
Object
>>
listEquipmentPointById
(
Long
fmeaId
,
Long
equipmentId
,
String
equipmentPointName
)
{
List
<
Map
<
String
,
Object
>>
list
=
fmeaEquipmentPointMapper
.
listEquipmentPoint
(
fmeaId
,
equipmentId
,
equipmentPointName
);
public
List
<
Map
<
String
,
Object
>>
listEquipmentPointById
(
Long
fmeaId
,
Long
importantEquipId
,
Long
equipmentId
,
String
equipmentPointName
)
{
List
<
Map
<
String
,
Object
>>
list
=
fmeaEquipmentPointMapper
.
listEquipmentPoint
(
fmeaId
,
importantEquipId
,
equipmentId
,
equipmentPointName
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
Lists
.
newArrayList
();
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
845352cf
...
...
@@ -59,7 +59,7 @@ public interface IRiskSourceService {
*/
Page
queryEquimentRelation
(
CommonPageable
commonPageable
,
String
equipmentId
,
String
fname
);
List
<
Map
<
String
,
Object
>>
listEquipmentPointById
(
Long
fmeaId
,
Long
equipmentId
,
String
equipmentPointName
);
List
<
Map
<
String
,
Object
>>
listEquipmentPointById
(
Long
fmeaId
,
Long
importantEquipId
,
Long
equipmentId
,
String
equipmentPointName
);
Page
<
Map
<
String
,
Object
>>
listFmeaPointInputitem
(
Long
fmeaId
,
Integer
pageNumber
,
Integer
pageSize
);
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
View file @
845352cf
...
...
@@ -186,4 +186,16 @@
</sql>
</changeSet>
<changeSet
author=
"tianbo"
id=
"1583068193000-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea_equipment_point"
columnName=
"important_equipment_id"
/>
</not>
</preConditions>
<comment>
f_fmea_equipment_point add column important_equipment_id
</comment>
<sql>
ALTER TABLE `f_fmea_equipment_point` ADD COLUMN `important_equipment_id` bigint(20) NOT NULL COMMENT '所属重点设备id';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fmea_equipment_point.xml
View file @
845352cf
...
...
@@ -8,6 +8,7 @@
f_fmea_equipment_point
where
fmea_id = #{fmeaId}
and important_equipment_id = #{importantEquipId}
and
equipment_point_id in
<foreach
collection=
"equipmentPointIds"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
...
...
@@ -28,12 +29,14 @@
insert into f_fmea_equipment_point
(
fmea_id,
important_equipment_id,
equipment_point_id
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.fmeaId},
#{item.importantEquipmentId},
#{item.equipmentPointId}
)
</foreach>
...
...
@@ -62,18 +65,21 @@
select
c.fmea_id as fmeaId,
a.id as equipmentId,
group_concat(
b.name
) as equipmentPointNames,
group_concat(
concat( b.NAME, '##', c.state ) SEPARATOR
<![CDATA[ '\n' ]]>
) as equipmentPointNames,
a.name as equipmentName,
a.code as equipmentCode
a.code as equipmentCode,
d.name AS importantEquipName,
d.id AS importantEquipId
from
f_fire_equipment as a
left join
f_fire_equipment_point as b on b.fire_equipment_id = a.id
left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id
LEFT JOIN f_equipment AS d ON d.id = c.important_equipment_id
where
c.fmea_id = #{fmeaId}
group by b.fire_equipment_id
group by b.fire_equipment_id
,c.important_equipment_id
limit #{offset},#{limit}
</select>
...
...
@@ -113,6 +119,8 @@
d.equipment_point_id = a.id
and
d.fmea_id = #{fmeaId}
and
d.important_equipment_id = #{importantEquipId}
) isBound
from
f_fire_equipment_point as a
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_impt_equip.xml
View file @
845352cf
...
...
@@ -37,9 +37,10 @@
FROM
f_equipment eq
left join f_risk_source frs on frs.id = eq.risk_source_id
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"name!=null"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
</trim>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"name !=null and name != ''"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
<if
test=
"id != null and id != ''"
>
and eq.id = #{id}
</if>
</trim>
order by eq.id
<choose>
<when
test=
"pageSize==-1"
></when>
...
...
@@ -53,7 +54,8 @@
FROM
f_equipment eq
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"name!=null"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
<if
test=
"name !=null and name != ''"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
<if
test=
"id != null and id != ''"
>
and eq.id = #{id}
</if>
</trim>
</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