Commit 2c615322 authored by tianbo's avatar tianbo

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/dao/mapper/CheckMapper.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/CheckServiceImpl.java # amos-boot-system-supervision/src/main/resources/db/mapper/dbTemplate_check.xml
parents a812458c 5c86ce9b
...@@ -519,6 +519,7 @@ AND instance_id = ( ...@@ -519,6 +519,7 @@ AND instance_id = (
jc_user_car jc_user_car
WHERE WHERE
car_id = #{carId} car_id = #{carId}
and is_delete = 0
) )
) and field_code='telephone' ) and field_code='telephone'
) ss ) ss
......
...@@ -184,4 +184,8 @@ public class EquipmentSpecificAlarmLog extends BaseEntity { ...@@ -184,4 +184,8 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("clean_time") @TableField("clean_time")
@ApiModelProperty(value = "消除时间") @ApiModelProperty(value = "消除时间")
private Date cleanTime; private Date cleanTime;
@ApiModelProperty(value = "消除状态")
@TableField(exist = false)
private String cleanStatus;
} }
...@@ -23,6 +23,8 @@ public class AlarmListDataVO { ...@@ -23,6 +23,8 @@ public class AlarmListDataVO {
private String alarmEquip; private String alarmEquip;
private String type;
private String alarmType; private String alarmType;
private String alarmInfo; private String alarmInfo;
...@@ -34,4 +36,6 @@ public class AlarmListDataVO { ...@@ -34,4 +36,6 @@ public class AlarmListDataVO {
private String alarmTypeCode; private String alarmTypeCode;
private String cleanStatus; private String cleanStatus;
}
private String cleanStatusVal;
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
...@@ -264,6 +265,55 @@ public class OrgUsrController extends BaseController { ...@@ -264,6 +265,55 @@ public class OrgUsrController extends BaseController {
page = iOrgUsrService.page(pageBean, orgUsrQueryWrapper); page = iOrgUsrService.page(pageBean, orgUsrQueryWrapper);
return page; return page;
} }
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/new-list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "新列表分页查询---只查询当前登录人本单位下的对应数据信息", notes = "新列表分页查询---只查询当前登录人本单位下的对应数据信息")
public IPage<OrgUsr> newlistPage(String pageNum, String pageSize, OrgUsr orgUsr) {
ReginParams reginParams = getSelectedOrgInfo();
String companyIdString= reginParams.getPersonIdentity().getCompanyId();
orgUsr.setParentId(companyIdString);
Page<OrgUsr> pageBean;
QueryWrapper<OrgUsr> orgUsrQueryWrapper = new QueryWrapper<>();
Class<? extends OrgUsr> aClass = orgUsr.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
Object o = field.get(orgUsr);
if (o != null) {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
}
});
orgUsrQueryWrapper.eq("is_delete", 0);
IPage<OrgUsr> page;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iOrgUsrService.page(pageBean, orgUsrQueryWrapper);
return page;
}
/** /**
* 导入部门信息 * 导入部门信息
......
...@@ -7,6 +7,7 @@ import java.util.List; ...@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.runtime.directive.Break;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
...@@ -158,7 +159,16 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -158,7 +159,16 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
} }
resultList.add(detailMap); resultList.add(detailMap);
}); });
result.add(resultList.get(0)); for (int i = 0; i < resultList.size(); i++) {
if (resultList.get(i).size() == 4){
result.add(resultList.get(i));
}
if (result.size()>0){
break;
}
}
return result; return result;
} }
......
...@@ -323,6 +323,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -323,6 +323,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 发起主表流程 并添加至报修日志 // 发起主表流程 并添加至报修日志
failureDetailsDto.setSubmissionTime(new Date()); failureDetailsDto.setSubmissionTime(new Date());
failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_AUDIT.getCode());
FailureDetailsDto model = this.updateWithModel(failureDetailsDto); FailureDetailsDto model = this.updateWithModel(failureDetailsDto);
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) { if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
......
...@@ -85,10 +85,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail ...@@ -85,10 +85,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId()); FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId());
List<FailureVerify> byfaultId = findByfaultId(failureDetailsDto.getSequenceNbr()); List<FailureVerify> byfaultId = findByfaultId(failureDetailsDto.getSequenceNbr());
if (byfaultId.size() != 0) { if (byfaultId.size() != 0 && status.getCode().equals(FailureStatuEnum.FINISH.getCode())) {
failureDetailsDto.setCurrentStatus(status.getCode()); failureDetailsDto.setCurrentStatus(status.getCode());
} }
if (condition == AuditResultEnum.REFUSE.getCode()){
failureDetailsDto.setCurrentStatus(status.getCode());
}
failureDetailsDto.setSequenceNbr(model.getFaultId()); failureDetailsDto.setSequenceNbr(model.getFaultId());
failureDetailsService.updateWithModel(failureDetailsDto); failureDetailsService.updateWithModel(failureDetailsDto);
......
...@@ -818,7 +818,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -818,7 +818,7 @@ public class MaintenanceCompanyServiceImpl
// 查询公司下人列表 // 查询公司下人列表
List<MaintenanceCompany> personList = list(new LambdaQueryWrapper<MaintenanceCompany>() List<MaintenanceCompany> personList = list(new LambdaQueryWrapper<MaintenanceCompany>()
.eq(MaintenanceCompany::getIsDelete, false).eq(MaintenanceCompany::getType, PERSON) .eq(MaintenanceCompany::getIsDelete, false).eq(MaintenanceCompany::getType, PERSON)
.likeRight(MaintenanceCompany::getCode, company.getCode())); .eq(MaintenanceCompany::getParentId,company.getParentId()));
List<Long> instanceIdList = Lists.transform(personList, MaintenanceCompany::getInstanceId); List<Long> instanceIdList = Lists.transform(personList, MaintenanceCompany::getInstanceId);
// 查询手机号 // 查询手机号
List<DynamicFormInstance> dynamicFormInstanceList = dynamicFormInstanceService List<DynamicFormInstance> dynamicFormInstanceList = dynamicFormInstanceService
...@@ -831,7 +831,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -831,7 +831,7 @@ public class MaintenanceCompanyServiceImpl
Map<String, Object> map = Maps.newHashMap(); Map<String, Object> map = Maps.newHashMap();
map.put("sequenceNbr", person.getSequenceNbr()); map.put("sequenceNbr", person.getSequenceNbr());
map.put("name", person.getName()); map.put("name", person.getName());
map.put("tel", dyMap.get(person.getInstanceId()).get(0).getFieldValue()); map.put("tel", dyMap.get(person.getInstanceId()) != null ? dyMap.get(person.getInstanceId()).get(0).getFieldValue() : null);
resultList.add(map); resultList.add(map);
}); });
return resultList; return resultList;
......
...@@ -123,6 +123,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -123,6 +123,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
videoBySpeId.forEach(action -> { videoBySpeId.forEach(action -> {
action.setVedioFormat(vedioFormat);
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("data", specificAlarm); res.put("data", specificAlarm);
......
...@@ -119,7 +119,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe ...@@ -119,7 +119,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
equipmentDetail.setEquPropertyList(equPropertyList); equipmentDetail.setEquPropertyList(equPropertyList);
ManufacturerInfo manufacturerInfo = manufacturerInfoMapper.selectById(equipmentDetail.getManufacturerId()); ManufacturerInfo manufacturerInfo = manufacturerInfoMapper.selectById(equipmentDetail.getManufacturerId());
if (manufacturerInfo != null) { if (manufacturerInfo != null) {
manufacturerInfo.setImg(fileServer + manufacturerInfo.getImg()); manufacturerInfo.setImg(manufacturerInfo.getImg());
} }
equipmentDetail.setManufacturerInfo(manufacturerInfo); equipmentDetail.setManufacturerInfo(manufacturerInfo);
equipmentDetail.setImg(getEquipFileList(id, FileTypeEnum.image.toString())); equipmentDetail.setImg(getEquipFileList(id, FileTypeEnum.image.toString()));
......
...@@ -208,11 +208,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -208,11 +208,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
|| AlarmTypeEnum.PB.getCode().equals(type)) { || AlarmTypeEnum.PB.getCode().equals(type)) {
dataVO.setAlarmType(AlarmTypeEnum.getTypeByCode(String.valueOf(type))); dataVO.setAlarmType(AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
} }
dataVO.setType(String.valueOf(x.get("type")));
dataVO.setAlarmInfo(x.get("fireEquipmentName") + dataVO.getAlarmType()); dataVO.setAlarmInfo(x.get("fireEquipmentName") + dataVO.getAlarmType());
dataVO.setEquipSpeId(Long.valueOf(String.valueOf(x.get("fireEquipmentId")))); dataVO.setEquipSpeId(Long.valueOf(String.valueOf(x.get("fireEquipmentId"))));
dataVO.setAlarmId(Long.valueOf(String.valueOf(x.get("alarmId")))); dataVO.setAlarmId(Long.valueOf(String.valueOf(x.get("alarmId"))));
dataVO.setAlarmTypeCode(String.valueOf(x.get("fireEquipmentSpecificIndexKey"))); dataVO.setAlarmTypeCode(String.valueOf(x.get("fireEquipmentSpecificIndexKey")));
dataVO.setCleanStatus(String.valueOf(x.get("cleanStatus"))); dataVO.setCleanStatus(String.valueOf(x.get("cleanStatus")));
dataVO.setCleanStatusVal(String.valueOf(x.get("cleanStatusVal")));
res.add(dataVO); res.add(dataVO);
}); });
} }
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -42,43 +16,34 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -42,43 +16,34 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment;
import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto; import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto;
import com.yeejoin.equipmanage.common.dto.UserDto; import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO; import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.entity.vo.AlarmVO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.CurrAlaramVO;
import com.yeejoin.equipmanage.common.entity.vo.DetailPaneVO;
import com.yeejoin.equipmanage.common.entity.vo.DevInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.DevOverviewVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSecificDetailVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.ManufacturerVO;
import com.yeejoin.equipmanage.common.entity.vo.PartDetailVO;
import com.yeejoin.equipmanage.common.entity.vo.ProductInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.entity.vo.SurrVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO;
import com.yeejoin.equipmanage.common.entity.vo.TechInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoVO;
import com.yeejoin.equipmanage.common.enums.BillContentEnum;
import com.yeejoin.equipmanage.common.enums.BitmapEnum;
import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.equipmanage.common.enums.FileTypeEnum;
import com.yeejoin.equipmanage.common.enums.StockBillTypeEnum;
import com.yeejoin.equipmanage.common.exception.BaseException; import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.QRCodeUtil; import com.yeejoin.equipmanage.common.utils.QRCodeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig; import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import com.yeejoin.equipmanage.fegin.VideoFeignClient; import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper; import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.UploadFileMapper;
import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.utils.RelationRedisUtil; import com.yeejoin.equipmanage.utils.RelationRedisUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -142,7 +107,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -142,7 +107,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
IEquipmentIndexService iEquipmentIndexService; IEquipmentIndexService iEquipmentIndexService;
@Autowired @Autowired
private IVideoService videoService; private IVideoService videoService;
...@@ -169,7 +134,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -169,7 +134,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
private RelationRedisUtil relationRedisUtil; private RelationRedisUtil relationRedisUtil;
@Autowired @Autowired
private VideoMapper videoMapper; private VideoMapper videoMapper;
...@@ -436,7 +401,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -436,7 +401,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
SimpleDateFormat stf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat stf = new SimpleDateFormat("yyyy-MM-dd");
// @TableField(updateStrategy = FieldStrategy.IGNORED) 置空不生效 为空单独设置 by kongfm 2021-09-10 // @TableField(updateStrategy = FieldStrategy.IGNORED) 置空不生效 为空单独设置 by kongfm 2021-09-10
this.update(new LambdaUpdateWrapper<EquipmentSpecific>().set(EquipmentSpecific::getAgencyId, equipmentSpecific.getAgencyId()).set(EquipmentSpecific::getTeamId, equipmentSpecific.getTeamId()).eq(EquipmentSpecific::getId, equipmentSpecific.getId())); this.update(new LambdaUpdateWrapper<EquipmentSpecific>().set(EquipmentSpecific::getAgencyId, equipmentSpecific.getAgencyId()).set(EquipmentSpecific::getTeamId, equipmentSpecific.getTeamId()).eq(EquipmentSpecific::getId, equipmentSpecific.getId()));
if(equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null){ if (equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null) {
equipmentSpecific.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId()); equipmentSpecific.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId());
} }
boolean updateById = this.updateById(equipmentSpecific); boolean updateById = this.updateById(equipmentSpecific);
...@@ -1027,24 +992,24 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1027,24 +992,24 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
@Override @Override
public Object getOneCard(Long id, String type) { public Object getOneCard(Long id, String type) {
if(BitmapEnum.video.getKey().equals(type)){ if (BitmapEnum.video.getKey().equals(type)) {
AlamVideoVO video = videoMapper.getVideoById(id); AlamVideoVO video = videoMapper.getVideoById(id);
if(!ObjectUtils.isEmpty(video)){ if (!ObjectUtils.isEmpty(video)) {
video.setUrl(videoService.getVideoUrl(video.getName().toString(), video.getPresetPosition(), video.getUrl(), video.getCode())); video.setUrl(videoService.getVideoUrl(video.getName().toString(), video.getPresetPosition(), video.getUrl(), video.getCode()));
video.setId(id); video.setId(id);
} }
return video; return video;
}else{ } else {
DetailPaneVO detailPaneVO = new DetailPaneVO(); DetailPaneVO detailPaneVO = new DetailPaneVO();
Map<String, String> map = this.baseMapper.getQrCodeAndPic(id); Map<String, String> map = this.baseMapper.getQrCodeAndPic(id);
if(ObjectUtils.isEmpty(map)){ if (ObjectUtils.isEmpty(map)) {
return detailPaneVO; return detailPaneVO;
} }
detailPaneVO.setQrCode(map.get("qrCode")); detailPaneVO.setQrCode(map.get("qrCode"));
detailPaneVO.setPic(map.get("pic")); detailPaneVO.setPic(map.get("pic"));
detailPaneVO.setItems(this.baseMapper.getOneCard(id)); detailPaneVO.setItems(this.baseMapper.getOneCard(id));
return detailPaneVO; return detailPaneVO;
} }
} }
...@@ -1197,7 +1162,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1197,7 +1162,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentSpecific.setEquipmentDetailId(equipmentDetail.getId()); equipmentSpecific.setEquipmentDetailId(equipmentDetail.getId());
equipmentSpecific.setQrCode(qrCode); equipmentSpecific.setQrCode(qrCode);
equipmentSpecific.setOrgCode(reginParams.getCompany().getOrgCode()); equipmentSpecific.setOrgCode(reginParams.getCompany().getOrgCode());
if(equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null){ if (equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null) {
equipmentSpecific.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId()); equipmentSpecific.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId());
} }
boolean save = this.save(equipmentSpecific); boolean save = this.save(equipmentSpecific);
...@@ -1275,15 +1240,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1275,15 +1240,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentSpecificBatch.setQrCode(list.get(i)); equipmentSpecificBatch.setQrCode(list.get(i));
equipmentSpecificBatch.setOrgCode(reginParams.getCompany().getOrgCode()); equipmentSpecificBatch.setOrgCode(reginParams.getCompany().getOrgCode());
equipmentSpecificBatch.setEquipmentDetailId(equipmentDetails.get(i).getId()); equipmentSpecificBatch.setEquipmentDetailId(equipmentDetails.get(i).getId());
if(equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null){ if (equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null) {
equipmentSpecificBatch.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId()); equipmentSpecificBatch.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId());
} }
equipmentSpecifics.add(equipmentSpecificBatch); equipmentSpecifics.add(equipmentSpecificBatch);
fireFightSysIdsBuffer.append(equipmentSpecificBatch.getSystemId() + ","); fireFightSysIdsBuffer.append(equipmentSpecificBatch.getSystemId() + ",");
} }
this.saveBatch(equipmentSpecifics); this.saveBatch(equipmentSpecifics);
//4.初始化统计表 //4.初始化统计表
initEquipmentSystemSourceStatistics(equipmentSpecifics); initEquipmentSystemSourceStatistics(equipmentSpecifics);
//没传仓库的情况下,默认单个仓库 //没传仓库的情况下,默认单个仓库
...@@ -1369,7 +1334,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1369,7 +1334,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
buildEquipmentSpecificIndices(equipmentSpecificIndices, equProperties, specific, equipmentData.getEquipmentDetail().getName()); buildEquipmentSpecificIndices(equipmentSpecificIndices, equProperties, specific, equipmentData.getEquipmentDetail().getName());
} }
equipmentSpecificIndexSerivce.saveBatch(equipmentSpecificIndices); equipmentSpecificIndexSerivce.saveBatch(equipmentSpecificIndices);
//页面参数返回数据处理 //页面参数返回数据处理
EquipmentSpecific resultEquipSpec = equipmentSpecifics.get(0); EquipmentSpecific resultEquipSpec = equipmentSpecifics.get(0);
resultEquipSpec.setNum(1); resultEquipSpec.setNum(1);
...@@ -1383,7 +1348,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1383,7 +1348,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentSpecific.setOrgCode(reginParams.getCompany().getOrgCode()); equipmentSpecific.setOrgCode(reginParams.getCompany().getOrgCode());
equipmentSpecific.setEquipmentDetailId(equipmentDetail.getId()); equipmentSpecific.setEquipmentDetailId(equipmentDetail.getId());
equipmentSpecific.setCreateDate(new Date()); equipmentSpecific.setCreateDate(new Date());
if(equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null){ if (equipmentSpecific.getStockDetail() != null && equipmentSpecific.getStockDetail().getWarehouseStructureId() != null) {
equipmentSpecific.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId()); equipmentSpecific.setWarehouseStructureId(equipmentSpecific.getStockDetail().getWarehouseStructureId());
} }
//插入设备数据 //插入设备数据
...@@ -1629,26 +1594,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1629,26 +1594,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
public Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) { public Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) {
Long equipmentSpecificId = videoOnEquipmentSpecificVo.getEquipmentSpecificId(); Long equipmentSpecificId = videoOnEquipmentSpecificVo.getEquipmentSpecificId();
List<Long> videoIdList = videoOnEquipmentSpecificVo.getVideoIdList(); List<Long> videoIdList = videoOnEquipmentSpecificVo.getVideoIdList();
if (equipmentSpecificId != null && !CollectionUtils.isEmpty(videoIdList)) { if (equipmentSpecificId != null) {
EquipmentSpecific equipmentSpecific = this.baseMapper.selectById(equipmentSpecificId); EquipmentSpecific equipmentSpecific = this.baseMapper.selectById(equipmentSpecificId);
if (!ObjectUtils.isEmpty(equipmentSpecific)) { if (!ObjectUtils.isEmpty(equipmentSpecific)) {
List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>(); QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
List<VideoEquipmentSpecific> list = videoEquipmentSpecificService.findBySpecificIdAndVideoIdIn(equipmentSpecificId, videoIdList); queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
if (!CollectionUtils.isEmpty(list)) { boolean remove = videoEquipmentSpecificService.remove(queryWrapper);
List<Long> collect = list.stream().map(VideoEquipmentSpecific::getVideoId).collect(Collectors.toList()); if (remove) {
// videoIdList - collect List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>();
List<Long> reduce = videoIdList.stream().filter(item -> !collect.contains(item)).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(reduce)) {
reduce.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setVideoId(x);
videoEquipmentSpecific.setEquipmentSpecificId(equipmentSpecificId);
videoSpecificList.add(videoEquipmentSpecific);
});
videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE;
}
} else {
videoIdList.parallelStream().forEach(x -> { videoIdList.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific(); VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setVideoId(x); videoEquipmentSpecific.setVideoId(x);
...@@ -1657,13 +1610,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1657,13 +1610,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}); });
videoEquipmentSpecificService.saveBatch(videoSpecificList); videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE; return Boolean.TRUE;
} else {
throw new RuntimeException("移除设备摄像头绑定关系失败!");
} }
} else { } else {
throw new RuntimeException("未获取到此设备!"); throw new RuntimeException("未获取到此设备!");
} }
} else { } else {
throw new RuntimeException("设备ID或摄像头ID集合为空!"); throw new RuntimeException("设备ID为空!");
} }
return Boolean.FALSE;
} }
} }
...@@ -121,7 +121,11 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc ...@@ -121,7 +121,11 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
String aircraft = ""; String aircraft = "";
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList()); List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList());
if(list1.size() > 0) { if(list1.size() > 0) {
aircraft = list1.get(0).getFieldValueCode(); if(ValidationUtil.isEmpty(list1.get(0).getFieldValue())) {
aircraft = list1.get(0).getFieldValue();
} else {
aircraft = list1.get(0).getFieldValueCode();
}
} }
LambdaQueryWrapper<Aircraft> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Aircraft> queryWrapper = new LambdaQueryWrapper<>();
......
...@@ -640,11 +640,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -640,11 +640,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/* /*
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); } * if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
*/ */
// if("flightNumber".equals(alertFormValue.getFieldCode()) || "aircraftModel".equals(alertFormValue.getFieldCode())) { if("flightNumber".equals(alertFormValue.getFieldCode())) {
// listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode())); listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode()));
// } else { } else {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode)); if( "aircraftModel".equals(alertFormValue.getFieldCode())) {
// } if(ValidationUtil.isEmpty(valueCode)) {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode()));
} else {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
}
} else {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
}
}
}); });
map.put("data", listdate); map.put("data", listdate);
......
...@@ -1491,7 +1491,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1491,7 +1491,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (designatedDriver) { if (designatedDriver) {
// 发送单个车辆的信息数据到客户 // 发送单个车辆的信息数据到客户
smsParams.put("resourcesNum", smsParams.put("resourcesNum",
resourcesNum.toString().substring(resourcesNum.toString().length() - 2)); resourcesNum.toString());
List<AlertSubmittedObject> alertSubmittedObjectListSub = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectListSub = Lists.newArrayList();
Map<String, Object> map = dynamicFormInstanceMapper Map<String, Object> map = dynamicFormInstanceMapper
.getCurentCarIsUserPhone(Long.parseLong(i.getResourcesId())); .getCurentCarIsUserPhone(Long.parseLong(i.getResourcesId()));
......
...@@ -543,10 +543,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -543,10 +543,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
responseLevel = list1.get(0).getFieldValue(); responseLevel = list1.get(0).getFieldValue();
} }
definitions.put("rescueGrid", alertCalled.getAddress()); definitions.put("rescueGrid", ValidationUtil.isEmpty(alertCalled.getAddress() ) ? "" : alertCalled.getAddress());
definitions.put("type", alertCalled.getAlertType()); definitions.put("type", alertCalled.getAlertType());
definitions.put("contactUser", alertCalled.getContactUser()); definitions.put("contactUser", ValidationUtil.isEmpty(alertCalled.getContactUser() ) ? "" : alertCalled.getContactUser());
definitions.put("contactPhone", alertCalled.getContactPhone()); definitions.put("contactPhone", ValidationUtil.isEmpty(alertCalled.getContactPhone() ) ? "" : alertCalled.getContactPhone());
definitions.put("replaceContent", replaceContent); definitions.put("replaceContent", replaceContent);
definitions.put("responseLevel", responseLevel); definitions.put("responseLevel", responseLevel);
definitions.put("callTime", definitions.put("callTime",
......
...@@ -586,4 +586,14 @@ public class CheckController extends AbstractBaseController { ...@@ -586,4 +586,14 @@ public class CheckController extends AbstractBaseController {
return CommonResponseUtil.success(page); return CommonResponseUtil.success(page);
} }
/**
* 根据检查记录查询照片
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据检查记录查询照片", notes = "根据检查记录查询照片")
@RequestMapping(value = "/getPictureByCheckId", method = RequestMethod.GET)
public CommonResponse getPictureByCheckId(@ApiParam(value = "检查记录ID") @RequestParam String checkId) {
List<String> pictures = checkService.getPictureByCheckId(checkId);
return CommonResponseUtil.success(pictures);
}
} }
...@@ -304,4 +304,6 @@ public interface CheckMapper extends BaseMapper { ...@@ -304,4 +304,6 @@ public interface CheckMapper extends BaseMapper {
* @return * @return
*/ */
List<Check> getCheckListByTaskId(@Param(value = "planTaskId") long id); List<Check> getCheckListByTaskId(@Param(value = "planTaskId") long id);
List<String> getPictureByCheckId(String checkId);
} }
...@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService {
return result; return result;
} }
@Override
public List<String> getPictureByCheckId(String checkId) {
return checkMapper.getPictureByCheckId(checkId);
}
} }
...@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound; import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
...@@ -207,14 +208,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -207,14 +208,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
//组织业务基本数据 对应bizInfo //组织业务基本数据 对应bizInfo
HiddenDangerDto hiddenDangerDto = new HiddenDangerDto(); HiddenDangerDto hiddenDangerDto = new HiddenDangerDto();
hiddenDangerDto.setPlanId(planId); hiddenDangerDto.setPlanId(planId);
hiddenDangerDto.setPointId(pointArray.length > 1 ? Long.parseLong(pointArray[1]) : null); hiddenDangerDto.setPointId(pointArray.length > 1 ? Long.parseLong(StringUtils.trimAllWhitespace(pointArray[1])) : null);
hiddenDangerDto.setPointName(pointArray.length > 1 ? pointArray[0] : null);
hiddenDangerDto.setCheckInputId(seq); hiddenDangerDto.setCheckInputId(seq);
hiddenDangerDto.setDangerType(DangerHandleTypeEnum.SELF.getCode()); hiddenDangerDto.setDangerType(DangerHandleTypeEnum.SELF.getCode());
try { try {
dangerDto.setBizInfo(this.buildBizInfo(hiddenDangerDto)); dangerDto.setBizInfo(this.buildBizInfo(hiddenDangerDto));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(), e);
throw new RuntimeException("组织数据失败"); throw new RuntimeException("组织数据失败!" + e.getMessage());
} }
return dangerDto; return dangerDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -273,6 +275,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -273,6 +275,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
Point point = new Point(); Point point = new Point();
if (!ObjectUtils.isEmpty(hiddenDangerDto.getPointId())) { if (!ObjectUtils.isEmpty(hiddenDangerDto.getPointId())) {
point = iPointDao.findById(hiddenDangerDto.getPointId()).orElseThrow(() -> new RuntimeException("单位不存在")); point = iPointDao.findById(hiddenDangerDto.getPointId()).orElseThrow(() -> new RuntimeException("单位不存在"));
} else {
throw new RuntimeException("单位不存在");
} }
//检查级别 //检查级别
DangerCheckTypeLevelEnum dangerCheckTypeLevelEnum = DangerCheckTypeLevelEnum.getEumByCode(plan.getCheckLevel()); DangerCheckTypeLevelEnum dangerCheckTypeLevelEnum = DangerCheckTypeLevelEnum.getEumByCode(plan.getCheckLevel());
...@@ -288,8 +292,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -288,8 +292,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
result.put("bizId", hiddenDangerDto.getCheckInputId()); result.put("bizId", hiddenDangerDto.getCheckInputId());
result.put("bizName", hiddenDangerDto.getInputItemName()); result.put("bizName", hiddenDangerDto.getInputItemName());
result.put("routeId", plan.getRouteId()); result.put("routeId", plan.getRouteId());
result.put("checkUnitId",plan.getCheckUnitId()); // 检查人所在单位id逗号隔开 result.put("checkUnitId", plan.getCheckUnitId()); // 检查人所在单位id逗号隔开
result.put("checkUnitName",plan.getCheckUnitName());// 检查人所在单位名称逗号隔开 result.put("checkUnitName", plan.getCheckUnitName());// 检查人所在单位名称逗号隔开
result.put("leadPeopleId", plan.getLeadPeopleIds()); // 牵头人id result.put("leadPeopleId", plan.getLeadPeopleIds()); // 牵头人id
result.put("leadPeopleName", plan.getLeadPeopleNames()); // 牵头人名称 result.put("leadPeopleName", plan.getLeadPeopleNames()); // 牵头人名称
result.put("makerUserId", plan.getMakerUserId()); // 计划制定人id result.put("makerUserId", plan.getMakerUserId()); // 计划制定人id
...@@ -314,7 +318,7 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -314,7 +318,7 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
result.put("checkUserId", checkInput.getUserId()); // 任务执行人id result.put("checkUserId", checkInput.getUserId()); // 任务执行人id
result.put("checkUserName", checkInput.getUserName()); // 任务执行人名称 result.put("checkUserName", checkInput.getUserName()); // 任务执行人名称
result.put("accompanyingUserId", checkInput.getAccompanyUserId()); // 检查陪同人id result.put("accompanyingUserId", checkInput.getAccompanyUserId()); // 检查陪同人id
result.put("accompanyingUserName",checkInput.getAccompanyUserName()); // 检查陪同人名称 result.put("accompanyingUserName", checkInput.getAccompanyUserName()); // 检查陪同人名称
result.put("planExecuteTime", checkInput.getCreateDate()); // 计划任务执行时间 result.put("planExecuteTime", checkInput.getCreateDate()); // 计划任务执行时间
result.put("checkPhotoUrl", shotList.stream().map(CheckShot::getPhotoData).collect(Collectors.joining(","))); result.put("checkPhotoUrl", shotList.stream().map(CheckShot::getPhotoData).collect(Collectors.joining(",")));
} }
......
...@@ -282,4 +282,6 @@ public interface ICheckService { ...@@ -282,4 +282,6 @@ public interface ICheckService {
int checkHasRecord(Long planTaskId, Long pointId); int checkHasRecord(Long planTaskId, Long pointId);
Page<CheckVo> queryPage(CheckPageParam criterias); Page<CheckVo> queryPage(CheckPageParam criterias);
List<String> getPictureByCheckId(String checkId);
} }
...@@ -9,7 +9,10 @@ import java.util.Date; ...@@ -9,7 +9,10 @@ import java.util.Date;
*/ */
@Data @Data
public class CheckVo { public class CheckVo {
/**
* checkId
*/
private Long checkId;
/** /**
* 主键id * 主键id
*/ */
......
...@@ -632,23 +632,18 @@ ORDER BY ...@@ -632,23 +632,18 @@ ORDER BY
-- ---------------------------- -- ----------------------------
DROP VIEW IF EXISTS `v_equip_alarm_today_statistics`; DROP VIEW IF EXISTS `v_equip_alarm_today_statistics`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip_alarm_today_statistics` AS SELECT CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip_alarm_today_statistics` AS SELECT
count( (
`confirm_type` count(1) - count(
) AS `confirmed`, `clean_time`
)
) AS `unCleaned`,
( (
count(1) - count( count(1) - count(
`confirm_type` `confirm_type`
) )
) AS `pending` ) AS `pending`
FROM FROM
`wl_equipment_specific_alarm_log` `wl_equipment_specific_alarm_log`;
WHERE
(
cast(now() AS date) = cast(
`create_date` AS date
)
);
-- ---------------------------- -- ----------------------------
-- View structure for v_equip_fire_control_water -- View structure for v_equip_fire_control_water
...@@ -674,10 +669,8 @@ SELECT ...@@ -674,10 +669,8 @@ SELECT
`sal`.`equipment_specific_index_key` AS `indexKey`, `sal`.`equipment_specific_index_key` AS `indexKey`,
`sal`.`equipment_specific_index_name` AS `indexName`, `sal`.`equipment_specific_index_name` AS `indexName`,
`sal`.`equipment_specific_id` AS `specificId`, `sal`.`equipment_specific_id` AS `specificId`,
concat( IF
sal.equipment_specific_name, ( `sal`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
sal.equipment_specific_index_name
) AS alamReason,
`sal`.`iot_code` AS `iotCode`, `sal`.`iot_code` AS `iotCode`,
date_format( date_format(
`sal`.`create_date`, `sal`.`create_date`,
...@@ -5794,27 +5787,153 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip ...@@ -5794,27 +5787,153 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip
-- 火灾报警系统4小告警列表前60 -- 火灾报警系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_alarm`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_alarm`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_alarm` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000016',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_alarm` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000016', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- CAFS系统4小告警列表前60 -- CAFS系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_cafs`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_cafs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_cafs` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000023',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_cafs` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000023', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 预混泡沫灭火系统4小告警列表前60 -- 预混泡沫灭火系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000054',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000054', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 细水雾涡扇炮系统4小告警列表前60 -- 细水雾涡扇炮系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam_mist`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam_mist`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam_mist` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('011023306003010000000082',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam_mist` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '011023306003010000000082', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 排油系统4小告警列表前60 -- 排油系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_ONL`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_onl`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_onl` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000030',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_onl` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000030', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 消防给水系统4小告警列表前60 -- 消防给水系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_water`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_water`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_water` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000047',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_water` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000047', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 消防人员视图 -- 消防人员视图
DROP VIEW IF EXISTS `v_fire_fighter`; DROP VIEW IF EXISTS `v_fire_fighter`;
......
...@@ -44,7 +44,9 @@ ...@@ -44,7 +44,9 @@
confirm_user, confirm_user,
confirm_user_name, confirm_user_name,
confirm_date, confirm_date,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,spe.system_id)) as systemName (SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,spe.system_id)) as systemName,
if(ala.clean_time is null, '未清除', '已清除') AS cleanStatus,
ala.clean_time
from from
wl_equipment_specific_alarm_log as ala wl_equipment_specific_alarm_log as ala
left join wl_equipment_specific as spe on spe.id = ala.equipment_specific_id left join wl_equipment_specific as spe on spe.id = ala.equipment_specific_id
......
...@@ -311,6 +311,11 @@ ...@@ -311,6 +311,11 @@
'已消除', '已消除',
'未消除' '未消除'
) cleanStatus, ) cleanStatus,
IF (
wlesal.clean_time IS NOT NULL,
'1',
'2'
) cleanStatusVal,
wlesal.confirm_type AS handleType, wlesal.confirm_type AS handleType,
wlesal.system_codes AS systemCodes, wlesal.system_codes AS systemCodes,
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
...@@ -370,7 +375,7 @@ ...@@ -370,7 +375,7 @@
</choose> </choose>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if> <if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if> <if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN' or param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if> <if test="param.alarmType != null and param.alarmType != ''">AND d.type = #{param.alarmType}</if>
<if test="param.systemCode != null and param.systemCode != ''"> <if test="param.systemCode != null and param.systemCode != ''">
AND find_in_set(#{param.systemCode},d.systemCodes) AND find_in_set(#{param.systemCode},d.systemCodes)
</if> </if>
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
ci.input_name as inputItemName, ci.input_name as inputItemName,
ci.user_name as checkUserName, ci.user_name as checkUserName,
ci.create_date as checkTime, ci.create_date as checkTime,
c.point_name pp.name as pointName
FROM `p_hidden_danger` phd FROM `p_hidden_danger` phd
left join p_check_input ci on phd.check_input_id = ci.id left join p_check_input ci on phd.check_input_id = ci.id
left join p_check c on c.id = phd.check_id left join p_point pp on pp.id = phd.point_id
<where> <where>
<if test="planId !=null and planId != ''">and phd.plan_id=#{planId}</if> <if test="planId !=null and planId != ''">and phd.plan_id=#{planId}</if>
<if test="pointId !=null and pointId != ''">and phd.point_id=#{pointId}</if> <if test="pointId !=null and pointId != ''">and phd.point_id=#{pointId}</if>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if> <if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if>
<if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if> <if test="departmentId!=null and departmentId!='-1'">and find_in_set(#{departmentId}, a.dep_id) > 0</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is
null) null)
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
THEN '2' THEN '2'
END END
) AS `Finish_Status`, ) AS `Finish_Status`,
a.is_ok is_ok, a.is_ok is_ok,
a.score, a.score,
d.`name` AS `route_name`, d.`name` AS `route_name`,
a.check_mode, a.check_mode,
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id` LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY
check_id ) t ON t.check_id = a.id
</if> </if>
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if> <if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>
...@@ -127,7 +128,7 @@ ...@@ -127,7 +128,7 @@
<if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<if test="checkTime!=null">and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')</if> <if test="checkTime!=null">and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')</if>
<if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if> <if test="departmentId!=null and departmentId!='-1'">and find_in_set(#{departmentId}, a.dep_id) > 0</if>
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if> <if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if> <if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<choose> <choose>
...@@ -211,7 +212,8 @@ ...@@ -211,7 +212,8 @@
order by ci.order_no order by ci.order_no
</select> </select>
<select id="findCheckPointInputItem" resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo" <select id="findCheckPointInputItem"
resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo"
parameterType="long"> parameterType="long">
SELECT SELECT
pp.id pointId, pp.id pointId,
...@@ -250,16 +252,16 @@ ...@@ -250,16 +252,16 @@
order by pci.order_no order by pci.order_no
</select> </select>
<!-- <select id="checkHasRecord" resultType="int">--> <!-- <select id="checkHasRecord" resultType="int">-->
<!-- SELECT--> <!-- SELECT-->
<!-- count(1) num--> <!-- count(1) num-->
<!-- FROM--> <!-- FROM-->
<!-- p_check c--> <!-- p_check c-->
<!-- WHERE--> <!-- WHERE-->
<!-- is_ok in (1,2)--> <!-- is_ok in (1,2)-->
<!-- and c.point_id = #{pointId}--> <!-- and c.point_id = #{pointId}-->
<!-- and c.plan_task_id = #{planTaskId}--> <!-- and c.plan_task_id = #{planTaskId}-->
<!-- </select>--> <!-- </select>-->
<select id="pieChartData" resultType="Map"> <select id="pieChartData" resultType="Map">
SELECT SELECT
...@@ -334,7 +336,7 @@ ...@@ -334,7 +336,7 @@
<if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if> <if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if>
<if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if> <if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if>
<if test="userId != null and userId != '' "> <if test="userId != null and userId != '' ">
AND FIND_IN_SET(#{userId}, c.user_id) > 0 AND FIND_IN_SET(#{userId}, c.user_id) > 0
</if> </if>
<if test="planId != null and planId != '' "> <if test="planId != null and planId != '' ">
AND c.plan_id = #{planId} AND c.plan_id = #{planId}
...@@ -475,7 +477,7 @@ ...@@ -475,7 +477,7 @@
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and `a`.`is_ok` = 3</when>
</choose> </choose>
<if test="departmentId!=null"> and find_in_set(#{departmentId},a.dep_id)>0 </if> <if test="departmentId!=null">and find_in_set(#{departmentId},a.dep_id)>0</if>
</trim> </trim>
</select> </select>
...@@ -658,12 +660,12 @@ ...@@ -658,12 +660,12 @@
sum(missed_check_num) forNum sum(missed_check_num) forNum
FROM FROM
p_plan_exec_statistics p_plan_exec_statistics
<where> <where>
<if test="orgCode!=null">AND LOCATE(#{orgCode}, org_Code) <![CDATA[>]]>0</if> <if test="orgCode!=null">AND LOCATE(#{orgCode}, org_Code) <![CDATA[>]]>0</if>
<if test="userId !=null">and user_id = #{userId}</if> <if test="userId !=null">and user_id = #{userId}</if>
AND check_time <![CDATA[>=]]> #{startDate} AND check_time <![CDATA[>=]]> #{startDate}
AND check_time <![CDATA[<=]]> #{endDate} AND check_time <![CDATA[<=]]> #{endDate}
</where> </where>
GROUP BY check_time GROUP BY check_time
) fa ) fa
...@@ -795,12 +797,13 @@ ...@@ -795,12 +797,13 @@
FROM FROM
p_point_classify classify p_point_classify classify
<where> <where>
classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE <if test="checkID != null">pci.check_id = #{checkID}</if> ) classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE <if test="checkID != null">
pci.check_id = #{checkID}
</if> )
</where> </where>
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getCheckInputByCheckId" resultMap="checkInputResultMap"> <select id="getCheckInputByCheckId" resultMap="checkInputResultMap">
SELECT SELECT
...@@ -831,32 +834,33 @@ ...@@ -831,32 +834,33 @@
LEFT JOIN p_input_item ii ON ci.input_id = ii.id LEFT JOIN p_input_item ii ON ci.input_id = ii.id
LEFT JOIN p_check c ON ci.check_id = c.id LEFT JOIN p_check c ON ci.check_id = c.id
<where> <where>
<if test="checkID != null"> <if test="checkID != null">
AND ci.check_id = #{checkID} AND ci.check_id = #{checkID}
</if> </if>
<if test="pointID != null"> <if test="pointID != null">
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
</where> </where>
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getCheckEquipByCheckID" resultType="java.util.HashMap" parameterType="java.lang.Long"> <select id="getCheckEquipByCheckID" resultType="java.util.HashMap" parameterType="java.lang.Long">
SELECT SELECT
classify.id as classifyId, classify.id as classifyId,
classify.name as equipmentName, classify.name as equipmentName,
classify.equipment_id as equipmentId, classify.equipment_id as equipmentId,
(SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate (SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate
FROM FROM
p_point_classify classify p_point_classify classify
WHERE WHERE
classify.id IN ( classify.id IN (
SELECT SELECT
pci.point_classify_id pci.point_classify_id
FROM p_check_input pci WHERE FROM p_check_input pci WHERE
<if test="pointID != null"> <if test="pointID != null">
pci.check_id = #{checkID} pci.check_id = #{checkID}
</if> ) </if>
)
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getEquipInputByCheckId" resultType="java.util.HashMap"> <select id="getEquipInputByCheckId" resultType="java.util.HashMap">
...@@ -899,7 +903,7 @@ ...@@ -899,7 +903,7 @@
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
<if test="classifyId != null"> <if test="classifyId != null">
AND ci.point_classify_id = #{classifyId} AND ci.point_classify_id = #{classifyId}
</if> </if>
</where> </where>
</select> </select>
...@@ -937,7 +941,7 @@ ...@@ -937,7 +941,7 @@
<!-- 根据巡检记录ID和巡检点ID获取巡检详情 --> <!-- 根据巡检记录ID和巡检点ID获取巡检详情 -->
<select id="getCheckDetailByID" resultMap="checkDetailResultMap"> <select id="getCheckDetailByID" resultMap="checkDetailResultMap">
SELECT SELECT
c.user_id AS userId, c.user_id AS userId,
c.dep_id AS depId, c.dep_id AS depId,
c.check_time AS CheckTime, c.check_time AS CheckTime,
...@@ -975,12 +979,12 @@ ...@@ -975,12 +979,12 @@
LEFT JOIN p_plan pl ON c.plan_id = pl.id LEFT JOIN p_plan pl ON c.plan_id = pl.id
LEFT JOIN p_route r ON r.id = c.route_id LEFT JOIN p_route r ON r.id = c.route_id
<where> <where>
<if test="checkID != null and checkID!= -1"> <if test="checkID != null and checkID!= -1">
AND c.id = #{checkID} AND c.id = #{checkID}
</if> </if>
<if test="pointID != null"> <if test="pointID != null">
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
</where> </where>
ORDER BY ORDER BY
c.check_time DESC c.check_time DESC
...@@ -1092,7 +1096,8 @@ ...@@ -1092,7 +1096,8 @@
<!-- 风险点最新巡检信息查询,3d屏使用 --> <!-- 风险点最新巡检信息查询,3d屏使用 -->
<resultMap id="planRoutePointResultMap" type="com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo"> <resultMap id="planRoutePointResultMap"
type="com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo">
<result property="routeName" column="route_name"/> <result property="routeName" column="route_name"/>
<result property="planName" column="plan_name"/> <result property="planName" column="plan_name"/>
<result property="deptName" column="department_name"/> <result property="deptName" column="department_name"/>
...@@ -1189,7 +1194,7 @@ ...@@ -1189,7 +1194,7 @@
) sa ) sa
<where> <where>
c.plan_id = sa.id c.plan_id = sa.id
<if test="userId != null">AND find_in_set(#{userId}, sa.user_id) >0 </if> <if test="userId != null">AND find_in_set(#{userId}, sa.user_id) >0</if>
<if test="checkDate != null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d') <if test="checkDate != null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d')
</if> </if>
</where> </where>
...@@ -1218,13 +1223,13 @@ ...@@ -1218,13 +1223,13 @@
a.route_id AS routeID, a.route_id AS routeID,
b.name AS name, b.name AS name,
(SELECT (SELECT
GROUP_CONCAT( GROUP_CONCAT(
`name` `name`
) )
FROM FROM
s_user u s_user u
WHERE WHERE
find_in_set(u.id,a.user_id)>0 ) AS realName, find_in_set(u.id,a.user_id)>0 ) AS realName,
a.id AS planID a.id AS planID
FROM FROM
p_plan a, p_plan a,
...@@ -1235,7 +1240,7 @@ ...@@ -1235,7 +1240,7 @@
) sa ) sa
WHERE WHERE
d.plan_id = sa.planID d.plan_id = sa.planID
<if test="userId != null">AND find_in_set(#{userId}, sa.userID)>0 </if> <if test="userId != null">AND find_in_set(#{userId}, sa.userID)>0</if>
<if test="checkDate != null">AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}</if> <if test="checkDate != null">AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}</if>
ORDER BY d.id DESC ORDER BY d.id DESC
) temp_row ) temp_row
...@@ -1523,7 +1528,7 @@ ...@@ -1523,7 +1528,7 @@
a.checkMonth a.checkMonth
</when> </when>
</choose> --> </choose> -->
select select
<choose> <choose>
<when test=" statisticsTyle == 0 "> <when test=" statisticsTyle == 0 ">
a.planName name, a.planName name,
...@@ -1571,7 +1576,7 @@ ...@@ -1571,7 +1576,7 @@
pt.id pointId, pt.id pointId,
c.user_id userName, c.user_id userName,
c.dep_id deptName, c.dep_id deptName,
c.user_id userId, c.user_id userId,
c.dep_id departmentId, c.dep_id departmentId,
c.score, c.score,
c.id checkId, c.id checkId,
...@@ -1612,7 +1617,7 @@ ...@@ -1612,7 +1617,7 @@
LEFT JOIN p_point pt ON c.point_id = pt.id LEFT JOIN p_point pt ON c.point_id = pt.id
WHERE 1=1 WHERE 1=1
<if test="orgCode!=null"> <if test="orgCode!=null">
and (c.org_code LIKE CONCAT( #{orgCode}, '-%' ) or c.org_code= #{orgCode} ) and (c.org_code LIKE CONCAT( #{orgCode}, '-%' ) or c.org_code= #{orgCode} )
</if> </if>
<choose> <choose>
<when test=" statisticsTyle == 1 "> <when test=" statisticsTyle == 1 ">
...@@ -1685,110 +1690,110 @@ ...@@ -1685,110 +1690,110 @@
ADDDATE(#{startTime} , INTERVAL @d DAY)<![CDATA[ < ]]> DATE_FORMAT(#{endTime}, '%Y-%m-%d') ADDDATE(#{startTime} , INTERVAL @d DAY)<![CDATA[ < ]]> DATE_FORMAT(#{endTime}, '%Y-%m-%d')
) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date ) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date
<if test=" orgCode != null and orgCode != '' ">and position( #{orgCode} in c.org_code )</if> <if test=" orgCode != null and orgCode != '' ">and position( #{orgCode} in c.org_code )</if>
<if test=" userId != null and userId != '' ">and find_in_set(#{userId}, c.user_id)>0 </if> <if test=" userId != null and userId != '' ">and find_in_set(#{userId}, c.user_id)>0</if>
<if test="type == 1">and c.is_ok != #{param}</if> <if test="type == 1">and c.is_ok != #{param}</if>
<if test="type == 2">and c.plan_id != #{param}</if> <if test="type == 2">and c.plan_id != #{param}</if>
<if test="type == 3">and c.is_ok = #{param}</if> <if test="type == 3">and c.is_ok = #{param}</if>
<where> <where>
<if test="startTime !=null and startTime!= '' "> <![CDATA[ AND d.date >= #{startTime} ]]> </if> <if test="startTime !=null and startTime!= '' "> <![CDATA[ AND d.date >= #{startTime} ]]> </if>
<if test="endTime !=null and endTime!='' "><![CDATA[AND d.date < #{endTime} ]]></if> <if test="endTime !=null and endTime!='' "><![CDATA[AND d.date < #{endTime} ]]></if>
</where> </where>
group by d.date group by d.date
order BY d.date order BY d.date
</select> </select>
<!-- 巡检记录查询 --> <!-- 巡检记录查询 -->
<!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">--> <!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">-->
<!-- select * from (--> <!-- select * from (-->
<!-- SELECT--> <!-- SELECT-->
<!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,--> <!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,-->
<!-- c.user_id as UserID,--> <!-- c.user_id as UserID,-->
<!-- c.point_id as PointID,--> <!-- c.point_id as PointID,-->
<!-- c.id as CheckID,--> <!-- c.id as CheckID,-->
<!-- c.is_ok as IsOK,--> <!-- c.is_ok as IsOK,-->
<!-- c.error as ErrorMsg,--> <!-- c.error as ErrorMsg,-->
<!-- c.plan_task_id as ErrorID,--> <!-- c.plan_task_id as ErrorID,-->
<!-- p.name as pointName,--> <!-- p.name as pointName,-->
<!-- c.dep_name as NAME,--> <!-- c.dep_name as NAME,-->
<!-- c.dep_id as GroupID,--> <!-- c.dep_id as GroupID,-->
<!-- c.user_name as RealName,--> <!-- c.user_name as RealName,-->
<!-- (SELECT--> <!-- (SELECT-->
<!-- GROUP_CONCAT(--> <!-- GROUP_CONCAT(-->
<!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)--> <!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)-->
<!-- )--> <!-- )-->
<!-- FROM--> <!-- FROM-->
<!-- s_user u--> <!-- s_user u-->
<!-- WHERE--> <!-- WHERE-->
<!-- find_in_set(u.id,c.user_id)>0) as LoginName,--> <!-- find_in_set(u.id,c.user_id)>0) as LoginName,-->
<!-- c.org_code as orgCode--> <!-- c.org_code as orgCode-->
<!-- FROM--> <!-- FROM-->
<!-- p_check c,--> <!-- p_check c,-->
<!-- p_point p--> <!-- p_point p-->
<!-- where--> <!-- where-->
<!-- p.id =c.point_id ) as a--> <!-- p.id =c.point_id ) as a-->
<!-- <trim prefix="WHERE" prefixOverrides="AND ">--> <!-- <trim prefix="WHERE" prefixOverrides="AND ">-->
<!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>--> <!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>-->
<!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>--> <!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>-->
<!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>--> <!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>-->
<!-- <if test="status!=null">AND a.IsOK = #{status}</if>--> <!-- <if test="status!=null">AND a.IsOK = #{status}</if>-->
<!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>--> <!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>-->
<!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>--> <!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>-->
<!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>--> <!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>-->
<!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>--> <!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>-->
<!-- </trim>--> <!-- </trim>-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="pageSize==-1"></when>--> <!-- <when test="pageSize==-1"></when>-->
<!-- <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>--> <!-- <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>-->
<!-- </choose>--> <!-- </choose>-->
<!-- </select>!&ndash;&gt;--> <!-- </select>!&ndash;&gt;-->
<select id="getCheckInfoList1" resultType="Map"> <select id="getCheckInfoList1" resultType="Map">
select select
c.id as checkID, c.id as checkID,
c.dep_name as name, c.dep_name as name,
c.dep_id as groupID, c.dep_id as groupID,
c.user_name as realName, c.user_name as realName,
c.org_code as orgCode, c.org_code as orgCode,
c.user_id as userID, c.user_id as userID,
c.point_id as pointID, c.point_id as pointID,
c.is_ok as isOK, c.is_ok as isOK,
c.error as errorMsg, c.error as errorMsg,
c.plan_task_id as errorID, c.plan_task_id as errorID,
date_format(c.check_time, '%Y-%m-%d %T') as checkTime, date_format(c.check_time, '%Y-%m-%d %T') as checkTime,
p.name as pointName p.name as pointName
from from
p_check c, p_check c,
p_point p p_point p
where c.point_id = p.id where c.point_id = p.id
<if test="pointID!=null">AND c.point_id = #{pointID}</if> <if test="pointID!=null">AND c.point_id = #{pointID}</if>
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0</if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.error LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.error LIKE concat(concat("%",#{userName}),"%")</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
<if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if>
<if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if> <if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if>
order by c.create_date DESC order by c.create_date DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<!-- 巡检记录统计 --> <!-- 巡检记录统计 -->
<select id="countCheckInfoListData1" resultType="long"> <select id="countCheckInfoListData1" resultType="long">
select select
count(1) count(1)
from from
p_check c, p_check c,
p_point p p_point p
where c.point_id = p.id where c.point_id = p.id
<if test="pointID!=null">AND c.point_id = #{pointID}</if> <if test="pointID!=null">AND c.point_id = #{pointID}</if>
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0</if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.user_name LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.user_name LIKE concat(concat("%",#{userName}),"%")</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
...@@ -1883,11 +1888,11 @@ ...@@ -1883,11 +1888,11 @@
) d ) d
LEFT JOIN p_plan_task c ON DATE_FORMAT(c.check_date, '%Y-%m-%d') = d.date LEFT JOIN p_plan_task c ON DATE_FORMAT(c.check_date, '%Y-%m-%d') = d.date
<if test="orgCode !=null and orgCode!='' "> <if test="orgCode !=null and orgCode!='' ">
AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%')) AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%'))
</if> </if>
WHERE 1=1 WHERE 1=1
<if test="startTime !=null and startTime!= '' "> AND d.date <![CDATA[ >= ]]> #{startTime}</if> <if test="startTime !=null and startTime!= '' ">AND d.date <![CDATA[ >= ]]> #{startTime}</if>
<if test="endTime !=null and endTime!='' "> AND d.date <![CDATA[ < ]]> #{endTime} </if> <if test="endTime !=null and endTime!='' ">AND d.date <![CDATA[ < ]]> #{endTime}</if>
GROUP BY GROUP BY
d.date d.date
ORDER BY ORDER BY
...@@ -1896,22 +1901,22 @@ ...@@ -1896,22 +1901,22 @@
<select id="getItemCount" resultType="long"> <select id="getItemCount" resultType="long">
SELECT SELECT
count(1) count(1)
FROM FROM
p_input_item pii p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1"> <if test="pointId != null and pointId != '' and pointId != -1">
AND ppi.point_id = #{pointId} AND ppi.point_id = #{pointId}
</if> </if>
<choose> <choose>
<when test="status != null and status != '' and status==0"> <when test="status != null and status != '' and status==0">
AND pci.id IS NULL AND pci.id IS NULL
</when> </when>
<when test="status != null and status != '' and status==1"> <when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL AND pci.id IS NOT NULL
...@@ -1924,43 +1929,43 @@ ...@@ -1924,43 +1929,43 @@
<select id="getCheckItems" resultType="Map"> <select id="getCheckItems" resultType="Map">
SELECT SELECT
ppi.id inputItemId, ppi.id inputItemId,
pii.name itemName, pii.name itemName,
pci.id IS NOT NULL finishStatus, pci.id IS NOT NULL finishStatus,
pci.safety_danger_num safetyNum, pci.safety_danger_num safetyNum,
pci.major_danger_num majorNum, pci.major_danger_num majorNum,
DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime, DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime,
pp.name companyName, pp.name companyName,
pci.user_name executeName pci.user_name executeName
FROM FROM
p_input_item pii p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1"> <if test="pointId != null and pointId != '' and pointId != -1">
AND ppi.point_id = #{pointId} AND ppi.point_id = #{pointId}
</if> </if>
<choose> <choose>
<when test="status != null and status != '' and status==0"> <when test="status != null and status != '' and status==0">
AND pci.id IS NULL AND pci.id IS NULL
</when> </when>
<when test="status != null and status != '' and status==1"> <when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL AND pci.id IS NOT NULL
</when> </when>
</choose> </choose>
<if test="teamId != null and teamId != ''"> <if test="teamId != null and teamId != ''">
AND pp.original_id = #{teamId} AND pp.original_id = #{teamId}
</if> </if>
<!-- <if test="status != null and status != ''">--> <!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}--> <!-- AND pc.point_id = #{status}-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="companyName != null and companyName != ''">--> <!-- <if test="companyName != null and companyName != ''">-->
<!-- AND pc.company_name = #{company_name}--> <!-- AND pc.company_name = #{company_name}-->
<!-- </if>--> <!-- </if>-->
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</select> </select>
...@@ -1983,12 +1988,12 @@ ...@@ -1983,12 +1988,12 @@
</select> </select>
<select id="queryPageCount" resultType="long"> <select id="queryPageCount" resultType="long">
SELECT SELECT
COUNT(1) COUNT(1)
FROM FROM
p_check c p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id LEFT JOIN p_input_item i ON i.id = ci.input_id
LEFT JOIN p_point pp ON pp.id = c.point_id LEFT JOIN p_point pp ON pp.id = c.point_id
<where> <where>
<if test="planId != null"> <if test="planId != null">
c.plan_id = #{planId} c.plan_id = #{planId}
...@@ -1999,30 +2004,30 @@ ...@@ -1999,30 +2004,30 @@
<if test="pointId != null and pointId != -1"> <if test="pointId != null and pointId != -1">
AND pp.id = #{pointId} AND pp.id = #{pointId}
</if> </if>
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}--> <!-- AND c.org_code = #{orgCode}-->
<!-- </if>--> <!-- </if>-->
</where> </where>
</select> </select>
<select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.CheckVo"> <select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.CheckVo">
SELECT SELECT
i.id, c.id checkId,
i.`name` inputItemName, i.id,
ci.safety_danger_num, i.`name` inputItemName,
ci.major_danger_num, ci.safety_danger_num,
ci.create_date checkTime, ci.major_danger_num,
ci.user_name, ci.create_date checkTime,
ci.accompany_user_name, ci.user_name,
pp.original_id, ci.accompany_user_name,
pp.name companyName, pp.original_id,
pp.name companyName,
IF IF
( c.check_time IS NULL, 0, 1 ) AS ext ( c.check_time IS NULL, 0, 1 ) AS ext
FROM FROM
p_check c p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id LEFT JOIN p_input_item i ON i.id = ci.input_id
LEFT JOIN p_point pp ON pp.id = c.point_id LEFT JOIN p_point pp ON pp.id = c.point_id
<where> <where>
<if test="planId != null"> <if test="planId != null">
c.plan_id = #{planId} c.plan_id = #{planId}
...@@ -2033,9 +2038,9 @@ ...@@ -2033,9 +2038,9 @@
<if test="pointId != null and pointId != -1"> <if test="pointId != null and pointId != -1">
AND pp.id = #{pointId} AND pp.id = #{pointId}
</if> </if>
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}--> <!-- AND c.org_code = #{orgCode}-->
<!-- </if>--> <!-- </if>-->
ORDER BY c.check_time DESC ORDER BY c.check_time DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
...@@ -2043,7 +2048,17 @@ ...@@ -2043,7 +2048,17 @@
</choose> </choose>
</where> </where>
</select> </select>
<select id="getCheckListByTaskId" resultType="com.yeejoin.amos.supervision.dao.entity.Check"> <select id="getCheckListByTaskId" resultType="com.yeejoin.amos.supervision.dao.entity.Check">
select * from p_check where plan_task_id = #{planTaskId} select * from p_check where plan_task_id = #{planTaskId}
</select> </select>
<select id="getPictureByCheckId" resultType="java.lang.String">
SELECT
photo_data
FROM
p_check_shot
WHERE
check_id = #{checkId}
</select>
</mapper> </mapper>
\ No newline at end of file
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