Commit 8851cdda authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 99dfa155 ad35804c
......@@ -140,5 +140,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> companyTreeByUserToPatrolRoute(Map<String, Object> param);
String getBizOrgCodeByOrgCode(String orgCode);
OrgUsr queryByBizCode(@Param("code") String code);
}
......@@ -1094,6 +1094,20 @@ LEFT JOIN (
AND code = #{companyCode}
</if>
</select>
<select id="queryByBizCode" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT *
FROM cb_org_usr
WHERE is_delete = 0
<if test="code != null and code != ''">
AND biz_org_code = #{code}
</if>
</select>
<select id="getOrgUsrSyncDataList" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgUsrSyncDto">
SELECT
u.*,
......@@ -1151,7 +1165,7 @@ LEFT JOIN (
FROM
cb_org_usr u
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = u.sequence_nbr
LEFT JOIN cb_firefighters cf ON cf.org_usr_id = u.sequence_nbr
LEFT JOIN cb_firefighters cf ON CONCAT( u.sequence_nbr, '' ) = cf.org_usr_id
LEFT JOIN cb_fire_team cft ON cft.sequence_nbr = cf.fire_team_id
WHERE
u.is_delete = 0
......@@ -1173,14 +1187,4 @@ LEFT JOIN (
and usr.is_delete = false
</select>
<select id="getBizOrgCodeByOrgCode" resultType="java.lang.String">
SELECT
biz_org_code
FROM
cb_org_usr
where
is_delete = false
and amos_org_code = #{orgCode}
limit 1
</select>
</mapper>
......@@ -465,6 +465,62 @@ public class DateUtils {
}
/**
* 获取两个日期(不含时分秒)相差的小时
*
* @param startDate
* @param endDate
* @return
* @throws ParseException
*/
public static int dateBetweenNew(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 60);
}
/**
* 获取两个日期(不含时分秒)相差的半小时
*
* @param startDate
* @param endDate
* @return
* @throws ParseException
*/
public static int dateBetweenNew1(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 30);
}
/**
* 获取两个日期(不含时分秒)相差的二小时
*
* @param startDate
* @param endDate
* @return
* @throws ParseException
*/
public static int dateBetweenNew2(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 120);
}
/**
* 获取两个日期(不含时分秒)相差的四小时
*
* @param startDate
* @param endDate
* @return
* @throws ParseException
*/
public static int dateBetweenNew3(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 240);
}
/**
* 获取两个日期(不含时分秒)相差的天数,包含今天
*
* @param startDate
......
......@@ -32,4 +32,6 @@ public class IotIndexResVo {
private List<IotDataVO> iotData;
private String equipId;
}
......@@ -265,9 +265,9 @@ public class KeySiteController extends BaseController {
if (dto.getFireEnduranceRateName() != null){
dto.setFireEnduranceRate(dto.getFireEnduranceRateName());
}
if (dto.getUseNatureName() != null){
dto.setUseNature(dto.getUseNatureName());
}
// if (dto.getUseNatureName() != null){
// dto.setUseNature(dto.getUseNatureName());
// }
if(null != dto.getLongitude() && null != dto.getLatitude()) {
dto.setAddressDesc(dto.getAddressDesc().concat("@address@").concat("{\"longitude\":").
concat(dto.getLongitude().toString().concat(",\"latitude\":").concat(dto.getLatitude().toString().concat("}"))));
......
......@@ -246,7 +246,6 @@ public class OrgPersonController extends BaseController {
@PersonIdentify
@TycloudOperation( ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/listAllByCurrentUserALL", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询(表单用)", notes = "列表分页查询(表单用)")
......
......@@ -3536,7 +3536,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<OrgMenuDto> companyTreeByUserToPatrolRoute(ReginParams reginParams) {
Map<String, Object> param = new HashMap<>();
String bizOrgCode = orgUsrMapper.getBizOrgCodeByOrgCode(reginParams.getCompany().getOrgCode());
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
param.put("bizOrgCode", bizOrgCode);
List<OrgUsr> list = orgUsrMapper.companyTreeByUserToPatrolRoute(param);
return buildTreeParallel(list);
......
......@@ -490,6 +490,16 @@ public class EquipmentAlarmController extends AbstractBaseController {
return CommonResponseUtil.success(map);
}
@RequestMapping(value = "/pressureMessage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站端双月报稳压泵打压频次信息", produces = "application/json;charset=UTF-8", notes = "数字换流站根据id获取装备详情")
public ResponseModel pressureMessage(@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "orgCode") String orgCode,
@RequestParam(value = "endTime") String endTime) {
Map<String, Object> map = iEquipmentSpecificAlarmService.pressureMessage(orgCode, startTime, endTime);
return CommonResponseUtil.success(map);
}
@RequestMapping(value = "/getAllEquipNum", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查装备数量", produces = "application/json;charset=UTF-8", notes = "查装备数量")
......
......@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.constant.Constant;
import com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO;
import com.yeejoin.equipmanage.common.entity.vo.IotIndexInfoVo;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.fegin.IotFeign;
import lombok.extern.slf4j.Slf4j;
......@@ -430,35 +431,39 @@ public class EquipmentSpecificController extends AbstractBaseController {
public ResponseModel getEquipmentIotIndexInfo(@PathVariable String equipSpeId, @RequestParam String beginDate, @RequestParam String endDate,
@RequestParam(required = false) Integer isTrend, @RequestParam(required = false) String fieldKey) {
// 1.根据 equipSpeId 查询装备iotCode
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(equipSpeId);
if (ObjectUtils.isEmpty(equipmentSpecific)) {
return CommonResponseUtil.failure("未查询到装备信息!");
List<IotIndexInfoVo> indexInfoList = new ArrayList<>();
List<String> split= Arrays.asList(equipSpeId.split(","));
for (String s : split) {
// 1.根据 equipSpeId 查询装备iotCode
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(equipSpeId);
if (ObjectUtils.isEmpty(equipmentSpecific)) {
return CommonResponseUtil.failure("未查询到装备信息!");
}
String iotCode = equipmentSpecific.getIotCode();
String prefix = null;
String suffix = null;
if (StringUtil.isNotEmpty(iotCode) && iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
return CommonResponseUtil.failure("装备物联编码错误,请确认!");
}
ResponseModel entity = null;
try {
entity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), beginDate, endDate, prefix, suffix, null);
} catch (Exception e) {
e.printStackTrace();
log.error("调用iot服务出错");
return CommonResponseUtil.failure("请求失败");
}
if (RESULT_SUCCESS_CODE != entity.getStatus() && ObjectUtils.isEmpty(entity.getResult())) {
log.error("查询物联日志数据为空或iotCode为 (" + iotCode + ") 的装备不存在于物联系统中!");
return CommonResponseUtil.failure("物联日志数据为空");
}
indexInfoList.addAll(equipmentSpecificSerivce.getIndexInfoList(iotCode, entity, isTrend, fieldKey));
}
String iotCode = equipmentSpecific.getIotCode();
String prefix = null;
String suffix = null;
if (StringUtil.isNotEmpty(iotCode) && iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
return CommonResponseUtil.failure("装备物联编码错误,请确认!");
}
ResponseModel entity = null;
try {
entity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), beginDate, endDate, prefix, suffix, null);
} catch (Exception e) {
e.printStackTrace();
log.error("调用iot服务出错");
return CommonResponseUtil.failure("请求失败");
}
if (RESULT_SUCCESS_CODE != entity.getStatus() && ObjectUtils.isEmpty(entity.getResult())) {
log.error("查询物联日志数据为空或iotCode为 (" + iotCode + ") 的装备不存在于物联系统中!");
return CommonResponseUtil.failure("物联日志数据为空");
}
return CommonResponseUtil.success(equipmentSpecificSerivce.getIndexInfoList(iotCode, entity, isTrend, fieldKey));
return CommonResponseUtil.success(indexInfoList);
}
......
......@@ -221,6 +221,9 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Map<String, Object> inspectionMessage(@Param("orgCode") String orgCode
, @Param("startTime") String startTime
, @Param("endTime") String endTime);
Map<String, Object> pressureMessage(@Param("orgCode") String orgCode
, @Param("startTime") String startTime
, @Param("endTime") String endTime);
Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
......
......@@ -93,6 +93,7 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
List<Map<String, Object>> fireFacilitiesList(String bizOrgCode, String startTime, String endTime);
Map<String, Object> dailyMaintenance(String bizOrgCode,String orgCode, String startTime, String endTime);
Map<String, Object> inspectionMessage(String orgCode, String startTime, String endTime);
Map<String, Object> pressureMessage(String orgCode, String startTime, String endTime);
Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param);
......
......@@ -760,6 +760,38 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
}
@Override
public Map<String, Object> pressureMessage(String orgCode, String startTime, String endTime) {
Map<String, Object> stringObjectMap = equipmentSpecificAlarmMapper.pressureMessage(orgCode, startTime, endTime);
Map<String, Object> retMap = new HashMap<>();
int allNum = Integer.parseInt(stringObjectMap.get("allNum").toString());
int startNum = Integer.parseInt(stringObjectMap.get("startNum").toString());
// 计算平均每小时打压频率
try {
int hour = DateUtils.dateBetweenNew(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null));
int hafHour = DateUtils.dateBetweenNew1(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null));
int twoHour = DateUtils.dateBetweenNew2(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null));
int fourHour = DateUtils.dateBetweenNew3(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null));
if(allNum/hour > 15) {
retMap.put("status","异常");
} else {
retMap.put("status","正常");
}
retMap.put("name", stringObjectMap.get("name").toString());
String frequency = "稳压泵总数"+stringObjectMap.get("allEqu").toString()+"台,平均近半小时启动"+startNum/hafHour+"次,"+
"平均2小时启动"+startNum/twoHour+"次,"+"平均4小时启动"+startNum/fourHour+"次";
retMap.put("frequency",frequency);
} catch (ParseException e) {
e.printStackTrace();
}
return retMap;
}
@Override
public Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
return this.baseMapper.fireAlarmLogPage(result, param);
......
package com.yeejoin.equipmanage.service.impl;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -434,6 +435,41 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
if (ValidationUtil.isEmpty(x.getBizOrgName())) {
throw new RuntimeException("机构/部门名称不能为空,请修改后上传!");
}
//字段长度效验
if (ValidationUtil.isEmpty(x.getName())&&x.getName().length()>100) {
throw new RuntimeException("错误行" + rowNum + ":名字过长");
}
if (ValidationUtil.isEmpty(x.getCode())&&x.getCode().length()>100) {
throw new RuntimeException("错误行" + rowNum + ":编号过长");
}
if (ValidationUtil.isEmpty(x.getUrl())&&x.getUrl().length()>255) {
throw new RuntimeException("错误行" + rowNum + ":视频地址过长");
}
if (ValidationUtil.isEmpty(x.getToken())&&x.getToken().length()>255) {
throw new RuntimeException("错误行" + rowNum + ":token过长");
}
if (ValidationUtil.isEmpty(x.getBizOrgCode())&&x.getBizOrgCode().length()>64) {
throw new RuntimeException("错误行" + rowNum + ":机构编码过长");
}
if (ValidationUtil.isEmpty(x.getBizOrgName())&&x.getBizOrgName().length()>128) {
throw new RuntimeException("错误行" + rowNum + ":机构名称过长");
}
if (ValidationUtil.isEmpty(x.getAddress())&&x.getAddress().length()>2000) {
throw new RuntimeException("错误行" + rowNum + ":地址过长");
}
if (ValidationUtil.isEmpty(x.getRemark())&&x.getRemark().length()>255) {
throw new RuntimeException("错误行" + rowNum + ":备注过长");
}
if (ValidationUtil.isEmpty(x.getImg())&&x.getImg().length()>100) {
throw new RuntimeException("错误行" + rowNum + ":备注过长");
}
// if (!urlPattern.matcher(x.getUrl().trim()).matches()) {
// throw new RuntimeException("错误行" + rowNum + ":视频地址格式有误,仅支持协议+ip+端口的格式");
// }
......@@ -451,6 +487,8 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
video.setBizOrgCode(x.getBizOrgCode());
video.setBizOrgName(x.getBizOrgName());
videos.add(video);
try {
this.baseMapper.insert(video);
// 处理监控和建筑关系
if (!ValidationUtil.isEmpty(x.getBuildingCodes())) {
......@@ -467,7 +505,9 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
videoEquipmentSpecifics.addAll(this.buildVideoEquipmentSpecific(equipMap, video.getId(), x.getEquipmentSpecificCodes(), rowNum));
// 处理监控和多个电力设备关系(1个摄像头对多个电力装备)
videoImportantEquipments.addAll(this.buildVideoImportantEquipment(fireMap, video.getId(), x.getImportantEquipmentCodes(), rowNum));
}catch (Exception e) {
throw new RuntimeException("系统异常!");
}
}
if (!videoSources.isEmpty()) {
videoSourceService.saveBatch(videoSources);
......
......@@ -334,7 +334,9 @@ public class ExcelServiceImpl {
break;
case "QDSJ":
SignDto dto = new SignDto();
String fileName=null;
if(par!=null && par.size()>0) {
String date =par.containsKey("date")?par.get("date").toString():null;
// String bizOrgCode =par.containsKey("bizOrgCode")?par.get("bizOrgCode").toString():null;
String bizOrgName =par.containsKey("bizOrgName")?par.get("bizOrgName").toString():null;
......@@ -352,6 +354,12 @@ public class ExcelServiceImpl {
dto.setSignTimeBIGGER(signTimeBIGGER);
dto.setSignTimeLESS(signTimeLESS);
dto.setType(type);
//区分统计和签到
if(!par.containsKey("current")){
OrgUsr orgUsr1 = orgUsrMapper.queryByBizCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
fileName="【"+orgUsr1.getBizOrgName()+"】-【"+date+"】·消防人员出勤明细";
}
}
Page<SignDto> page = new Page<>();
......@@ -362,7 +370,8 @@ public class ExcelServiceImpl {
signDtos.getRecords().stream().forEach(e->{
e.setType(e.getType().equals("0") ? "上班打卡" :"下班打卡" );
});
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
ExcelUtil.createTemplate(response, fileName!=null?fileName:excelDto.getFileName(), excelDto.getSheetName(),
signDtos.getRecords(), SignDto.class, null, false);
break;
case "KEYSITE":
......
......@@ -122,4 +122,7 @@ state.code=GW190301
state.name=\u9526\u5c4f\u6362\u6d41\u7ad9
# 是否开启遥测数据上报
is.open.telemetering=false
\ No newline at end of file
is.open.telemetering=false
# 水池液位相关信号
water.level.indexKey=FHS_FirePoolDevice_WaterLevel,FHS_LevelDetector_WaterLevel,FHS_WirelessliquidDetector_WaterLevel,CAFS_FoamTank_FoamTankLevel,CAFS_WaterTank_WaterTankLevel
\ No newline at end of file
......@@ -523,7 +523,16 @@
</sql>
</changeSet>
<changeSet author="tw" id="2022-12-12-21">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_video" columnName="address"/>
</not>
</preConditions>
<sql>
alter table `wl_video` MODIFY COLUMN `address` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '地址';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -14,18 +14,18 @@
select
s.id,
CONCAT(s.name,',',#{beginDate},' - ',#{endDate} ,':',CHAR(10),
CONCAT('正常设备',IFNULL(f1.totalNormalEquipNum,0),'台,','正常率:',concat(TRUNCATE(IFNULL(f1.normalEquipNumPercent,0)*100, 2),'%'),',',
CONCAT('正常设备',IFNULL(f1.totalNormalEquipNum,0),'台,','正常率:',concat(TRUNCATE(ABS(IFNULL(f1.normalEquipNumPercent,0)*100), 2),'%'),',',
'同比上月',IF(IFNULL(f1.totalNormalEquipNum,0)- IFNULL(f1.lastMonthTotalNormalEquipNum,0) >0 ,'增加','减少'),
if(IFNULL(f1.lastMonthTotalNormalEquipNum,0) = 0 ,'---',CONCAT(TRUNCATE(IFNULL(f1.totalNormalEquipNum,0)/f1.lastMonthTotalNormalEquipNum -1,2)* 100,'%')),',',CHAR(10)),
CONCAT('故障设备',IFNULL(f1.totalFaultEquipNum,0),'台,','故障率:',concat(TRUNCATE(IFNULL(f1.faultEquipPercent,0),2)*100,'%'),',',
if(IFNULL(f1.lastMonthTotalNormalEquipNum,0) = 0 ,'---',CONCAT(TRUNCATE(ABS(IFNULL(f1.totalNormalEquipNum,0)/f1.lastMonthTotalNormalEquipNum -1),2)* 100,'%')),',',CHAR(10)),
CONCAT('故障设备',IFNULL(f1.totalFaultEquipNum,0),'台,','故障率:',concat(TRUNCATE(ABS(IFNULL(f1.faultEquipPercent,0)),2)*100,'%'),',',
'同比上月',IF(IFNULL(f1.totalFaultEquipNum,0)- IFNULL(f1.lastMonthTotalFaultEquipNum,0) >0 ,'增加','减少'),
if(IFNULL(f1.lastMonthTotalFaultEquipNum,0) = 0 ,'---',CONCAT(TRUNCATE(IFNULL(f1.totalFaultEquipNum,0)/f1.lastMonthTotalFaultEquipNum -1,2)* 100,'%')),',',CHAR(10)),
if(IFNULL(f1.lastMonthTotalFaultEquipNum,0) = 0 ,'---',CONCAT(TRUNCATE(ABS(IFNULL(f1.totalFaultEquipNum,0)/f1.lastMonthTotalFaultEquipNum -1),2)* 100,'%')),',',CHAR(10)),
CONCAT('告警设备',IFNULL(f1.totalAlarmEquipNum,0),'台,',
'同比上月',IF(IFNULL(f1.totalAlarmEquipNum,0)- IFNULL(f1.lastMonthTotalAlarmEquipNum,0) >0 ,'增加','减少'),
if(IFNULL(f1.lastMonthTotalAlarmEquipNum,0) = 0 ,'---',CONCAT(TRUNCATE(IFNULL(f1.totalAlarmEquipNum,0)/f1.lastMonthTotalAlarmEquipNum -1,2)* 100,'%')),',',CHAR(10)),
if(IFNULL(f1.lastMonthTotalAlarmEquipNum,0) = 0 ,'---',CONCAT(TRUNCATE(ABS(IFNULL(f1.totalAlarmEquipNum,0)/f1.lastMonthTotalAlarmEquipNum -1),2)* 100,'%')),',',CHAR(10)),
CONCAT('告警总数',IFNULL(f1.totalAlarmInfoNum,0),'条,',
'同比上月',IF(IFNULL(f1.totalAlarmInfoNum,0)- IFNULL(f1.lastMonthTotalAlarmInfoNum,0) >0 ,'增加','减少'),
if(IFNULL(f1.lastMonthTotalAlarmInfoNum,0) = 0 ,'---', CONCAT(TRUNCATE(IFNULL(f1.totalAlarmInfoNum,0)/f1.lastMonthTotalAlarmInfoNum -1,2)* 100,'%'))
if(IFNULL(f1.lastMonthTotalAlarmInfoNum,0) = 0 ,'---', CONCAT(TRUNCATE(ABS(IFNULL(f1.totalAlarmInfoNum,0)/f1.lastMonthTotalAlarmInfoNum -1),2)* 100,'%'))
,'。')) as content,
s.`name`,
3 as report_type,
......
......@@ -225,7 +225,7 @@
group_name
</select>
<select id="getPerfQutoaIotList" resultType="com.yeejoin.equipmanage.common.entity.EquipmentIndex">
select id,name as perfQuotaName, name_key as perfQuotaDefinitionId,is_trend as isTrend,emergency_level_color as emergencyLevelColor from wl_equipment_index s where equipment_id = (
select id,name as perfQuotaName, name_key as perfQuotaDefinitionId,is_trend as isTrend,emergency_level_color as emergencyLevelColor, type_name as typeName, type_code as typeCode from wl_equipment_index s where equipment_id = (
select equipment_id from wl_equipment_detail wei where id = (
select equipment_detail_id from wl_equipment_specific where id = #{id})
)
......
......@@ -72,7 +72,12 @@
AND construction_unit = #{construction}
</if>
<if test="nameOrCode != null and nameOrCode != ''">
AND (CODE like CONCAT('%',#{nameOrCode},'%') or NAME like CONCAT('%',#{equimentName},'%'))
AND (CODE like CONCAT('%',#{nameOrCode},'%') or NAME like CONCAT('%',#{nameOrCode},'%'))
</if>
<if test="typeIds != null and typeIds != ''">
AND system_type in
<foreach item="item" collection="typeIds" separator="," open="(" close=")" index=""> #{item}
</foreach>
</if>
<if test="controBoxBuildId != null ">
AND contro_box_build = #{controBoxBuildId}
......@@ -99,6 +104,25 @@
wl_manufacturer_info
order by id
</select>
<select id="getSystemListNew" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
SELECT
id,
`name`,
`code`
FROM
wl_equipment_category
WHERE
parent_id = (
SELECT
CONCAT(id, '')
FROM
wl_equipment_category
WHERE
`code` = '92000000'
) AND name like CONCAT('%',#{nameOrCode},'%')
ORDER BY
`code`
</select>
<select id="getSystemList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
SELECT
id,
......
......@@ -1476,4 +1476,41 @@
ORDER BY
`result`.`click_date`
</select>
<select id="pressureMessage" resultType="java.util.Map">
select
(
select
count(1)
from
wl_equipment_specific_index
where
equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
and update_date >=
#{startTime} and #{endTime} >= update_date
) as allNum,
(
select
(
select
count(1)
from
wl_equipment_detail wed
where
wed.code like '92010800%' ) as allEqu) as allEqu,
(
select
'稳压泵平均打压频次' as name) as name,
(
select
(
select
count(1)
from
wl_equipment_specific_index
where
equipment_index_key in ('FHS_PressurePump_Start')
and update_date >=
#{startTime} and #{endTime} >= update_date
) as startNum) as startNum
</select>
</mapper>
\ No newline at end of file
......@@ -59,7 +59,7 @@
</select>
<select id="getCheckInputSyncBoList" resultType="com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo" parameterType="java.util.Map">
<![CDATA[
SELECT
SELECT
ci.id,
ci.input_name,
ci.input_value,
......@@ -120,19 +120,19 @@
LEFT JOIN wl_warehouse_structure wws ON wws.id = pp.risk_source_id
LEFT JOIN (
SELECT
biz_org_name,
biz_org_code bzOrgCode,
amos_org_id,
amos_org_code,
`code`
o.biz_org_name,
o.biz_org_code bzOrgCode,
o.amos_org_id,
o.amos_org_code,
o.`code`
FROM
cb_org_usr
cb_org_usr o,
`idx_biz_station_info` s
WHERE
amos_org_code <> ''
AND amos_org_code IS NOT NULL
AND biz_org_type = 'COMPANY'
and is_delete = 0
) cou ON cou.bzOrgCode = ci.org_code ]]>
o.biz_org_type = 'COMPANY'
and o.is_delete = 0
and o.`code` = s.`code`
) cou ON LOCATE(cou.bzOrgCode, ci.org_code) > 0 ]]>
<where>
<if test="id != null">
ci.id = #{id}
......
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