Commit 51d11ec5 authored by 单奇雲's avatar 单奇雲

冲突

parents 7e3e0e81 921e0a73
......@@ -13,7 +13,7 @@
<parent>
<groupId>com.yeejoin.amos</groupId>
<artifactId>YeeAmosFireAutoSysRoot</artifactId>
<version>2.1.0</version>
<version>2.0.3</version>
</parent>
<!-- <dependencies>
......
......@@ -6,11 +6,14 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
<<<<<<< HEAD
import java.util.stream.Stream;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
=======
>>>>>>> 921e0a7332a4d0bf04cfb46d2e79943677dd8c73
public class RegionTreeResponse {
......@@ -24,7 +27,7 @@ public class RegionTreeResponse {
private Boolean isBind;
private String type;
private Boolean isRegion;
private JSONArray position3d;
private JSONArray position3d = new JSONArray();;
private String routePath;
private String level;
private String levelStr;
......@@ -36,12 +39,12 @@ public class RegionTreeResponse {
public void setPosition3d(String position3d) {
JSONArray jsonArray = new JSONArray();
if(!StringUtils.isEmpty(position3d)){
String[] arryStr = position3d.split(",");
List<Double> collect = Arrays.stream(arryStr).map(Double::parseDouble).collect(Collectors.toList());
jsonArray.addAll(collect);
}
this.position3d = jsonArray;
if(!StringUtils.isEmpty(position3d)){
String[] arryStr = position3d.split(",");
List<Double> collect = Arrays.stream(arryStr).map(Double::parseDouble).collect(Collectors.toList());
jsonArray.addAll(collect);
}
this.position3d = jsonArray;
}
public Long getId() {
......
......@@ -14,14 +14,14 @@
<parent>
<groupId>com.yeejoin.amos</groupId>
<artifactId>YeeAmosFireAutoSysRoot</artifactId>
<version>2.1.0</version>
<version>2.0.3</version>
</parent>
<dependencies>
<dependency>
<groupId>com.yeejoin.amos</groupId>
<artifactId>YeeAmosFireAutoSysCommon</artifactId>
<version>2.1.0</version>
<version>2.0.3</version>
</dependency>
<dependency>
......@@ -70,11 +70,11 @@
<version>1.4.5.RELEASE</version>
</dependency>
<!-- 平台接口 -->
<dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-systemctl</artifactId>
......
......@@ -4,7 +4,12 @@ import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo;
import com.yeejoin.amos.fas.core.common.request.DateUtil;
import com.yeejoin.amos.fas.core.util.StringUtil;
import org.jsoup.helper.DataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -19,6 +24,8 @@ import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import com.yeejoin.amos.fas.dao.entity.BusinessEntity;
import com.yeejoin.amos.fas.dao.entity.Message;
import com.yeejoin.amos.fas.dao.entity.MessageRo;
import org.springframework.util.unit.DataUnit;
/**
*
* <pre>
......@@ -39,10 +46,8 @@ public class SimpleTipAction implements CustomerAction
//@ExposeAction("消息提示")
public void sendMessageTip(Object bizobj, String title, String content,String type)
{
try
{
ELEvaluationContext.setVariable("bizobj",bizobj);
TipResult result = new TipResult();
result.add(bizobj);
......@@ -54,7 +59,6 @@ public class SimpleTipAction implements CustomerAction
tempmap2.put("content", content);
result.add(tempmap2);
Constructor<?> constructor;
constructor = Class.forName(
......@@ -91,11 +95,20 @@ public class SimpleTipAction implements CustomerAction
message.setTitle(map.get("title").toString());
}
}
MessageRo messageRo = (MessageRo)abstractActionResult.getToipResponse().getBizObj();
message.setTime(messageRo.getDateTime());
message.setBizId(messageRo.getId());
if (abstractActionResult.getToipResponse().getBizObj() instanceof MessageRo) {
MessageRo messageRo = (MessageRo)abstractActionResult.getToipResponse().getBizObj();
message.setTime(messageRo.getDateTime());
message.setBizId(messageRo.getId());
}
if (abstractActionResult.getToipResponse().getBizObj() instanceof RiskSourceRuleRo) {
RiskSourceRuleRo riskSourceRuleRo = (RiskSourceRuleRo) abstractActionResult.getToipResponse().getBizObj();
message.setTime(DateUtil.getNow());
message.setBizId(StringUtil.isNotEmpty(riskSourceRuleRo.getId()) ?
String.valueOf(riskSourceRuleRo.getId()) : "");
}
message.setBizclassName(abstractActionResult.getToipResponse().getBizObj().getClass().toString());
message.setType(type);
message.setId(UUID.randomUUID().toString());
messageService.save(message);
}
}
......
......@@ -21,6 +21,15 @@ public class JpushMsgContentBo {
* 巡检状态
*/
private String checkStatus;
public String getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
/**
* 执行日期
*/
......
......@@ -19,6 +19,15 @@ public class MsgParamBo {
private BigDecimal rpn;
private String level;
private String relationName;
private String checkStatus;
public String getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getToke() {
return toke;
......
......@@ -564,7 +564,7 @@ public class RiskSourceController extends BaseController {
}
//@Authorization(ingore = true)
// @Authorization(ingore = true)
@ApiOperation(httpMethod = "PUT", value = "上传巡检数据", notes = "上传巡检数据")
@RequestMapping(value = "/data/patroldata", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse postPatrolData(@RequestBody ProtalDataRo protalData) throws Exception {
......
......@@ -76,4 +76,6 @@ public interface FireEquipMapper extends BaseMapper {
Long queryEquimentRelationCount(
@Param("equipmentId") String equipmentId,
@Param("fname") String fname);
FireEquipmentEntity findById(@Param("id") Long id);
}
......@@ -15,6 +15,7 @@ import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IFmeaService;
import com.yeejoin.amos.fas.business.service.model.RiskSourceRo;
import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.Fmea;
import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import com.yeejoin.amos.fas.dao.entity.RiskLevel;
......@@ -94,6 +95,7 @@ public class FmeaServiceImpl implements IFmeaService {
userIds.add(String.valueOf(map.get("personLeaderId")));
userIds.add(String.valueOf(map.get("identifyUserId")));
}
userIds.remove("null");
userIds.remove(null);
userIds.remove("");
if(!CollectionUtils.isEmpty(userIds)){
......@@ -101,13 +103,15 @@ public class FmeaServiceImpl implements IFmeaService {
if(!CollectionUtils.isEmpty(userIds)){
users = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
for (HashMap<String, Object> map : content) {
map.put("companyLeaderName", userMap.get(map.get("companyLeaderId")));
map.put("departmentLeaderName", userMap.get(map.get("departmentLeaderId")));
map.put("groupLeaderName", userMap.get(map.get("groupLeaderId")));
map.put("personLeaderName", userMap.get(map.get("personLeaderId")));
map.put("identifyUserName", userMap.get(map.get("identifyUserId")));
if (StringUtil.isNotEmpty(users)) {
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
for (HashMap<String, Object> map : content) {
map.put("companyLeaderName", userMap.get(map.get("companyLeaderId")));
map.put("departmentLeaderName", userMap.get(map.get("departmentLeaderId")));
map.put("groupLeaderName", userMap.get(map.get("groupLeaderId")));
map.put("personLeaderName", userMap.get(map.get("personLeaderId")));
map.put("identifyUserName", userMap.get(map.get("identifyUserId")));
}
}
}
......
......@@ -547,17 +547,30 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if(!CollectionUtils.isEmpty(userIds)){
users = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
// Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
Map<String, String> userMap = new HashMap<>();
if(users!=null){
userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
}
List<DepartmentModel> depts = new ArrayList<>();
if(!CollectionUtils.isEmpty(deptIds)){
depts = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds));
}
Map<Long, String > deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName));
content.forEach(e -> {
e.put("userName",userMap.get(e.get("userId")));
e.put("deptName",deptMap.get(e.get("deptId")));
e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel")));
});
// Map<Long, String > deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName));
Map<Long, String> deptMap = new HashMap<>();
if(depts!=null){
deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName));
}
// content.forEach(e -> {
// e.put("userName",userMap.get(e.get("userId")));
// e.put("deptName",deptMap.get(e.get("deptId")));
// e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel")));
// });
for(int i=0;i<content.size();i++){
content.get(i).put("userName",userMap.get(content.get(i).get("userId")));
content.get(i).put("deptName",deptMap.get(content.get(i).get("deptId")));
content.get(i).put("tel",userMap.get(String.valueOf(content.get(i).get("deptId")+"tel")));
}
}
return new PageImpl<>(content, pageable, total);
}
......@@ -581,11 +594,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Async
public void processProtalData(String toke, String product, String appKey, ProtalDataRo protalData) {
if (!CollectionUtils.isEmpty(protalData.getItems())) {
if (!CollectionUtils.isEmpty(protalData.getPointInputitems())) {
Long pointId = protalData.getId();
List<Long> inputIds = Lists.newArrayList();
Map<Long, CheckInputItemRo> map = Maps.newHashMap();
for (CheckInputItemRo checkInputItemRo : protalData.getItems()) {
for (CheckInputItemRo checkInputItemRo : protalData.getPointInputitems()) {
inputIds.add(checkInputItemRo.getPointInputitemId());
map.put(checkInputItemRo.getPointInputitemId(), checkInputItemRo);
}
......@@ -928,12 +941,15 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} else if (param.getState().equals("false")) {
state = 0;
}
if (state != null) {
if (ids.size() > 0) {
fmeaEquipmentPointMapper.updateStateByIds(state, ids);
}
final Integer st=state;
String monitor=fireEquipMapper.findById(fireEquipPointMapper.getByCode(param.getPointCode()).getFireEquipmentId()).getName();
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
fmeaIds.forEach(fmeaId -> rsDataQueue.addEquipmentMessage(fmeaId,param.getMonitor()));
fmeaIds.forEach(fmeaId -> rsDataQueue.addEquipmentMessage(fmeaId,monitor,st));
}
}
......@@ -1136,6 +1152,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
jpushMsgContentBo.setLevel(msgParam.getLevel());
jpushMsgContentBo.setRelationName(msgParam.getRelationName());
jpushMsgContentBo.setRpn(msgParam.getRpn());
jpushMsgContentBo.setCheckStatus(msgParam.getCheckStatus());
msgBo.setTarget(this.getJpushTarget(msgParam));
msgBo.setMsg(jpushMsgContentBo);
}
......@@ -1182,7 +1199,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
public void notifyFmeaFromAbnormal(
String toke, String product, String appKey,
Long fmeaId, String notifyType,String userName, String relationName) {
Long fmeaId, String notifyType,String userName, String relationName, String checkStatus) {
Fmea fmea = fmeaMapper.getById(fmeaId);
if (fmea == null) {
return;
......@@ -1218,7 +1235,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
msgParamBo.setLevel(newLevel.getName());
msgParamBo.setUserName(userName);
msgParamBo.setNotifyType(notifyType);
msgParamBo.setCheckStatus(checkStatus);
msgParamBo.setRelationName(relationName);
msgParamBo.setRpn(rpn);
jpushMsgBo = this.getJushMessageInfo(msgParamBo);
}
//1.3.更新fmea的rpn、风险等级及newOid
......@@ -1286,6 +1305,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if (rpnValueBo.isEmpty()) {
return;
}
Fmea caluFmea=fmeaMapper.getById(fmeaId);
Integer rpnDiffer=caluFmea.getRpn().intValue()-caluFmea.getRpni().intValue();
String checkStatus=jpushMsgBo.getMsg().getCheckStatus();
BigDecimal rpn = rpnValueBo.getRpn();
BigDecimal rpni = rpnValueBo.getRpni();
List<RiskLevel> levels = riskLevelDao.findAll();
......@@ -1305,9 +1327,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//3.更新父节点rpn、rpni、风险等级
this.updateParentRpn(riskSource.getParentId());
//4.极光推送给手机客户端
if(notifyType=="recovery"||notifyType=="fmeaUpdate"||(notifyType=="alarm"&&rpnDiffer>0)||(notifyType=="patrol"&&rpnDiffer>0&&checkStatus.equals("不合格")))
jpushRiskSourceMessage(jpushMsgBo);
//5.规则告警(消息)TODO
notifyRule(riskSourceId, rpn, rpni, notifyType,changeType);
if(notifyType=="recovery"||notifyType=="fmeaUpdate"||(notifyType=="alarm"&&rpnDiffer>0)||(notifyType=="patrol"&&rpnDiffer>0&&checkStatus.equals("不合格")))
notifyRule(riskSourceId, rpn, rpni, notifyType,changeType, jpushMsgBo.getMsg());
//6.通知全景监控屏幕数据刷新
iDataRefreshService.refreshViewData(DataRefreshTypeEum.rpn.getCode());
}
......@@ -1412,15 +1436,19 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
BigDecimal rpnr,
BigDecimal rpni,
String notifyType,
String changeType) {
String changeType, JpushMsgContentBo msgContentBo) {
RiskSourceRuleRo riskSourceRuleRo = new RiskSourceRuleRo();
riskSourceRuleRo.setId(id);
riskSourceRuleRo.setRpnr(rpnr);
riskSourceRuleRo.setRpni(rpni);
riskSourceRuleRo.setLevelChangeType(changeType);
riskSourceRuleRo.setNotifyType(notifyType);
riskSourceRuleRo.setType(notifyType);
riskSourceRuleRo.setContent(msgContentBo.genMessage());
riskSourceRuleRo.setTitle(msgContentBo.getSubject());
riskSourceRuleRo.setRg(String.valueOf(rpnr.subtract(rpni).toBigInteger()));
try {
remoteRuleServer.fireRule(riskSourceRuleRo, "风险管控/riskSource");
// remoteRuleServer.fireRule(riskSourceRuleRo, "风险管控/riskSource");
ruleTrigger.publish(riskSourceRuleRo, "风险管控/riskSource", null);// 没有配决策流,processIds传null即可
} catch (Exception e) {
log.error("调用规则异常", e);
}
......
......@@ -109,7 +109,7 @@ public interface IRiskSourceService {
Integer getChildTypeByPid(Long riskSourceId);
void notifyFmeaFromAbnormal(String toke,String product,String appKey,Long fmeaId, String notifyType,String userName, String relationName);
void notifyFmeaFromAbnormal(String toke,String product,String appKey,Long fmeaId, String notifyType,String userName, String relationName,String checkStatus);
void notifyFmeaFromUpdate(String toke,String product,String appKey,Long fmeaId, String nofityType,String userName);
......
package com.yeejoin.amos.fas.business.service.model;
import com.yeejoin.amos.fas.dao.entity.BusinessEntity;
import java.io.Serializable;
public class BasicsRo implements Serializable {
public class BasicsRo extends BusinessEntity implements Serializable {
private String batchNo;
......
......@@ -49,6 +49,16 @@ public class ProtalDataRo extends BasicsRo {
private List<CheckInputItemRo> items;
private List<CheckInputItemRo> pointInputitems;
public List<CheckInputItemRo> getPointInputitems() {
return pointInputitems;
}
public void setPointInputitems(List<CheckInputItemRo> pointInputitems) {
this.pointInputitems = pointInputitems;
}
public List<CheckInputItemRo> getItems() {
return items;
}
......
......@@ -4,10 +4,11 @@ import java.math.BigDecimal;
public class RiskSourceRuleRo extends BasicsRo {
private static final long serialVersionUID = -1029442967802232957L;
/**
* patrol、equipment、update、delete
*/
private String notifyType;
private String type;
private Long id;
......@@ -16,10 +17,24 @@ public class RiskSourceRuleRo extends BasicsRo {
private BigDecimal rpni;
/**
* 风险增益
*/
private String rg;
/**
* up、down、no
*/
private String levelChangeType;
/**
* 消息内容
*/
private String content;
/**
* 消息标题
*/
private String title;
public Long getId() {
return id;
}
......@@ -52,11 +67,35 @@ public class RiskSourceRuleRo extends BasicsRo {
this.levelChangeType = levelChangeType;
}
public String getNotifyType() {
return notifyType;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getRg() {
return rg;
}
public void setNotifyType(String notifyType) {
this.notifyType = notifyType;
public void setRg(String rg) {
this.rg = rg;
}
}
......@@ -78,6 +78,15 @@ public class RsDataQueue {
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.alarm.getCode(),"",equipmentName,""));
}
public void addEquipmentMessage(Long fmeaId,String equipmentName,Integer state) {
if(state==0){
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.alarmRecovery.getCode(),"",equipmentName,""));
}else{
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.alarm.getCode(),"",equipmentName,""));
}
}
public void addDeleteMessage(Long riskSourceId) {
blockingQueue.add(new FmeaMessage(riskSourceId, TriggerRpnChangeTypeEum.fmeaDelete.getCode()));
}
......@@ -105,12 +114,19 @@ public class RsDataQueue {
Long handId = fmeaMessage.getHandId();
String userName = fmeaMessage.getUserName();
String relationName = fmeaMessage.getRelationName();
String checkStatus =null;
if(fmeaMessage.getCheckStatus()!=null){
checkStatus =(fmeaMessage.getCheckStatus().equals("1"))?"合格":"不合格";
}
if (from.equals(TriggerRpnChangeTypeEum.patrol.getCode())) {
//巡检不合格通知
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName,relationName);
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName,relationName,checkStatus);
} else if (from.equals(TriggerRpnChangeTypeEum.alarm.getCode())) {
//设备告警
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName,relationName);
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName,relationName,checkStatus);
} else if (from.equals(TriggerRpnChangeTypeEum.alarmRecovery.getCode())) {
//设备告警恢复
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName,relationName,checkStatus);
} else if (from.equals(TriggerRpnChangeTypeEum.fmeaUpdate.getCode())) {
//危险因素评价修改通知
riskSourceService.notifyFmeaFromUpdate(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName);
......
......@@ -9,7 +9,7 @@
<parent>
<groupId>com.yeejoin.amos</groupId>
<artifactId>YeeAmosFireAutoSysRoot</artifactId>
<version>2.1.0</version>
<version>2.0.3</version>
</parent>
<dependencies>
......@@ -17,7 +17,7 @@
<dependency>
<groupId>com.yeejoin.amos</groupId>
<artifactId>YeeAmosFireAutoSysService</artifactId>
<version>2.1.0</version>
<version>2.0.3</version>
</dependency>
</dependencies>
......
......@@ -62,4 +62,6 @@ dutyMode.fegin.name=AMOS-DUTY
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
amos.feign.gennerator.use-gateway=false
\ No newline at end of file
spring.application.name = AMOS-AUTOSYS-WJ
spring.application.name = AMOS-AUTOSYS
server.port = 8083
......
......@@ -256,8 +256,7 @@
frs.name riskSourceName
from f_fire_equipment fe
left join f_risk_source frs on frs.id = fe.risk_source_id
where
1=1
<where>
<if test="equipClassify!=null">
and fe.equip_classify in ( ${equipClassify} )
</if>
......@@ -268,6 +267,7 @@
<if test="name!=null">
and (fe.`name` like '%${name}%' or fe.`code` like '%${name}%')
</if>
</where>
LIMIT ${start},${length}
</select>
......@@ -301,8 +301,9 @@
FROM
f_equipment eq
LEFT JOIN f_fire_station fs ON fs.id = eq.fire_station_id
WHERE 1=1
<where>
<if test="id!=null">AND eq.id = #{id}</if>
</where>
</select>
<select id="findAllEquipPointInfo" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">
......@@ -499,4 +500,8 @@
AND fe.`name` like '%${fname}%'
</if>
</select>
<select id="findById" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
select name from f_fire_equipment where id= #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -697,7 +697,7 @@
'riskSource' as type
from f_risk_source rs
left join f_risk_level rl ON rs.risk_level_id = rl.id
where is_region = 'TRUE' AND rs.org_code like CONCAT(#{orgCode},'%')
where is_region = 'TRUE' AND rs.org_code = #{orgCode}
</select>
<select id="findRegionById" resultType="java.util.HashMap">
......@@ -715,7 +715,7 @@
IF(is_region = 'TRUE',1,0) as isRegion,
(select name from f_risk_level where level = r.risk_level_id) as riskLevel
from f_risk_source r
where id=#{id} AND org_code like CONCAT(#{orgCode},'%')
where id=#{id} AND org_code = #{orgCode}
</select>
<update id="batchSaveRegionUe4" parameterType="java.util.List">
......
......@@ -150,7 +150,7 @@
</when>
</choose>
<if test="orgCode != null">
AND R.org_code like CONCAT(#{orgCode},'%')
AND R.org_code = #{orgCode}
</if>
</select>
......@@ -170,7 +170,7 @@
AND rs.id = #{pointId}
</if>
<if test="orgCode != null">
AND rs.org_code like CONCAT(#{orgCode},'%')
AND rs.org_code = #{orgCode}
</if>
</when>
<when test="type == 'patrol'">
......@@ -202,7 +202,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'impEquipment'">
......@@ -218,7 +218,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'monitorEquipment'">
......@@ -234,7 +234,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'video'">
......@@ -250,7 +250,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'hydrant'">
......@@ -266,7 +266,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'pool'">
......@@ -282,7 +282,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'fireCar'">
......@@ -298,7 +298,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'fireEquipment'">
......@@ -314,7 +314,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
<when test="type == 'fireChamber'">
......@@ -330,7 +330,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code like = #{orgCode}
</if>
</when>
<when test="type == 'fireFoamRoom'">
......@@ -346,7 +346,7 @@
AND id = #{pointId}
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
AND org_code = #{orgCode}
</if>
</when>
</choose>
......@@ -397,7 +397,7 @@
where
a.task_no = b.id
and a.`status` in ('2','3')
and (b.org_code = #{orgCode} or b.org_code like CONCAT(#{orgCode},'-','%'))
and b.org_code = #{orgCode}
) pt
where #{date} BETWEEN pt.begin_date and pt.end_date
</select>
......@@ -477,7 +477,7 @@
left JOIN p_plan_task t on t.id=d.task_no
WHERE
DATEDIFF(t.begin_time,CURRENT_DATE) <= 0 AND DATEDIFF(t.end_time,CURRENT_DATE) >= 0
AND (t.org_code = #{org_code} or t.org_code like CONCAT(#{orgCode},'-','%'))
AND t.org_code = #{org_code}
GROUP BY d.status
]]>
</select>
......@@ -487,7 +487,7 @@
FROM f_rpn_change_log n
LEFT JOIN f_risk_source r ON r.id = n.risk_source_id
WHERE n.type = 1
AND (r.org_code = #{org_code} or r.org_code like CONCAT(#{orgCode},'-','%'))
AND r.org_code = #{org_code}
ORDER BY n.create_date desc
limit 0,5
</select>
......@@ -500,7 +500,7 @@
left join p_point I ON I.id = p.point_id
where p.is_ok IN ('2', '3')
AND I.is_delete = 0
AND p.org_code = #{orgCode} or p.org_code like CONCAT(#{orgCode},'-','%')
AND p.org_code = #{orgCode}
ORDER BY p.check_time desc
limit 0,5
</select>
......@@ -617,7 +617,7 @@
FROM f_fire_equipment fe
WHERE fe.id IN (
select fire_equipment_id from f_equipment_fire_equipment
) AND org_code like CONCAT(#{orgCode},'%')
) AND org_code = #{orgCode}
UNION ALL
SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,
TMP.relationKeys,
......@@ -646,7 +646,7 @@
LEFT JOIN
(select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp
ON TMP.equipment_id = e.id
WHERE e.org_code like CONCAT(#{orgCode},'%')
WHERE e.org_code = #{orgCode}
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,
case type
......@@ -683,7 +683,7 @@
when 2 then concat('pool-',id)
end as `key`
FROM f_water_resource
WHERE org_code like CONCAT(#{orgCode},'%')
WHERE org_code = #{orgCode}
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type,'fireChamber' as level,
null as relationKeys,
......@@ -709,7 +709,7 @@
END position,
concat('fireChamber-',id) as `key`
FROM f_fire_station
WHERE type = 1 AND org_code like CONCAT(#{orgCode},'%')
WHERE type = 1 AND org_code = #{orgCode}
UNION ALL
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,
null as relationKeys,
......@@ -735,7 +735,7 @@
END position,
concat('fireCar-',id) as `key`
FROM f_fire_car
WHERE org_code like CONCAT(#{orgCode},'%')
WHERE org_code = #{orgCode}
</select>
<select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
......@@ -754,7 +754,7 @@
r.is_region <![CDATA[<>]]> 'TRUE'
AND R.status = 'ANOMALY'
AND rl.id = r.risk_level_id
AND R.org_code like CONCAT(#{orgCode},'%')
AND R.org_code = #{orgCode}
UNION ALL
select
p.id,p.name,p.point_no as code,p.ue4_location,p.ue4_rotation,
......@@ -779,7 +779,7 @@
end as title
from p_point p
where status in ('0','2','3')
AND p.org_code like CONCAT(#{orgCode},'%')
AND p.org_code = #{orgCode}
UNION ALL
select
distinct e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,
......@@ -795,7 +795,7 @@
left join f_equipment_fire_equipment efe ON e.id = efe.equipment_id
left join f_fire_equipment fe ON efe.fire_equipment_id = fe.id
where fe.equip_status = 1
AND e.org_code like CONCAT(#{orgCode},'%')
AND e.org_code = #{orgCode}
) tmp
where 1=1
<if test="riskSourceId != null">
......@@ -963,7 +963,7 @@
AND temp.type = #{type}
</if>
<if test="orgCode != null">
AND temp.orgCode like CONCAT(#{orgCode},'%')
AND temp.orgCode = #{orgCode}
</if>
</select>
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.yeejoin.amos</groupId>
<artifactId>YeeAmosFireAutoSysRoot</artifactId>
<version>2.1.0</version>
<version>2.0.3</version>
<packaging>pom</packaging>
<name>YeeAmosFireAutoSysRoot</name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment