Commit fb366212 authored by zhangsen's avatar zhangsen

大屏API调整

parent fbc18102
...@@ -12,11 +12,11 @@ public class BigScreenVo { ...@@ -12,11 +12,11 @@ public class BigScreenVo {
private List<Map<String, Object>> carNumInfo; private List<Map<String, Object>> carNumInfo;
// private Map<String, Object> systemAlarmInfoNum; private List<Map<String, Object>> systemAlarmInfoNum;
//
// private Map<String, Object> pool; private List<Map<String, Object>> pool;
//
// private Map<String, Object> industryPool; private List<Map<String, Object>> industryPool;
//
// private Integer carNum; // private Integer carNum;
} }
...@@ -25,8 +25,15 @@ public class BigScreenController { ...@@ -25,8 +25,15 @@ public class BigScreenController {
@GetMapping(value = "/list") @GetMapping(value = "/list")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "系统、消防水池、工业水池、水源总容积、消防车辆", notes = "系统、消防水池、工业水池、水源总容积、消防车辆") @ApiOperation(httpMethod = "GET", value = "系统、消防水池、工业水池、水源总容积、消防车辆(接口弃用)", notes = "系统、消防水池、工业水池、水源总容积、消防车辆")
public ResponseModel<BigScreenVo> getSystemAlarmInfoNum(@RequestParam(required = false, value = "companyCode") String companyCode) { public ResponseModel<BigScreenVo> getSystemAlarmInfoNum(@RequestParam(required = false, value = "companyCode") String companyCode) {
return CommonResponseUtil.success(iFireFightingSystemService.getSystemAlarmInfoNum(companyCode)); return CommonResponseUtil.success(iFireFightingSystemService.getSystemAlarmInfoNum(companyCode));
} }
@GetMapping(value = "/getCarInfo")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "系统、消防水池、工业水池、消防车辆", notes = "系统、消防水池、工业水池、消防车辆")
public ResponseModel<BigScreenVo> getCarInfo(@RequestParam(required = false, value = "companyCode") String companyCode) {
return CommonResponseUtil.success(iFireFightingSystemService.getCarInfo(companyCode));
}
} }
...@@ -377,14 +377,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -377,14 +377,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @param companyCode * @param companyCode
* @return * @return
*/ */
Map<String, Object> getSystemAlarmInfoNum(@Param("companyCode") String companyCode); List<Map<String, Object>> getSystemAlarmInfoNum(@Param("companyCode") String companyCode);
/** /**
* 消防水池或者工业水池信息 * 消防水池或者工业水池信息
* @param companyCode * @param companyCode
* @return * @return
*/ */
Map<String, Object> getWaterPoolInfoNum(@Param("companyCode") String companyCode, @Param("poolType") String poolType); List<Map<String, Object>> getWaterPoolInfoNum(@Param("companyCode") String companyCode, @Param("poolType") String poolType);
/** /**
* 消防水源总量统计 * 消防水源总量统计
...@@ -399,4 +399,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -399,4 +399,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @return * @return
*/ */
Integer getCarNum(@Param("companyCode") String companyCode); Integer getCarNum(@Param("companyCode") String companyCode);
List<Map<String, Object>> getCarInfo(@Param("companyCode") String companyCode);
} }
...@@ -255,4 +255,5 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -255,4 +255,5 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/ */
BigScreenVo getSystemAlarmInfoNum(String companyCode); BigScreenVo getSystemAlarmInfoNum(String companyCode);
BigScreenVo getCarInfo(String companyCode);
} }
...@@ -1326,15 +1326,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1326,15 +1326,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
public BigScreenVo getSystemAlarmInfoNum(String companyCode) { public BigScreenVo getSystemAlarmInfoNum(String companyCode) {
BigScreenVo bigScreenVo = new BigScreenVo(); BigScreenVo bigScreenVo = new BigScreenVo();
List<Map<String, Object>> infoList = new ArrayList<>(); List<Map<String, Object>> infoList = new ArrayList<>();
Map<String, Object> systemAlarmInfoNum = fireFightingSystemMapper.getSystemAlarmInfoNum(companyCode); // Map<String, Object> systemAlarmInfoNum = fireFightingSystemMapper.getSystemAlarmInfoNum(companyCode);
// bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum); //// bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum);
infoList.add(systemAlarmInfoNum); // infoList.add(systemAlarmInfoNum);
Map<String, Object> pool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "pool"); // Map<String, Object> pool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "pool");
// bigScreenVo.setPool(pool); //// bigScreenVo.setPool(pool);
infoList.add(pool); // infoList.add(pool);
Map<String, Object> industryPool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "industryPool"); // Map<String, Object> industryPool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "industryPool");
// bigScreenVo.setIndustryPool(industryPool); // bigScreenVo.setIndustryPool(industryPool);
infoList.add(industryPool); // infoList.add(industryPool);
List<Map<String, Object>> carInfoList = new ArrayList<>(); List<Map<String, Object>> carInfoList = new ArrayList<>();
Integer carNum = fireFightingSystemMapper.getCarNum(companyCode); Integer carNum = fireFightingSystemMapper.getCarNum(companyCode);
Map<String, Object> carInfo = new HashMap<>(); Map<String, Object> carInfo = new HashMap<>();
...@@ -1345,4 +1345,18 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1345,4 +1345,18 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
bigScreenVo.setInfoList(infoList); bigScreenVo.setInfoList(infoList);
return bigScreenVo; return bigScreenVo;
} }
@Override
public BigScreenVo getCarInfo(String companyCode) {
BigScreenVo bigScreenVo = new BigScreenVo();
List<Map<String, Object>> carInfo = fireFightingSystemMapper.getCarInfo(companyCode);
bigScreenVo.setCarNumInfo(carInfo);
List<Map<String, Object>> systemAlarmInfoNum = fireFightingSystemMapper.getSystemAlarmInfoNum(companyCode);
List<Map<String, Object>> pool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "pool");
List<Map<String, Object>> industryPool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "industryPool");
bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum);
bigScreenVo.setIndustryPool(industryPool);
bigScreenVo.setPool(pool);
return bigScreenVo;
}
} }
...@@ -2326,7 +2326,9 @@ ...@@ -2326,7 +2326,9 @@
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
AND wc.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR} AND wc.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if> </if>
</where>) a </where>
group by `wc`.`id`
) a
</select> </select>
<select id="getWaterInfo" resultType="java.util.Map"> <select id="getWaterInfo" resultType="java.util.Map">
...@@ -2796,4 +2798,37 @@ ...@@ -2796,4 +2798,37 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getCarInfo" resultType="java.util.Map">
select b.*,
(TRUNCATE (
abs((
b.near7DaysStartNum) /
IF
(( b.totalCarNum = 0 ), 1, b.totalCarNum )),
2
) * 100) as carAbs
from
(SELECT
count(( a.carStateDate BETWEEN DATE_ADD( now(), INTERVAL - 7 DAY ) AND now()) OR NULL ) AS near7DaysStartNum,
count( 1 ) AS totalCarNum
FROM
(
SELECT
`wc`.`id` AS `id`,
`wc`.`name` AS `name`,
max( CASE WHEN `wcp`.`equipment_index_key` = 'FireCar_Start' THEN `wcp`.`update_date` END ) AS `carStateDate`
FROM
`wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
LEFT JOIN cb_org_usr ou ON ou.amos_org_code = wc.org_code
<where>
<if test="companyCode!=null and companyCode!=''">
ou.`code` = #{companyCode}
</if>
</where>
GROUP BY
wc.id
) a) b
</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