Commit 4296c4e0 authored by maoying's avatar maoying

合并冲突

parents 4051b155 fc38528c
...@@ -157,6 +157,9 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc ...@@ -157,6 +157,9 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @return * @return
*/ */
Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode); Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> dutyCardCount();
List<Map<String, Object>> dutyCardList ();
} }
...@@ -26,6 +26,14 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -26,6 +26,14 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
//BUG 2880 by litw start 2021年9月16日 //BUG 2880 by litw start 2021年9月16日
List<OrgUsr> selectAllChildrenList(@Param("map")Map<String, Object> map); List<OrgUsr> selectAllChildrenList(@Param("map")Map<String, Object> map);
int getUserByPeopleTypeCount(@Param("map")Map<String, Object> map);
List<Map<String, Object>> getUserByPeopleType(@Param("map")Map<String, Object> map);
List<OrgUsr> selectCompanyDepartmentMsg(); List<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map); List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
...@@ -144,4 +152,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -144,4 +152,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode); List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode);
List<Map<String, Object>> getFireProtectionAndMaintenance();
} }
...@@ -51,4 +51,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> { ...@@ -51,4 +51,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode, @Param("systemName") String systemName); Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode, @Param("systemName") String systemName);
Map<String, Object> getWaterResourceInfoList(@Param("map") Map<String, Object> map); Map<String, Object> getWaterResourceInfoList(@Param("map") Map<String, Object> map);
Map<String, Object> getResourcesCount();
} }
...@@ -34,6 +34,11 @@ public interface IDutyCommonService { ...@@ -34,6 +34,11 @@ public interface IDutyCommonService {
*/ */
IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode) throws ParseException; IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode) throws ParseException;
List<Map<String, Object>> dutyCardCount()throws ParseException;
List<Map<String, Object>> dutyCardList()throws ParseException;
/** /**
* 值班明细 * 值班明细
* *
...@@ -47,7 +52,6 @@ public interface IDutyCommonService { ...@@ -47,7 +52,6 @@ public interface IDutyCommonService {
* *
* @param beginDate * @param beginDate
* @param endDate * @param endDate
* @param dutyType
* @return * @return
* @throws ParseException * @throws ParseException
*/ */
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -376,4 +377,7 @@ public interface IOrgUsrService { ...@@ -376,4 +377,7 @@ public interface IOrgUsrService {
List<OrgMenuDto> companyUserTreeByUserAndTypeAll(String bizorgcode); List<OrgMenuDto> companyUserTreeByUserAndTypeAll(String bizorgcode);
List<DynamicFormInstance> selectTelById(List<String> ids, String type); List<DynamicFormInstance> selectTelById(List<String> ids, String type);
List<FirefightersPost> selectPostById(List<String> ids);
} }
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto; import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 接口类 * 接口类
...@@ -36,4 +37,5 @@ public interface IWaterResourceService { ...@@ -36,4 +37,5 @@ public interface IWaterResourceService {
* */ * */
WaterResourceDto selectBySequenceNbr(Long id); WaterResourceDto selectBySequenceNbr(Long id);
Map<String, Object> getResourcesCount();
} }
...@@ -675,4 +675,132 @@ WHERE ...@@ -675,4 +675,132 @@ WHERE
HAVING HAVING
peopleType = 1602 peopleType = 1602
</select> </select>
<select id="dutyCardCount" resultType="java.util.Map">
SELECT
'fire' as peopleType,
count(*) as total
from
(SELECT
c.sequence_nbr as id,
c.biz_org_name as userName,
IFNULL( cf.mobile_phone, '' ) telephone,
'驻站消防员' as peopleType
FROM
cb_org_usr c
RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
GROUP BY
cs.USER_ID
ORDER BY
cs.sign_time DESC) d
union all
SELECT
(CASE b.peopleType
WHEN 1602 THEN
'run'
ELSE
'overhaul'
END) peopleType,
count( * ) as total
FROM
(
SELECT
ou.sequence_nbr AS id,
ou.biz_org_name AS userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IF
(
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END ) = '',
NULL,
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END )
) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
WHERE
ps.duty_date = CURRENT_DATE
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY
a.id
) b WHERE b.peopleType in ('1602','1604')
GROUP BY
peopleType
</select>
<select id="dutyCardList" resultType="java.util.Map">
(SELECT
c.sequence_nbr as id,
c.biz_org_name as userName,
IFNULL( cf.mobile_phone, '' ) telephone,
'1601' as peopleType
FROM
cb_org_usr c
RIGHT JOIN cb_sign cs ON c.sequence_nbr = cs.USER_ID
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
WHERE
c.sequence_nbr IS NOT NULL
AND cs.sign_time LIKE concat( CURRENT_DATE ( ), '%' )
GROUP BY
cs.USER_ID
ORDER BY
cs.sign_time DESC)
UNION all
(SELECT
id,
userName,
telephone,
peopleType
FROM
(
SELECT
ou.sequence_nbr AS id,
ou.biz_org_name AS userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IF
(
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END ) = '',
NULL,
MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value_label END )
) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
WHERE
ps.duty_date = CURRENT_DATE
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY
a.id
) b WHERE b.peopleType in ('1602','1604'))
</select>
</mapper> </mapper>
...@@ -1206,4 +1206,85 @@ LEFT JOIN ( ...@@ -1206,4 +1206,85 @@ LEFT JOIN (
GROUP BY biz_org_name GROUP BY biz_org_name
</select> </select>
<select id="getUserByPeopleTypeCount" resultType="Integer">
select
count(*)
from (
SELECT
DISTINCT
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
g.telephone,
g.positionType
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'telephone' then IFNULL(v.field_value,'') end) telephone,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'') end) positionType,
max(case v.field_code when 'peopleType' then IFNULL(v.field_value,'') end) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
and g.peopleType=1601
GROUP BY
u.sequence_nbr
order by u.rec_date desc
)a where a.sequenceNbr is not null
</select>
<select id="getUserByPeopleType" resultType="Map">
SET @rownum = #{map.pageNum};
select
@rownum := @rownum + 1 AS rownum,
a.* from (
SELECT
DISTINCT
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
g.telephone,
g.positionType
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'telephone' then IFNULL(v.field_value,'') end) telephone,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,'') end) positionType,
max(case v.field_code when 'peopleType' then IFNULL(v.field_value,'') end) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
and g.peopleType=1601
GROUP BY
u.sequence_nbr
order by u.rec_date desc
)a where a.sequenceNbr is not null
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
</mapper> </mapper>
...@@ -239,4 +239,49 @@ ...@@ -239,4 +239,49 @@
</if> </if>
) AS fireWaterTank ) AS fireWaterTank
</select> </select>
<select id="getResourcesCount" resultType="java.util.Map">
SELECT
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'hydrant' ) AS hydrant,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'pool' ) AS pool,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'waterTank' ) AS waterTank,
(
SELECT
count( * ) AS total
FROM
(
SELECT
ou.biz_org_name,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) a
WHERE
a.peopleType = '1601'
) fire,
(
SELECT
count( * ) AS total
FROM
(
SELECT
ou.biz_org_name,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = '0'
GROUP BY
ou.sequence_nbr
) a
WHERE
a.peopleType = '1602'
) run
</select>
</mapper> </mapper>
...@@ -895,6 +895,69 @@ public class DateUtils { ...@@ -895,6 +895,69 @@ public class DateUtils {
return dates; return dates;
} }
public static List<Map<String, String>> getWeeksMapInterval(String date){
List<Map<String, String>> dates = new ArrayList<>();
String year = date.substring(0,4);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
Date date1 = null;
try {
date1 = dateFormat.parse(date);
} catch (ParseException e) {
System.out.println("获取当前月自然周,日期格式转换错误!11");
e.printStackTrace();
}
Calendar calendar = new GregorianCalendar();
calendar.setTime(date1);
int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
int count = 0;
for (int i = 1; i <= days; i++) {
DateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
Date date2 = null;
try {
date2 = dateFormat1.parse(date + "-" + i);
} catch (ParseException e) {
System.out.println("获取当前月自然周,日期格式转换错误!22");
e.printStackTrace();
}
calendar.clear();
calendar.setTime(date2);
int k = new Integer(calendar.get(Calendar.DAY_OF_WEEK));
int startDay = 0;
int endDay = 0;
// 若当天是周日
if (k == 1) {
count++;
if (i - 6 <= 1) {
startDay = 1;
} else {
startDay = i - 6;
}
endDay = i;
}
// 若是本月最好一天,且不是周日
if (k != 1 && i == days) {
count++;
startDay = i - k + 2;
endDay = i;
}
if(startDay != 0 && endDay != 0){
String s = year + "第" + getWeekOfYear(date2) + "周" + "(" + date.substring(5) + "月" + startDay +
"日至" + date.substring(5) + "月" + endDay + "日" +")";
String weekStart = year + "-"+ date.substring(5) +"-" +startDay +" 00:00:00";
String weekEnd = year + "-"+ date.substring(5) +"-" +endDay +" 23:59:59";
HashMap<String, String> map = new HashMap<>();
map.put("name",s);
map.put("weekStart",weekStart);
map.put("weekEnd",weekEnd);
dates.add(map);
}
}
return dates;
}
/** /**
* 获取一年的第几周 * 获取一年的第几周
* *
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
AND cdfi.field_code = 'userId' AND cdfi.field_code = 'userId'
) temp ) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId
WHERE cou.is_delete = 0
) AS ) AS
value value
, ,
...@@ -64,7 +65,7 @@ ...@@ -64,7 +65,7 @@
cb_organization co cb_organization co
WHERE co.is_delete = 0 WHERE co.is_delete = 0
ORDER BY ORDER BY
co.sort co.sort desc
LIMIT 4 LIMIT 4
) )
</select> </select>
......
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -24,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -24,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -79,6 +81,29 @@ public class DutyPersonController extends BaseController { ...@@ -79,6 +81,29 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.pageListDetail(current, size, beginDate, endDate, bizOrgCode)); return ResponseHelper.buildResponse(iDutyPersonService.pageListDetail(current, size, beginDate, endDate, bizOrgCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cardDetailCount")
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<Map<String, Object>> cardDetail() throws ParseException {
Map<String, Object> map = new HashMap<>();
List<Map<String, Object>> maps = iDutyPersonService.dutyCardCount();
maps.forEach(e->map.put(e.get("peopleType").toString(),e.get("total")));
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cardList")
@ApiOperation(httpMethod = "GET", value = "值班管理卡片人员统计", notes = "值班管理卡片人员统计")
public ResponseModel<List<Map<String, Object>>> cardList() throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dutyCardList());
}
/** /**
* 值班列表视图--不分页 * 值班列表视图--不分页
* *
......
...@@ -276,6 +276,19 @@ public class OrgPersonController extends BaseController { ...@@ -276,6 +276,19 @@ public class OrgPersonController extends BaseController {
return ResponseHelper.buildResponse(orgUsr); return ResponseHelper.buildResponse(orgUsr);
} }
//驻站消防人员
@TycloudOperation( ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getUserByPeopleType/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防人员列表分页查询", notes = "消防人员列表分页查询")
public ResponseModel<IPage<Map<String, Object>>> getUserByPeopleType(@RequestParam Map<String, Object> requestBody) {
Map<String, Object> map = new HashMap<>();
IPage<Map<String, Object>> mapIPage = iOrgUsrService.getUserByPeopleType(
requestBody.containsKey("pageNum") ? requestBody.get("pageNum").toString() : null ,
requestBody.containsKey("pageSize") ? requestBody.get("pageSize").toString() : null,map );
return ResponseHelper.buildResponse(mapIPage);
}
/** /**
......
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -18,11 +19,14 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; ...@@ -18,11 +19,14 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify; import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo; import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
...@@ -47,7 +51,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -47,7 +51,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -1188,4 +1192,20 @@ public class OrgUsrController extends BaseController { ...@@ -1188,4 +1192,20 @@ public class OrgUsrController extends BaseController {
List<DynamicFormInstance> menus = iOrgUsrService.selectTelById(ids, type); List<DynamicFormInstance> menus = iOrgUsrService.selectTelById(ids, type);
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
/**
* 获取人员电话
* @param
* @returnP
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/selectPostById", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id获取用户岗位", notes = "根据id获取用户岗位")
public ResponseModel<List<FirefightersPost>> selectPostById(@RequestParam List<String> ids) {
List<FirefightersPost> menus = iOrgUsrService.selectPostById(ids);
return ResponseHelper.buildResponse(menus);
}
} }
\ No newline at end of file
...@@ -209,6 +209,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -209,6 +209,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return dynamicFormInstanceMapper.getPersonInfoByPage(new Page(current, size), bizOrgCode); return dynamicFormInstanceMapper.getPersonInfoByPage(new Page(current, size), bizOrgCode);
} }
public List<Map<String, Object>> dutyCardCount()
throws ParseException {
return dynamicFormInstanceMapper.dutyCardCount();
}
public List<Map<String, Object>> dutyCardList()
throws ParseException {
return dynamicFormInstanceMapper.dutyCardList();
}
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException { private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
// 获取值班的实例id // 获取值班的实例id
String instanceId = m.get("instanceId").toString(); String instanceId = m.get("instanceId").toString();
......
...@@ -3564,4 +3564,30 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3564,4 +3564,30 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return dynamicFormInstanceService.list(wrapper); return dynamicFormInstanceService.list(wrapper);
} }
@Override
public List<FirefightersPost> selectPostById(List<String> ids) {
LambdaQueryWrapper<FirefightersPost> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(FirefightersPost::getOrgUsrId, ids);
return iFirefightersPostService.list(queryWrapper);
}
public IPage<Map<String, Object>> getUserByPeopleType(String pageNum, String pageSize, Map<String, Object> map) {
IPage<Map<String, Object>> pageBean = null;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
pageBean.setTotal(orgUsrMapper.getUserByPeopleTypeCount(map));
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = orgUsrMapper.getUserByPeopleType(map);
pageBean.setRecords(list);
return pageBean;
}
} }
\ No newline at end of file
...@@ -319,6 +319,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -319,6 +319,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
return waterResourceDto; return waterResourceDto;
} }
@Override
public Map<String, Object> getResourcesCount() {
return waterResourceMapper.getResourcesCount();
}
public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) { public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) {
return waterResourceMapper.getWaterResourceTypeList(isDelete); return waterResourceMapper.getWaterResourceTypeList(isDelete);
} }
...@@ -555,4 +560,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -555,4 +560,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
}); });
return list; return list;
} }
} }
...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -74,6 +75,43 @@ public class DCenterController extends AbstractBaseController { ...@@ -74,6 +75,43 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
@PersonIdentify
@RequestMapping(value = "/station-info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站点信息查询", produces = "application/json;charset=UTF-8", notes = "站点信息查询")
public ResponseModel stationInfo() {
return CommonResponseUtil.success(equipmentSpecificAlarmService.stationInfo());
}
@PersonIdentify
@RequestMapping(value = "/fireAlarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防报警列表分页查询", produces = "application/json;charset=UTF-8", notes = "消防报警列表分页查询")
public ResponseModel pageQuery(@RequestParam(required = false) String code,
@RequestParam(required = false) String typeCode,
@RequestParam(required = false) String bizOrgCode,
CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request7 = new CommonRequest();
request7.setName("system");
request7.setValue(StringUtil.isNotEmpty(code) ? StringUtils.trimToNull(code) : null);
queryRequests.add(request7);
CommonRequest request8 = new CommonRequest();
request8.setName("specificIndexKey");
request8.setValue(StringUtil.isNotEmpty(typeCode) ? StringUtils.trimToNull(typeCode) : null);
queryRequests.add(request8);
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(ObjectUtils.isEmpty(bizOrgCode) ? reginParams.getPersonIdentity().getBizOrgCode() : bizOrgCode);
queryRequests.add(request13);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
return CommonResponseUtil.success(equipmentSpecificAlarmService.dcFireAlarmLogPage(param));
}
/** /**
* 消防系统运行状态分页查询 * 消防系统运行状态分页查询
* @param bizOrgCode * @param bizOrgCode
......
...@@ -3,6 +3,8 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,6 +3,8 @@ package com.yeejoin.equipmanage.controller;
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.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.vo.IotDataVO;
import com.yeejoin.equipmanage.service.IEmergencyService; import com.yeejoin.equipmanage.service.IEmergencyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -14,10 +16,16 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -14,10 +16,16 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map; import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
/** /**
* *
...@@ -60,12 +68,15 @@ public class EmergencyController extends AbstractBaseController { ...@@ -60,12 +68,15 @@ public class EmergencyController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("应急物资") @ApiOperation("应急物资")
@GetMapping(value = "/emergencyMaterials") @GetMapping(value = "/emergencyMaterials")
public Map<String, Object> emergencyMaterials(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ) { public Map<String, Object> emergencyMaterials() {
if (ObjectUtils.isEmpty(bizOrgCode)){ return iEmergencyService.emergencyMaterials();
ReginParams reginParams = getSelectedOrgInfo(); }
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
} @TycloudOperation(ApiLevel = UserType.AGENCY)
return iEmergencyService.emergencyMaterials(bizOrgCode); @ApiOperation("消防系统/消防车")
@GetMapping(value = "/systemAndCar")
public Map<String, Object> systemAndCar() {
return iEmergencyService.systemAndCar();
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -141,4 +152,198 @@ public class EmergencyController extends AbstractBaseController { ...@@ -141,4 +152,198 @@ public class EmergencyController extends AbstractBaseController {
return iEmergencyService.selectPressureFlow(page, bizOrgCode); return iEmergencyService.selectPressureFlow(page, bizOrgCode);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("火灾自动报警系统告警分析")
@GetMapping(value = "/selectAlarmAnalysis")
public List<Map<String, Object>> selectPressureFlow(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate) {
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectAlarmAnalysis(bizOrgCode, startDate, endDate);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("火灾自动报警系统告警分析-饼图")
@GetMapping(value = "/selectAlarmAnalysisCount")
public List<Map<String, Object>> selectAlarmAnalysisCount(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectAlarmAnalysisCount(bizOrgCode, startDate, endDate);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防炮灭火系统告警分析-饼图")
@GetMapping(value = "/fireCannonAlarmAnalysisPie")
public List<Map<String, Object>> fireCannonAlarmAnalysisPie(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "systemType") String systemType) {
return iEmergencyService.selectFireCannonAlarmAnalysisPie(startDate, endDate, systemType);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防给水系统告警分析-饼图")
@GetMapping(value = "/waterSystemAlarmAnalysisPie")
public List<Map<String, Object>> waterSystemAlarmAnalysisPie(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "systemType") String systemType) {
return iEmergencyService.waterSystemAlarmAnalysisPie(startDate, endDate, systemType);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防给水系统告警分析-小图")
@GetMapping(value = "/waterSystemAlarmAnalysis")
public List<Map<String, Object>> waterSystemAlarmAnalysis(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "type") String type,
@RequestParam(value = "systemType") String systemType) {
ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
if ("week".equals(type)) {
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
for (Map<String, String> week : weeksMapInterval) {
Date weekStart = null;
Date weekEnd = null;
try {
weekStart = DateUtils.dateParse(week.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd = DateUtils.dateParse(week.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime = weekStart.getTime();
long endTime = weekEnd.getTime();
HashMap<String, Object> mapData = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime && check.getTime() <= endTime) {
if (!ObjectUtils.isEmpty(mapData)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData.get("controlCabinetAlarmNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("controlCabinetAlarmNum")));
BigDecimal now = old.add(add);
mapData.put("controlCabinetAlarmNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData.get("firePumpsAlarmNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("firePumpsAlarmNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData.put("firePumpsAlarmNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData.get("stabilizedPumpAlarmNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("stabilizedPumpAlarmNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData.put("stabilizedPumpAlarmNum", String.valueOf(stabilizedNow));
} else {
mapData.put("name", week.get("name"));
mapData.put("controlCabinetAlarmNum", map.get("controlCabinetAlarmNum"));
mapData.put("firePumpsAlarmNum", map.get("firePumpsAlarmNum"));
mapData.put("stabilizedPumpAlarmNum", map.get("stabilizedPumpAlarmNum"));
}
}
}
result.add(mapData);
}
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
}
return result;
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防炮系统告警分析-折线图")
@GetMapping(value = "/fireCannonSystemAlarmAnalysis")
public List<Map<String, Object>> fireCannonSystemAlarmAnalysis(@RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate,
@RequestParam(value = "type") String type,
@RequestParam(value = "systemType") String systemType) {
ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
if ("week".equals(type)) {
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
for (Map<String, String> week : weeksMapInterval) {
Date weekStart = null;
Date weekEnd = null;
try {
weekStart = DateUtils.dateParse(week.get("weekStart"), DateUtils.DATE_PATTERN);
weekEnd = DateUtils.dateParse(week.get("weekEnd"), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
long startTime = weekStart.getTime();
long endTime = weekEnd.getTime();
HashMap<String, Object> mapData = new HashMap<>();
for (Map<String, Object> map : maps) {
Date check = null;
try {
check = DateUtils.dateParse(String.valueOf(map.get("date")), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(check) && check.getTime() >= startTime && check.getTime() <= endTime) {
if (!ObjectUtils.isEmpty(mapData)) {
BigDecimal old = new BigDecimal(String.valueOf(mapData.get("powerLossNum")));
BigDecimal add = new BigDecimal(String.valueOf(map.get("powerLossNum")));
BigDecimal now = old.add(add);
mapData.put("powerLossNum", String.valueOf(now));
BigDecimal firePumpsOld = new BigDecimal(String.valueOf(mapData.get("faultNum")));
BigDecimal firePumpsAdd = new BigDecimal(String.valueOf(map.get("faultNum")));
BigDecimal firePumpsNow = firePumpsOld.add(firePumpsAdd);
mapData.put("faultNum", String.valueOf(firePumpsNow));
BigDecimal stabilizedOld = new BigDecimal(String.valueOf(mapData.get("fireAlarmNum")));
BigDecimal stabilizedAdd = new BigDecimal(String.valueOf(map.get("fireAlarmNum")));
BigDecimal stabilizedNow = stabilizedOld.add(stabilizedAdd);
mapData.put("fireAlarmNum", String.valueOf(stabilizedNow));
BigDecimal shieldOld = new BigDecimal(String.valueOf(mapData.get("shieldNum")));
BigDecimal shieldAdd = new BigDecimal(String.valueOf(map.get("shieldNum")));
BigDecimal shieldNow = shieldOld.add(shieldAdd);
mapData.put("shieldNum", String.valueOf(shieldNow));
} else {
mapData.put("name", week.get("name"));
mapData.put("shieldNum", map.get("shieldNum"));
mapData.put("fireAlarmNum", map.get("fireAlarmNum"));
mapData.put("faultNum", map.get("faultNum"));
mapData.put("powerLossNum", map.get("powerLossNum"));
}
}
}
result.add(mapData);
}
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
}
return result;
}
} }
...@@ -193,6 +193,15 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -193,6 +193,15 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getDetailByCode(systemCode); return fireFightingSystemService.getDetailByCode(systemCode);
} }
//查询系统下设备状态
@RequestMapping(value = "/alarmSystem/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过id查询消防系统信息")
public List<Map<String,Object>> getEquip() {
return fireFightingSystemService.getEquip();
}
/** /**
* 生产厂商列表(不分页) * 生产厂商列表(不分页)
* *
......
...@@ -18,14 +18,17 @@ import org.apache.commons.lang3.StringUtils; ...@@ -18,14 +18,17 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -386,18 +389,18 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -386,18 +389,18 @@ public class SupervisionConfigureController extends AbstractBaseController {
} catch (ParseException e) { } catch (ParseException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
long res = start - end; long res = Math.abs(start - end);
diffMinute = res / 1000 / 60; diffMinute = res / 1000 / 60;
} }
long finalDiffMinute = diffMinute; long finalDiffMinute = diffMinute;
pressurePumpInfo.getRecords().stream( pressurePumpInfo.getRecords().stream(
).map(item -> { ).map(item -> {
item.put("startAndStopInterval", finalDiffMinute); item.put("startAndStopInterval", finalDiffMinute);
// if (finalDiffMinute > 5) { if (finalDiffMinute > 5) {
// item.put("stateDesc", "异常"); item.put("generalState", "异常");
// } else { } else {
// item.put("stateDesc", "正常"); item.put("generalState", "正常");
// } }
item.put("nameKey", pressurePumpStart); item.put("nameKey", pressurePumpStart);
return item; return item;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -462,4 +465,165 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -462,4 +465,165 @@ public class SupervisionConfigureController extends AbstractBaseController {
return CommonResponseUtil.success(supervisionVideoService.queryVideoAllId(bizOrgCode)); return CommonResponseUtil.success(supervisionVideoService.queryVideoAllId(bizOrgCode));
} }
@PersonIdentify
@RequestMapping(value = "/selectPressureMonth", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "统计当月稳压泵启停", produces = "application/json;charset=UTF-8", notes = "统计当月稳压泵启停")
public ResponseModel selectPressureMonth(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String startDay = df.format(new Date());
Calendar calendar = Calendar.getInstance();
calendar.set(Integer.parseInt(startDay.substring(0, 4)), Integer.parseInt(startDay.substring(5, 7)) - 1, 1);
String firstDayOfMonth = new SimpleDateFormat("yyyy-MM-dd ").format(calendar.getTime());
System.out.println("第一天:" + firstDayOfMonth + "00:00:00");
//这里先设置要获取月份的下月的第一天
calendar.set(Integer.parseInt(startDay.substring(0, 4)), Integer.parseInt(startDay.substring(5, 7)), 1);
//这里将日期值减去一天,从而获取到要求的月份最后一天
calendar.add(Calendar.DATE, -1);
String lastDayOfMonth = new SimpleDateFormat("yyyy-MM-dd ").format(calendar.getTime());
System.out.println("最后一天:" + lastDayOfMonth + "23:59:59");
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
}
// 稳压泵信息
List<Map<String, Object>> pressurePumps = fireFightingSystemMapper.selectAllPressurePumpInfo(bizOrgCode);
ArrayList<Map<String, Object>> names = new ArrayList<>();
// x轴数据
List<Map<String, Object>> data = fireFightingSystemMapper.selectAllDays();
for (Map<String, Object> pressurePump : pressurePumps) {
HashMap<String, Object> bar = new HashMap<>();
bar.put("name", pressurePump.get("name"));
bar.put("id", pressurePump.get("id"));
names.add(bar);
String prefix = null;
String suffix = null;
String iotCode = pressurePump.get("iot_code").toString();
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
ResponseModel mounthEntity = null;
try {
mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), firstDayOfMonth + "00:00:00", lastDayOfMonth + "23:59:59", prefix, suffix, null);
} catch (Exception e) {
e.printStackTrace();
}
if (!ObjectUtils.isEmpty(mounthEntity) && "200".equals(String.valueOf(mounthEntity.getStatus()))) {
for (Map<String, Object> item : data) {
HashMap<String, Object> map = new HashMap<>();
map.put("name", pressurePump.get("name"));
String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = list.stream().filter(t -> (t.containsKey("time") && t.get("time").substring(0, 10).equals(item.get("date")))).collect(Collectors.toList());
map.put("value", collect.size());
map.put("id", pressurePump.get("id"));
if (item.containsKey("yData")) {
List<Map<String, Object>> yData1 = (List<Map<String, Object>>) item.get("yData");
yData1.add(map);
} else {
ArrayList<Map<String, Object>> maps = new ArrayList<>();
maps.add(map);
item.put("yData", maps);
}
}
}
}
HashMap<String, Object> result = new HashMap<>();
result.put("names", names);
result.put("data", data);
return CommonResponseUtil.success(result);
}
@PersonIdentify
@RequestMapping(value = "/selectPressureDetails", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "稳压泵详情", produces = "application/json;charset=UTF-8", notes = "稳压泵详情")
public ResponseModel selectPressureDetails(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
List<Map<String, Object>> pressurePumps = fireFightingSystemMapper.selectPressureDetails(bizOrgCode);
return CommonResponseUtil.success(pressurePumps);
}
@PersonIdentify
@RequestMapping(value = "/selectPipePressureDetail", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "管网压力详情", produces = "application/json;charset=UTF-8", notes = "管网压力详情")
public ResponseModel selectPipePressureDetail(@RequestParam(value = "equipmentSpecificId") String equipmentSpecificId) {
Map<String, Object> map = fireFightingSystemMapper.selectEquipmentSpecificById(equipmentSpecificId);
if (ObjectUtils.isEmpty(map) || ObjectUtils.isEmpty(map.get("iot_code"))) {
return CommonResponseUtil.success(null);
}
String iotCode = map.get("iot_code").toString();
String prefix = null;
String suffix = null;
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
String now = LocalDateTimeUtils.getNow();
ResponseModel mounthEntity = null;
try {
mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), now.substring(0, 10) + " 00:00:00", now.substring(0, 10) + " 23:59:59", prefix, suffix, "FHS_PipePressureDetector_PipePressure");
} catch (Exception e) {
e.printStackTrace();
}
List<Map<String, String>> result = new ArrayList<>();
if (200 == mounthEntity.getStatus()) {
String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1);
Collections.reverse(list);
if (!CollectionUtils.isEmpty(list) && list.size() > 30) {
for (int i = 0; i <= 29; i++) {
result.add(list.get(i));
}
} else {
result.addAll(list);
}
}
result.stream().map(item -> {
if (!ObjectUtils.isEmpty(item.get("time"))) {
item.put("time", change(String.valueOf(item.get("time"))));
}
return item;
}).collect(Collectors.toList());
return CommonResponseUtil.success(result);
}
private String change(String time) {
//进行转化时区
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US);
Date myDate = null;
try {
myDate = dateFormat.parse(time.replace("Z", "+0000"));
} catch (ParseException e) {
e.printStackTrace();
}
//转换为年月日时分秒
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = df.format(myDate);
return format;
}
} }
...@@ -18,7 +18,7 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -18,7 +18,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
Map<String, Object> selectEmergencyMaterials(@Param("bizOrgCode") String bizOrgCode); Map<String, Object> selectEmergencyMaterials();
/** /**
* 应急物资详情 * 应急物资详情
...@@ -61,4 +61,23 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -61,4 +61,23 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> getCAFSWaterTankInfo(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getCAFSWaterTankInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectAlarmAnalysis(@Param("bizOrgCode") String bizOrgCode, @Param("startDate")String startDate, @Param("endDate")String endDate);
List<Map<String, Object>> selectAlarmAnalysisCount(@Param("bizOrgCode") String bizOrgCode, @Param("startDate")String startDate, @Param("endDate")String endDate);
Map<String, Object> getSystemAndCarCount();
List<String> selectSystemCodes(@Param("systemType") String systemType);
List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("list") List<String> codes);
List<Map<String, Object>> waterSystemAlarmAnalysisPie(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("list") List<String> codes);
List<Map<String, Object>> waterSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
} }
...@@ -226,6 +226,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -226,6 +226,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
, @Param("endTime") String endTime); , @Param("endTime") String endTime);
Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param); Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
List<Map<String, Object>> alarmTrend(String bizOrgCode); List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> stationInfo();
} }
...@@ -640,4 +640,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -640,4 +640,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getStationStatusStatistics(); List<Map<String, Object>> getStationStatusStatistics();
List<Map<String, Object>> selectAllPressurePumpInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> selectAllDays();
List<Map<String, Object>> getEquip();
List<Map<String, Object>> selectPressureDetails(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEquipmentSpecificById(@Param("id") String id);
} }
...@@ -22,7 +22,7 @@ public interface IEmergencyService { ...@@ -22,7 +22,7 @@ public interface IEmergencyService {
*/ */
List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode); List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode);
Map<String, Object> emergencyMaterials(String bizOrgCode); Map<String, Object> emergencyMaterials();
Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode); Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode);
...@@ -33,4 +33,20 @@ public interface IEmergencyService { ...@@ -33,4 +33,20 @@ public interface IEmergencyService {
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code); Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code);
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode); Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode);
List<Map<String, Object>> selectAlarmAnalysis(String bizOrgCode, String startDate, String endDate);
List<Map<String, Object>> selectAlarmAnalysisCount(String bizOrgCode, String startDate, String endDate);
Map<String, Object> systemAndCar();
List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(String startDate, String endDate, String systemType);
List<Map<String, Object>> waterSystemAlarmAnalysisPie(String startDate, String endDate, String systemType);
List<Map<String, Object>> waterSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
} }
...@@ -97,6 +97,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif ...@@ -97,6 +97,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param); Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param);
List<Map<String, Object>> stationInfo();
List<Map<String, Object>> alarmTrend(String bizOrgCode); List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> allList(CommonPageInfoParam param); List<Map<String, Object>> allList(CommonPageInfoParam param);
......
...@@ -171,6 +171,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -171,6 +171,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/ */
FireFightingSystemEntity getDetailByCode(String systemCode); FireFightingSystemEntity getDetailByCode(String systemCode);
List<Map<String,Object>> getEquip();
/** /**
* 集成页面系统数据 * 集成页面系统数据
* *
......
...@@ -6,6 +6,7 @@ import com.yeejoin.equipmanage.service.IEmergencyService; ...@@ -6,6 +6,7 @@ import com.yeejoin.equipmanage.service.IEmergencyService;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
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.springframework.util.CollectionUtils;
import java.util.*; import java.util.*;
...@@ -59,8 +60,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -59,8 +60,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
@Override @Override
public Map<String, Object> emergencyMaterials(String bizOrgCode) { public Map<String, Object> emergencyMaterials() {
return emergencyMapper.selectEmergencyMaterials(bizOrgCode); return emergencyMapper.selectEmergencyMaterials();
} }
@Override @Override
...@@ -87,4 +88,58 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -87,4 +88,58 @@ public class EmergencyServiceImpl implements IEmergencyService {
public Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode) { public Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectPressureFlow(page, bizOrgCode); return emergencyMapper.selectPressureFlow(page, bizOrgCode);
} }
@Override
public List<Map<String, Object>> selectAlarmAnalysis(String bizOrgCode, String startDate, String endDate) {
return emergencyMapper.selectAlarmAnalysis(bizOrgCode, startDate, endDate);
}
@Override
public List<Map<String, Object>> selectAlarmAnalysisCount(String bizOrgCode, String startDate, String endDate) {
return emergencyMapper.selectAlarmAnalysisCount(bizOrgCode, startDate, endDate);
}
@Override
public Map<String, Object> systemAndCar() {
return emergencyMapper.getSystemAndCarCount();
}
@Override
public List<Map<String, Object>> selectFireCannonAlarmAnalysisPie(String startDate, String endDate, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.selectFireCannonAlarmAnalysisPie(startDate, endDate, strings);
}
return null;
}
@Override
public List<Map<String, Object>> waterSystemAlarmAnalysisPie(String startDate, String endDate, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.waterSystemAlarmAnalysisPie(startDate, endDate, strings);
}
return null;
}
@Override
public List<Map<String, Object>> waterSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.waterSystemAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
@Override
public List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType) {
List<String> strings = emergencyMapper.selectSystemCodes(systemType);
if (!CollectionUtils.isEmpty(strings)) {
return emergencyMapper.fireCannonSystemAlarmAnalysis(startDate, endDate, dataType, date, strings);
}
return null;
}
} }
...@@ -798,9 +798,19 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -798,9 +798,19 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
} }
@Override @Override
public Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
return this.baseMapper.dcFireAlarmLogPage(result, param);
}
@Override
public List<Map<String, Object>> alarmTrend(String bizOrgCode) { public List<Map<String, Object>> alarmTrend(String bizOrgCode) {
return this.baseMapper.alarmTrend(bizOrgCode); return this.baseMapper.alarmTrend(bizOrgCode);
} }
@Override
public List<Map<String, Object>> stationInfo() {
return this.baseMapper.stationInfo();
}
@Override @Override
public List<Map<String, Object>> allList(CommonPageInfoParam param) { public List<Map<String, Object>> allList(CommonPageInfoParam param) {
......
...@@ -36,8 +36,9 @@ import com.yeejoin.equipmanage.fegin.JcsFeign; ...@@ -36,8 +36,9 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import org.apache.commons.beanutils.BeanUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -52,7 +53,6 @@ import org.typroject.tyboot.core.foundation.context.RequestContext; ...@@ -52,7 +53,6 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
...@@ -64,8 +64,8 @@ import java.net.SocketException; ...@@ -64,8 +64,8 @@ import java.net.SocketException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.lang.String.valueOf; import static java.lang.String.valueOf;
import org.apache.commons.io.IOUtils;
@Slf4j @Slf4j
@Service @Service
...@@ -981,6 +981,26 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -981,6 +981,26 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public List<Map<String, Object>> getEquip() {
List<Map<String, Object>> list = fireFightingSystemMapper.getEquip();
List<Map<String, Object>> resList = new ArrayList<>();
int i = 1;
if (0 < list.size()) {
for (Map<String, Object> m : list) {
Map<String, Object> map = new HashMap<>();
map.put("key", i);
map.put("name", m.get("equipmentName"));
map.put("code", m.get("code"));
map.put("value", m.get("flag"));
map.put("unit", "");
resList.add(map);
i++;
}
}
return resList;
}
@Override
public List<AlarmDataVO> getSystemById(Long id) { public List<AlarmDataVO> getSystemById(Long id) {
return this.baseMapper.getSystemById(id); return this.baseMapper.getSystemById(id);
} }
......
...@@ -192,6 +192,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -192,6 +192,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${state.code:code}") @Value("${state.code:code}")
private String stationCode; private String stationCode;
@Value("${system.type}")
private String system;
@Value("${state.name:name}") @Value("${state.name:name}")
private String stationName; private String stationName;
...@@ -485,75 +488,72 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -485,75 +488,72 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 直流中心消息推送刷新 // 直流中心消息推送刷新
publishDataToDCCenterPage(equipmentSpecificIndexList); publishDataToDCCenterPage(equipmentSpecificIndexList);
if("zd".equals(system)){
// 向预控系统发送消息 System.out.println("站端系统----------------");
sendEquipSpecIndexToAutosysTopic(equipmentSpecificIndexList);
// 向预控系统发送消息
// 首页性能指标数据订阅 sendEquipSpecIndexToAutosysTopic(equipmentSpecificIndexList);
mqttSendGateway.sendToMqtt(indexTopic, JSON.toJSONString(indexStateList));
// 首页性能指标数据订阅
// 组态大屏消息推送,设备表实时指标修改 mqttSendGateway.sendToMqtt(indexTopic, JSON.toJSONString(indexStateList));
intePageSysDataRefresh(equipmentSpecificIndexList, topicEntity);
// 组态大屏消息推送,设备表实时指标修改
// 数字换流站同步指标修改 intePageSysDataRefresh(equipmentSpecificIndexList, topicEntity);
syncSpecificIndexsToGS(equipmentSpecificIndexList);
// 数字换流站同步指标修改
// 则更新拓扑节点数据及告警状态 syncSpecificIndexsToGS(equipmentSpecificIndexList);
updateNodeDateByEquipId(equipmentSpecificIndexList);
// 则更新拓扑节点数据及告警状态
// 向画布推送 updateNodeDateByEquipId(equipmentSpecificIndexList);
publishDataToCanvas(equipmentSpecificIndexList);
// 向画布推送
// 向其他系统推送报警 publishDataToCanvas(equipmentSpecificIndexList);
equipmentAlarmLogsToOtherSystems(alarmLogs);
// 向其他系统推送报警
// 直流中心消息推送刷新 equipmentAlarmLogsToOtherSystems(alarmLogs);
publishDataToDCCenterPage(equipmentSpecificIndexList);
if(vo.getEcode()!=null){
if(vo.getEcode()!=null){ String ecode= vo.getEcode();
String ecode= vo.getEcode(); boolean flag=false;
boolean flag=false;
//消防泵
//消防泵 String[] strings = pumpCodes.split(",");
String[] strings = pumpCodes.split(","); for (String string : strings) {
for (String string : strings) { if(ecode.startsWith(string)){
if(ecode.startsWith(string)){ //通知>消防应急预案
//通知>消防应急预案 topicEntity.setType("xfb");
topicEntity.setType("xfb"); mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity)); flag=true;
flag=true; break;
break; }
} }
}
// 消防炮
// 消防炮 String[] stringxfp = monitorCodes.split(",");
String[] stringxfp = monitorCodes.split(","); if(!flag){
if(!flag){ for (String string1 : stringxfp) {
for (String string1 : stringxfp) { if(ecode.startsWith(string1)){
if(ecode.startsWith(string1)){ //通知>消防应急预案
//通知>消防应急预案 topicEntity.setType("xfp");
topicEntity.setType("xfp"); mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity)); flag=true;
flag=true; break;
break; }
} }
} }
} //消防水源
//消防水源 if(!flag){
if(!flag){ List<Map> lit= iEquipmentSpecificSerivce.getWater(vo.getId());
List<Map> lit= iEquipmentSpecificSerivce.getWater(vo.getId()); if(lit!=null&& lit.size()>0){
if(lit!=null&& lit.size()>0){ topicEntity.setType("xfsy");
topicEntity.setType("xfsy"); mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity)); }
} }
} }
} }
} }
}); });
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -68,4 +67,18 @@ public class EquipmentController extends BaseController { ...@@ -68,4 +67,18 @@ public class EquipmentController extends BaseController {
public ResponseModel getWaterResourceList(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) { public ResponseModel getWaterResourceList(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
return ResponseHelper.buildResponse(equipmentService.getWaterResourceInfoList(bizOrgCode)); return ResponseHelper.buildResponse(equipmentService.getWaterResourceInfoList(bizOrgCode));
} }
/**
* 获取驻站消防员和运维人员数量
* @param
* @returnP
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/resources/count", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "消防资源部分数据-四横八纵", notes = "消防资源部分数据-四横八纵")
public ResponseModel<Map<String, Object>> getResourcesCount() {
Map<String, Object> map = equipmentService.getResourcesCount();
return ResponseHelper.buildResponse(map);
}
} }
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto; ...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.MaintenanceCompanyMapper; import com.yeejoin.amos.boot.module.common.api.mapper.MaintenanceCompanyMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -145,4 +146,8 @@ public class EquipmentServiceImpl { ...@@ -145,4 +146,8 @@ public class EquipmentServiceImpl {
public List<Map<String, Object>> getWaterResourceInfoList(String bizOrgCode){ public List<Map<String, Object>> getWaterResourceInfoList(String bizOrgCode){
return waterResourceServiceImpl.getWaterResourceInfoList(bizOrgCode); return waterResourceServiceImpl.getWaterResourceInfoList(bizOrgCode);
} }
public Map<String, Object> getResourcesCount() {
return waterResourceServiceImpl.getResourcesCount();
}
} }
package com.yeejoin.amos.knowledgebase.controller; package com.yeejoin.amos.knowledgebase.controller;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -80,6 +81,20 @@ public class DocLibraryResource { ...@@ -80,6 +81,20 @@ public class DocLibraryResource {
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "知识库卡片信息")
@RequestMapping(value = "/card", method = RequestMethod.GET)
public ResponseModel<Object> queryDocCard(HttpServletRequest request,
@RequestParam(value = "offset") Integer offset,
@RequestParam(value = "end") Integer end,
@RequestParam(value = "filterByCollection") String filterByCollection,
@RequestParam(value = "directoryId", required = false) Long directoryId,
@RequestParam(value = "docTitle", required = false) String docTitle,
@RequestParam(value = "createTimeLeft", required = false) String createTimeLeft,
@RequestParam(value = "createTimeRight", required = false) String createTimeRight) {
return ResponseHelper.buildResponse(docLibraryService.queryCardList());
}
/** /**
* 收藏文档 * 收藏文档
* *
......
...@@ -29,6 +29,10 @@ public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> { ...@@ -29,6 +29,10 @@ public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> {
List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap); List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
List<Map<String,Object>> queryDocCardList();
List<Map<String,Object>> queryCardCount();
int queryDocBaseInfoTotal(Map<String, Object> paramMap); int queryDocBaseInfoTotal(Map<String, Object> paramMap);
List<Long> getAllPublishedDocIds(); List<Long> getAllPublishedDocIds();
......
...@@ -181,6 +181,15 @@ public class DocLibraryService { ...@@ -181,6 +181,15 @@ public class DocLibraryService {
return page; return page;
} }
public Map<String,Object> queryCardList(){
List<Map<String, Object>> content = docContentService.getBaseMapper().queryDocCardList();
List<Map<String, Object>> countMap = docContentService.getBaseMapper().queryCardCount();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("content",content);
countMap.forEach(e->resultMap.put(e.get("directoryName").toString(),e.get("num")));
}
private void addExtraFieldsAndFilters(Map<String, Object> paramsMap, Map<String, String[]> requestMap) { private void addExtraFieldsAndFilters(Map<String, Object> paramsMap, Map<String, String[]> requestMap) {
List<KnowledgeDynamicsOptionModel> optionModels = dynamicsOptionService.queryByFunctional(RequestContext.getAppKey(), DynamicsFunctional.DOC_BASEINFO.name()); List<KnowledgeDynamicsOptionModel> optionModels = dynamicsOptionService.queryByFunctional(RequestContext.getAppKey(), DynamicsFunctional.DOC_BASEINFO.name());
if (ValidationUtil.isEmpty(optionModels)) { if (ValidationUtil.isEmpty(optionModels)) {
......
...@@ -124,6 +124,9 @@ state.code=GW190301 ...@@ -124,6 +124,9 @@ state.code=GW190301
state.name=\u9526\u5c4f\u6362\u6d41\u7ad9 state.name=\u9526\u5c4f\u6362\u6d41\u7ad9
#?????????????
system.type=zd
# 是否开启遥测数据上报 # 是否开启遥测数据上报
is.open.telemetering=false is.open.telemetering=false
......
...@@ -98,18 +98,12 @@ ...@@ -98,18 +98,12 @@
<select id="selectEmergencyMaterials" resultType="java.util.Map"> <select id="selectEmergencyMaterials" resultType="java.util.Map">
SELECT SELECT
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3104', '%' ) ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3104', '%' ) ) AS fireExtinguisher,
and wel.biz_org_code like concat(#{bizOrgCode} , '%') ) AS fireExtinguisher, ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3105', '%' ) ) AS fireHydrant,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3105', '%' ) ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3910', '%' ) ) AS fireShovel,
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireHydrant, ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3904', '%' ) ) AS fireAxe,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3910', '%' ) ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3911', '%' ) ) AS fireBucket,
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireShovel, ( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '1106', '%' ) ) AS respirator
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3904', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireAxe,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3911', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireBucket,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '1106', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS respirator
</select> </select>
<select id="selectEmergencyMaterialsDetails" resultType="java.util.Map"> <select id="selectEmergencyMaterialsDetails" resultType="java.util.Map">
SELECT SELECT
...@@ -147,6 +141,8 @@ ...@@ -147,6 +141,8 @@
concat( wesi.equipment_index_name, '(是)' ) concat( wesi.equipment_index_name, '(是)' )
WHEN 'false' THEN WHEN 'false' THEN
concat( wesi.equipment_index_name, '(否)' ) concat( wesi.equipment_index_name, '(否)' )
ELSE
wesi.equipment_index_name
END) ELSE wesi.value_label END FROM wl_equipment_specific_index wesi END) ELSE wesi.value_label END FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_index wei on wesi.equipment_index_id = wei.id LEFT JOIN wl_equipment_index wei on wesi.equipment_index_id = wei.id
WHERE wesi.equipment_specific_id = temp.id AND wei.is_trend = 0 WHERE wesi.equipment_specific_id = temp.id AND wei.is_trend = 0
...@@ -229,7 +225,7 @@ ...@@ -229,7 +225,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -253,7 +249,7 @@ ...@@ -253,7 +249,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -278,7 +274,7 @@ ...@@ -278,7 +274,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -303,7 +299,7 @@ ...@@ -303,7 +299,7 @@
wes.equipment_code as code , wes.equipment_code as code ,
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, IFNULL(wes.realtime_iot_index_name,
'--' '暂无信号'
) AS status, ) AS status,
CASE CASE
...@@ -327,6 +323,8 @@ ...@@ -327,6 +323,8 @@
temp.name, temp.name,
temp.nowPressure, temp.nowPressure,
temp.area, temp.area,
temp.minPressure AS `minValue`,
temp.maxPressure AS `maxValue`,
CASE CASE
WHEN temp.nowPressure = '--' THEN WHEN temp.nowPressure = '--' THEN
'--' '--'
...@@ -334,13 +332,9 @@ ...@@ -334,13 +332,9 @@
'--' '--'
WHEN temp.minPressure = '' THEN WHEN temp.minPressure = '' THEN
'--' '--'
WHEN ( temp.maxPressure = 0 ) THEN WHEN (temp.nowPressure - temp.maxPressure) > 0 THEN
'--'
WHEN ( temp.minPressure = 0 ) THEN
'--'
WHEN temp.nowPressure - temp.maxPressure > 0 THEN
'压力高' '压力高'
WHEN temp.minPressure - temp.nowPressure > 0 THEN WHEN (temp.minPressure - temp.nowPressure) > 0 THEN
'压力低' ELSE '正常' '压力低' ELSE '正常'
END AS status, END AS status,
1 AS type 1 AS type
...@@ -351,8 +345,8 @@ ...@@ -351,8 +345,8 @@
wes.name, wes.name,
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_PipePressureDetector_PipePressure' ), '--' ) AS nowPressure, IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_PipePressureDetector_PipePressure' ), '--' ) AS nowPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxPressure' ), 0 ) AS maxPressure, IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxPressure' AND field_value <![CDATA[<>]]> '' ), 1.5 ) AS maxPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minPressure' ), 0 ) AS minPressure IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minPressure' AND field_value <![CDATA[<>]]> '' ), 0.5 ) AS minPressure
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
...@@ -368,22 +362,20 @@ ...@@ -368,22 +362,20 @@
temp.name, temp.name,
temp.nowFlow, temp.nowFlow,
temp.area, temp.area,
temp.minFlow AS `minValue`,
temp.maxFlow AS `maxValue`,
CASE CASE
WHEN temp.nowFlow = '--' THEN WHEN temp.nowFlow = '--' THEN
'--' '--'
WHEN temp.maxFlow = '' THEN WHEN temp.maxFlow = '' THEN
'--' '--'
WHEN temp.minFlow = '' THEN WHEN temp.minFlow = '' THEN
'--' '--'
WHEN ( temp.maxFlow = 0 ) THEN WHEN (temp.nowFlow - IFNULL(temp.maxFlow, 0)) > 0 THEN
'--' '流量高'
WHEN ( temp.minFlow = 0 ) THEN WHEN (IFNULL(temp.minFlow, 0) - temp.nowFlow) > 0 THEN
'--' '流量低' ELSE '正常'
WHEN temp.nowFlow - temp.maxFlow > 0 THEN END AS status,
'流量高'
WHEN temp.minFlow - temp.nowFlow > 0 THEN
'流量低' ELSE '正常'
END AS status,
2 AS type 2 AS type
FROM FROM
( (
...@@ -392,8 +384,8 @@ ...@@ -392,8 +384,8 @@
wes.NAME, wes.NAME,
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' ), '--' ) AS nowFlow, IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' ), '--' ) AS nowFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxFlow' ), 0 ) AS maxFlow, IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxFlow' AND field_value <![CDATA[<>]]> '' ), 2.4 ) AS maxFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minFlow' ), 0 ) AS minFlow IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minFlow' AND field_value <![CDATA[<>]]> '' ), 0.5 ) AS minFlow
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
...@@ -404,5 +396,547 @@ ...@@ -404,5 +396,547 @@
wes.equipment_code LIKE concat( '92010700', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) wes.equipment_code LIKE concat( '92010700', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp ) temp
</select> </select>
<select id="selectAlarmAnalysis" resultType="java.util.Map">
SELECT
temp.date,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.biz_org_code like concat(#{bizOrgCode}, '%')
) AS faultNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.biz_org_code like concat(#{bizOrgCode}, '%')
) AS alarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.biz_org_code like concat(#{bizOrgCode}, '%')
) AS shieldNum
FROM
(
SELECT temp.selected_date as date FROM
(SELECT ADDDATE('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date FROM
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t0,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t1,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t2,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t3,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t4)
temp
WHERE selected_date BETWEEN #{startDate} AND #{endDate}
) temp
ORDER BY
temp.date
</select>
<select id="selectAlarmAnalysisCount" resultType="java.util.Map">
SELECT
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
) AS faultNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
) AS fireAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
) AS shieldNum
</select>
<select id="selectSystemCodes" resultType="java.lang.String">
SELECT
fs. code
FROM
f_fire_fighting_system fs
WHERE
fs.system_type_code = #{systemType}
</select>
<select id="selectFireCannonAlarmAnalysisPie" resultType="java.util.Map">
SELECT
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS faultNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS fireAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS shieldNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'PowerLoss')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS lossNum
</select>
<select id="waterSystemAlarmAnalysis" resultType="java.util.Map">
SELECT
temp.date,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010600' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS firePumpsAlarmNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010800' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS stabilizedPumpAlarmNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010500' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS controlCabinetAlarmNum
FROM
<if test="dataType == 1">
(
SELECT
date_format(
(#{date} - INTERVAL 0 MONTH),
'%Y-%m'
) AS `date`
UNION
(SELECT
date_format(
(#{date} - INTERVAL -1 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -2 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -3 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -4 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -5 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -6 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -7 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -8 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -9 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -10 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -11 MONTH),
'%Y-%m'
) AS `date`))temp
</if>
<if test="dataType != 1">
(
SELECT temp.selected_date as date FROM
(SELECT ADDDATE('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date FROM
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t0,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t1,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t2,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t3,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t4)
temp
WHERE selected_date BETWEEN #{startDate} AND #{endDate}
) temp
ORDER BY
temp.date
</if>
</select>
<select id="fireCannonSystemAlarmAnalysis" resultType="java.util.Map">
SELECT
temp.date,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm ')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS fireAlarmNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS shieldNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault ')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS faultNum,
(
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'PowerLoss ')
AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS powerLossNum
FROM
<if test="dataType == 1">
(
SELECT
date_format(
(#{date} - INTERVAL 0 MONTH),
'%Y-%m'
) AS `date`
UNION
(SELECT
date_format(
(#{date} - INTERVAL -1 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -2 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -3 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -4 MONTH),
'%Y-%m'
) AS `date`)
UNION
(SELECT
date_format(
(#{date} - INTERVAL -5 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -6 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -7 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -8 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -9 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -10 MONTH),
'%Y-%m'
) AS `date`)UNION
(SELECT
date_format(
(#{date} - INTERVAL -11 MONTH),
'%Y-%m'
) AS `date`))temp
</if>
<if test="dataType != 1">
(
SELECT temp.selected_date as date FROM
(SELECT ADDDATE('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date FROM
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t0,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t1,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t2,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t3,
(SELECT 0 i UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) t4)
temp
WHERE selected_date BETWEEN #{startDate} AND #{endDate}
) temp
ORDER BY
temp.date
</if>
</select>
<select id="waterSystemAlarmAnalysisPie" resultType="java.util.Map">
SELECT
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010600' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS firePumpsAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010800' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS stabilizedPumpAlarmNum,
(
SELECT
COUNT(
wespa.equipment_specific_id
)
FROM
wl_equipment_specific_alarm_log wespa
WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010500' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%')
</foreach>
) AS controlCabinetAlarmNum
</select>
<select id="getSystemAndCarCount" resultType="java.util.Map">
SELECT
(SELECT count(*) FROM f_fire_fighting_system) fireSystem,
(SELECT count(*) FROM wl_car) fireCar
</select>
</mapper> </mapper>
...@@ -1395,6 +1395,32 @@ ...@@ -1395,6 +1395,32 @@
ORDER BY ORDER BY
`wlesal`.`create_date` DESC `wlesal`.`create_date` DESC
</select> </select>
<select id="dcFireAlarmLogPage" resultType="java.util.HashMap">
SELECT
`wlesal`.equipment_specific_index_name type,
`wlesal`.equipment_specific_name alamContent,
DATE_FORMAT(`wlesal`.`create_date`,'%m-%d %H:%i:%s') createDate,
wlesal.location
FROM
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific_alarm` wesa ON wesa.id = wlesal.equipment_specific_alarm_id
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
<where>
wesa.`status` = 1
<if test="param.system != null and param.system != ''">
AND find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wlesal.type = #{param.fireEquipmentSpecificIndexKey}
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wlesal.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="alarmTrend" resultType="java.util.Map"> <select id="alarmTrend" resultType="java.util.Map">
SELECT SELECT
`result`.`click_date` AS `click_date`, `result`.`click_date` AS `click_date`,
...@@ -1480,6 +1506,7 @@ ...@@ -1480,6 +1506,7 @@
ORDER BY ORDER BY
`result`.`click_date` `result`.`click_date`
</select> </select>
<select id="pressureMessage" resultType="java.util.Map"> <select id="pressureMessage" resultType="java.util.Map">
select select
( (
...@@ -1516,5 +1543,33 @@ ...@@ -1516,5 +1543,33 @@
and update_date >= and update_date >=
#{startTime} and #{endTime} >= update_date #{startTime} and #{endTime} >= update_date
) as startNum) as startNum ) as startNum) as startNum
</select>
<select id="stationInfo" resultType="java.util.Map">
SELECT
a.`name`,
a.`code`,
CASE
WHEN a.countAlarmTotal = 0 THEN
SUM( a.NAME ) ELSE count( a.`name` )
END AS alarmEquipTotal,
IFNULL( SUM( a.countAlarmTotal ), 0 ) countAlarmTotal
FROM
(
SELECT
fs.`name`,
fs.`code`,
IFNULL( sum( wesi.`status` ), 0 ) AS countAlarmTotal
FROM
idx_biz_station_info fs
LEFT JOIN wl_equipment_specific_alarm wesi ON wesi.station_code = fs.`code`
AND wesi.`status` = 1
GROUP BY
fs.id,
wesi.equipment_specific_id
) a
GROUP BY
a.`name`
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5022,6 +5022,26 @@ ...@@ -5022,6 +5022,26 @@
OR ( `is_alarm` = 0 AND `value` = 'false' )) OR ( `is_alarm` = 0 AND `value` = 'false' ))
</select> </select>
<select id="queryStartAndStopBySpecificId" resultType="java.util.Map"> <select id="queryStartAndStopBySpecificId" resultType="java.util.Map">
( SELECT
i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
i.equipment_index_name
FROM
wl_equipment_specific_index i
WHERE
<if test="ids != null and ids.size > 0">
i.equipment_specific_id IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND
</if>
i.equipment_index_key in ('FHS_PressurePump_Start')
ORDER BY
i.update_date DESC
limit 1
) union
(
SELECT SELECT
i.equipment_specific_id, i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date, DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
...@@ -5036,10 +5056,11 @@ ...@@ -5036,10 +5056,11 @@
</foreach> </foreach>
AND AND
</if> </if>
i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop') i.equipment_index_key in ('FHS_PressurePump_Stop')
ORDER BY ORDER BY
i.update_date DESC i.update_date DESC
limit 2 limit 1
)
</select> </select>
<select id="queryStateBySpecificId" resultType="java.util.Map"> <select id="queryStateBySpecificId" resultType="java.util.Map">
SELECT SELECT
...@@ -5502,5 +5523,170 @@ ...@@ -5502,5 +5523,170 @@
GROUP BY GROUP BY
s.id s.id
</select> </select>
<select id="selectAllPressurePumpInfo" resultType="java.util.Map">
SELECT
ed.`name`,
concat_ws( '-', ws.full_name, ed.area ) area,
es.iot_code,
es.id,
IFNULL( sum( `status` ), 0 ) AS isAlarm
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE
ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''" >
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
es.id
</select>
<select id="selectAllDays" resultType="java.util.Map">
select temp.date from (
SELECT
date
FROM
(
SELECT
DATE_FORMAT(
DATE_SUB(
last_day(curdate()),
INTERVAL xc - 1 DAY
),
'%Y-%m-%d'
) AS date
FROM
(
SELECT
@xi :=@xi + 1 AS xc
FROM
(
SELECT
1
UNION
SELECT
2
UNION
SELECT
3
UNION
SELECT
4
UNION
SELECT
5
UNION
SELECT
6
) xc1,
(
SELECT
1
UNION
SELECT
2
UNION
SELECT
3
UNION
SELECT
4
UNION
SELECT
5
UNION
SELECT
6
) xc2,
(SELECT @xi := 0) xc0
) xcxc
) x0
WHERE
x0.date >= (
SELECT
date_add(
curdate(),
INTERVAL - DAY (curdate()) + 1 DAY
)
)
)temp
order by temp.date
</select>
<select id="getEquip" resultType="java.util.Map">
SELECT
spe.id,
det.`name` equipmentName,
spe.`code`,
det.`code` equipmentCode,
(
CASE
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 )
WHEN 0 THEN
'正常' ELSE '异常'
END
) flag
FROM
wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_stock_detail AS wlsd ON wlsd.equipment_detail_id = det.id
WHERE
fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireAlarmSys'
AND wlsd.`status` = 1
GROUP BY det.`code`
</select>
<select id="selectPressureDetails" resultType="java.util.Map">
SELECT
ed.`name`,
concat_ws('-', ws.full_name, ed.area) area,
es.iot_code as iotCode,
es.id,
(
SELECT
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Stop')
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS stopTime,
(
SELECT
DATE_FORMAT(wesi.update_date,'%Y-%m-%d %H:%i:%S')
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Start')
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS startTime
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE
ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
AND es.biz_org_code like CONCAT(#{bizOrgCode}, '%')
GROUP BY
es.id
</select>
<select id="selectEquipmentSpecificById" resultType="java.util.Map">
select * from wl_equipment_specific where id = #{id}
</select>
</mapper> </mapper>
...@@ -3858,5 +3858,18 @@ ...@@ -3858,5 +3858,18 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tym" id="202301050916">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>cb_data_dictionary 添加人员类型</comment>
<sql>
REPLACE INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `extend`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1604, '1604', '检修人员', 'DLRYLX', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 4);
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
)d LIMIT #{offset},#{length} )d LIMIT #{offset},#{length}
</select> </select>
<select id="queryDocBaseInfoList" parameterType="map" resultType="map"> <select id="queryDocBaseInfoList" parameterType="map" resultType="map">
SELECT SELECT
SEQUENCE_NBR sequenceNbr, REC_DATE recDate, DOC_STATUS docStatus, CREATE_TIME createTime, USER_ID userId, SEQUENCE_NBR sequenceNbr, REC_DATE recDate, DOC_STATUS docStatus, CREATE_TIME createTime, USER_ID userId,
...@@ -253,5 +252,72 @@ ...@@ -253,5 +252,72 @@
<select id="getAllPublishedDocIds" resultType="long"> <select id="getAllPublishedDocIds" resultType="long">
SELECT SEQUENCE_NBR FROM knowledge_doc_content WHERE DOC_STATUS = "PUBLISHED" SELECT SEQUENCE_NBR FROM knowledge_doc_content WHERE DOC_STATUS = "PUBLISHED"
</select> </select>
<select id="queryDocCardList" resultType="map">
SELECT
SEQUENCE_NBR sequenceNbr,
REC_DATE recDate,
DOC_STATUS docStatus,
CREATE_TIME createTime,
USER_ID userId,
AUDIT_STATUS auditStatus,
REJECTION_COMMENT rejectionComment,
AUDITOR_USER_ID auditorUserId,
ORG_CODE orgCode,
DOC_TITLE docTitle,
DIRECTORY_ID directoryId,
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName,
releaseDate,
excuteDate,
IFNULL( collectNum, 0 ) collectNum,
IFNULL( quoteNum, 0 ) quoteNum,
IFNULL( collect, "UNCOLLECT" ) collect
FROM
knowledge_doc_content doct
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" AND USER_ID = 3780967 ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE
DOC_STATUS = 'PUBLISHED'
ORDER BY
directoryName DESC,
create_time DESC
</select>
<select id="queryCardCount" resultType="map">
SELECT
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName,
COUNT(SEQUENCE_NBR) as num
FROM
knowledge_doc_content doct
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE
DOC_STATUS = 'PUBLISHED'
GROUP BY DIRECTORY_ID
</select>
</mapper> </mapper>
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