Commit 0c58ace3 authored by zhangsen's avatar zhangsen

三小水源API

parent 1637ebb3
......@@ -38,8 +38,9 @@ public class PersonIdentifyAspect {
@Autowired
private JcsFeign jcsFeignClient;
@Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))")
// package com.yeejoin.equipmanage.controller;
// com.yeejoin.amos.boot.biz.common.controller.BaseController
@Pointcut("execution(public * com.*.equipmanage.controller..*(..))")
public void userDate() {
}
......
......@@ -158,5 +158,13 @@ public class ConfigureController extends AbstractBaseController {
return CommonResponseUtil.success(fireFightingSystemMapper.getFireCarInfoByWL(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "3小水源信息")
@GetMapping("/getWaterInfo")
public ResponseModel getWaterInfo() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
return CommonResponseUtil.success(fireFightingSystemMapper.getWaterInfo(bizOrgCode));
}
}
......@@ -271,4 +271,11 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @return
*/
List<Map<String, Object>> getFireCarInfoByWL(@Param("bizOrgCode") String bizOrgCode);
/**
* 获取水源信息
* @param bizOrgCode
* @return
*/
List<Map<String, Object>> getWaterInfo(@Param("bizOrgCode") String bizOrgCode);
}
......@@ -2513,4 +2513,58 @@
</if>
</where>
</select>
<select id="getWaterInfo" resultType="java.util.Map">
SELECT
r.`name`,
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
IFNULL((
abs(
IFNULL(
max( CASE WHEN ei.name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value END ),
IFNULL( rp.min_water_level, 0 )) /
IF
(
IFNULL( rp.max_water_level, 0 ) = 0,
1,
IFNULL( rp.max_water_level, 0 ))) * 100
),
0
) AS levelAbs,
IFNULL(
max( CASE WHEN ei.name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value END ),
IFNULL( rp.min_water_level, 0 )) AS nowLevel,
(
CASE
WHEN IFNULL(
max( CASE WHEN ei.name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value END ),
IFNULL( rp.min_water_level, 0 )) &lt; IFNULL( rp.min_water_level, 0 ) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type
FROM
cb_water_resource r
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific es ON es.id = rp.level_device_id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_index ei ON ei.equipment_id = ed.equipment_id
LEFT JOIN wl_equipment e ON e.id = ei.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id
WHERE
r.resource_type IN ( 'pool', 'industryPool' )
AND r.is_delete = 1
AND ou.`code` IS NOT NULL
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND r.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if>
GROUP BY
r.sequence_nbr
</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