Commit d9851bcc authored by tianyiming's avatar tianyiming

四横八纵消防资源总览页面接口

parent 79999b43
......@@ -147,4 +147,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> companyUserTreeByUserAndType(Map<String, Object> param);
List<OrgUsr> companyUserTreeByUserAndTypeALL(@Param("bizorgcode") String bizorgcode);
List<Map<String, Object>> getFireProtectionAndMaintenance();
}
......@@ -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);
Map<String, Object> getWaterResourceInfoList(@Param("map") Map<String, Object> map);
Map<String, Object> getResourcesCount();
}
......@@ -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 java.util.List;
import java.util.Map;
/**
* 接口类
......@@ -36,4 +37,5 @@ public interface IWaterResourceService {
* */
WaterResourceDto selectBySequenceNbr(Long id);
Map<String, Object> getResourcesCount();
}
......@@ -233,4 +233,49 @@
</if>
) AS fireWaterTank
</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>
......@@ -317,6 +317,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
return waterResourceDto;
}
@Override
public Map<String, Object> getResourcesCount() {
return waterResourceMapper.getResourcesCount();
}
public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) {
return waterResourceMapper.getWaterResourceTypeList(isDelete);
}
......@@ -541,4 +546,8 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
});
return list;
}
}
......@@ -61,12 +61,15 @@ public class EmergencyController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("应急物资")
@GetMapping(value = "/emergencyMaterials")
public Map<String, Object> emergencyMaterials(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ) {
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.emergencyMaterials(bizOrgCode);
public Map<String, Object> emergencyMaterials() {
return iEmergencyService.emergencyMaterials();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防系统/消防车")
@GetMapping(value = "/systemAndCar")
public Map<String, Object> systemAndCar() {
return iEmergencyService.systemAndCar();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -18,7 +18,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param bizOrgCode
* @return
*/
Map<String, Object> selectEmergencyMaterials(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEmergencyMaterials();
/**
* 应急物资详情
......@@ -65,4 +65,5 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> selectAlarmAnalysisCount(@Param("bizOrgCode") String bizOrgCode, @Param("startDate")String startDate, @Param("endDate")String endDate);
Map<String, Object> getSystemAndCarCount();
}
......@@ -22,7 +22,7 @@ public interface IEmergencyService {
*/
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);
......@@ -37,4 +37,6 @@ public interface IEmergencyService {
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();
}
......@@ -59,8 +59,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
}
@Override
public Map<String, Object> emergencyMaterials(String bizOrgCode) {
return emergencyMapper.selectEmergencyMaterials(bizOrgCode);
public Map<String, Object> emergencyMaterials() {
return emergencyMapper.selectEmergencyMaterials();
}
@Override
......@@ -97,4 +97,9 @@ public class EmergencyServiceImpl implements IEmergencyService {
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();
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.HashMap;
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.biz.service.impl.WaterResourceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -68,4 +67,18 @@ public class EquipmentController extends BaseController {
public ResponseModel getWaterResourceList(@RequestParam(value = "bizOrgCode", required = false) String 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;
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.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 org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -145,4 +146,8 @@ public class EquipmentServiceImpl {
public List<Map<String, Object>> getWaterResourceInfoList(String bizOrgCode){
return waterResourceServiceImpl.getWaterResourceInfoList(bizOrgCode);
}
public Map<String, Object> getResourcesCount() {
return waterResourceServiceImpl.getResourcesCount();
}
}
......@@ -98,18 +98,12 @@
<select id="selectEmergencyMaterials" resultType="java.util.Map">
SELECT
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3104', '%' )
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', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireHydrant,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3910', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireShovel,
( 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 COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3104', '%' ) ) 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( '3910', '%' ) ) AS fireShovel,
( 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( '3911', '%' ) ) AS fireBucket,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '1106', '%' ) ) AS respirator
</select>
<select id="selectEmergencyMaterialsDetails" resultType="java.util.Map">
SELECT
......@@ -518,4 +512,9 @@
</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>
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