Commit 5c91e438 authored by xixinzhao's avatar xixinzhao

建筑修改

parent cb5f0988
......@@ -219,8 +219,8 @@ public class BuildingController extends AbstractBaseController {
@GetMapping(value = "/getEveryCount")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询建筑画布下装备")
public Map<String, Object> getEveryCount(@RequestParam Long id, @RequestParam String groupType) {
return buildService.getEveryCount(id, groupType);
public Map<String, Object> getEveryCount(@RequestParam Long id, @RequestParam String groupType, @RequestParam(required = false) String bizOrgCode) {
return buildService.getEveryCount(id, groupType, bizOrgCode);
}
@GetMapping(value = "/getChildrenNotIsRiskList")
......
......@@ -144,4 +144,20 @@ public interface BuildingMapper extends BaseMapper<Building> {
* @return
*/
List<BuildingTreeAndEquipVO> getSonBuildingTree2();
/**
* 获取房间楼层数量
* @param type 类型
* @param bizOrgCode code
* @return 数量
*/
Long getCountByTypeCode(String type, String bizOrgCode);
/**
* 根据code获取装备数量
* @param bizOrgCode code
* @return 数量
*/
Long getEquipCount(String bizOrgCode);
}
......@@ -30,7 +30,7 @@ public class BuildFloorPage implements PageOperation {
Map<String, Object> instanceIdMap = (Map<String, Object>) instanceId;
instanceIdMap.put("equipmentTotal", builldService.getEveryCount(
Long.parseLong(String.valueOf(instanceIdMap.get("instanceId"))),
GroupTypeEnum.FLOOR.getType()).get("equipCount"));
GroupTypeEnum.FLOOR.getType(), "").get("equipCount"));
builldService.sourceBuild(instanceIdMap);
});
}
......
......@@ -199,7 +199,7 @@ public interface IBuilldService extends IService<Building> {
* @param groupType
* @return
*/
Map<String ,Object> getEveryCount( Long id, String groupType);
Map<String ,Object> getEveryCount( Long id, String groupType, String bizOrgCode);
/**
* 消防建筑视屏监控统计树
......
......@@ -525,10 +525,15 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
@Override
public Map<String, Object> getEveryCount(Long id, String groupType) {
public Map<String, Object> getEveryCount(Long id, String groupType, String bizOrgCode) {
Map<String, Object> map = new HashMap<>();
if ("".equals(groupType) || "allBuilding".equals(groupType) || groupType == null) {
map.put("error", "类型填写错误");
if ("".equals(groupType) || "allBuilding".equals(groupType)) {
Long roomCount = this.baseMapper.getCountByTypeCode("room", bizOrgCode);
Long floorCount = this.baseMapper.getCountByTypeCode("floor", bizOrgCode);
Long equipCount = this.baseMapper.getEquipCount(bizOrgCode);
map.put("floorCount", floorCount);
map.put("roomCount", roomCount);
map.put("equipCount", equipCount);
return map;
}
if ("allfloor".equals(groupType)) {
......@@ -635,7 +640,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
*/
@Override
public Long equipmentTotal(Long instanceId, String groupType) {
Map<String, Object> map = getEveryCount(instanceId, groupType);
Map<String, Object> map = getEveryCount(instanceId, groupType,null);
return Long.parseLong(String.valueOf(map.get("equipCount")));
}
......
......@@ -435,4 +435,29 @@
union all
select id,null as parentId,fei.`name`,'equipment' as type from f_equipment fei where fei.risk_source_id=#{id}
</select>
<select id="getCountByTypeCode" resultType="java.lang.Long">
SELECT
count(1)
FROM
wl_form_instance
WHERE
field_name = 'bizOrgCode'
AND field_value LIKE CONCAT(#{bizOrgCode},'%')
AND group_type = #{type}
</select>
<select id="getEquipCount" resultType="java.lang.Long">
SELECT
IF (
sum(sto.amount) IS NULL,
0,
sum(sto.amount)
) AS count
FROM
wl_stock_detail AS sto
LEFT JOIN wl_warehouse_structure AS war ON sto.warehouse_structure_id = war.id
LEFT JOIN wl_form_instance wfi ON wfi.instance_id = war.source_id
WHERE
wfi.field_name = 'bizOrgCode'
AND wfi.field_value LIKE CONCAT(#{bizOrgCode},'%')
</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