Commit c403cf5a authored by 李秀明's avatar 李秀明

fix: 设备平台-消防系统配置-系统分组接口开发

parent 3b807bba
...@@ -24,7 +24,7 @@ public class FireFightingSystemGroupEntity extends BaseEntity { ...@@ -24,7 +24,7 @@ public class FireFightingSystemGroupEntity extends BaseEntity {
private String groupCode; private String groupCode;
@ApiModelProperty(value = "展示类型:0-系统部件 1-安措") @ApiModelProperty(value = "展示类型:0-系统部件 1-安措")
private Integer showType; private Integer displayType;
@ApiModelProperty(value = "系统ID") @ApiModelProperty(value = "系统ID")
private String systemIds; private String systemIds;
......
package com.yeejoin.equipmanage.common.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class CoreEquipmentsDto {
@ApiModelProperty(value = "装备ID")
private String id;
@ApiModelProperty(value = "装备名称")
private String name;
@ApiModelProperty(value = "装备排序")
private Integer sort;
@ApiModelProperty(value = "所属类型")
private Integer type;
}
package com.yeejoin.equipmanage.common.entity.dto;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity;
import com.yeejoin.equipmanage.common.entity.publics.BaseDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class FireFightingSystemGroupModalDto extends BaseDTO<FireFightingSystemGroupEntity> {
@ApiModelProperty(value = "分组名称")
private String groupName;
@ApiModelProperty(value = "展示类型:0-安措 1-保护区域")
private Integer displayType;
@ApiModelProperty(value = "分组排序")
private Integer sort;
@ApiModelProperty(value = "系统装备列表")
private List<SystemEquipmentsDto> systems;
@ApiModelProperty(value = "业务组织编码")
private String bizOrgCode;
@ApiModelProperty(value = "业务组织名称")
private String bizOrgName;
}
package com.yeejoin.equipmanage.common.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@Accessors(chain = true)
public class SystemEquipmentsDto {
@ApiModelProperty(value = "系统ID")
private String id;
@ApiModelProperty(value = "系统名称")
private String name;
@ApiModelProperty(value = "系统排序")
private Integer sort;
@ApiModelProperty(value = "装备列表")
private List<CoreEquipmentsDto> equipments;
}
...@@ -22,4 +22,6 @@ public class EquipCountBySystemVO { ...@@ -22,4 +22,6 @@ public class EquipCountBySystemVO {
private Integer equipmentNum; private Integer equipmentNum;
@ApiModelProperty(value = "单位") @ApiModelProperty(value = "单位")
private String unitName; private String unitName;
@ApiModelProperty(value = "图标")
private String img;
} }
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
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;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -132,6 +134,16 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -132,6 +134,16 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getEquipCountBySystemId(systemId); return fireFightingSystemService.getEquipCountBySystemId(systemId);
} }
@RequestMapping(value = "/getEquipCountPageBySystemId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询分组设备数量")
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@RequestParam("systemId") Long systemId,
@RequestParam(value = "pageNumber", required = false) Integer pageNumber,
@RequestParam(value = "pageSize", required = false) Integer pageSize
) {
return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize);
}
@RequestMapping(value = "/getOneById", method = RequestMethod.GET) @RequestMapping(value = "/getOneById", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过id查询消防系统信息") @ApiOperation("通过id查询消防系统信息")
...@@ -855,6 +867,24 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -855,6 +867,24 @@ public class FireFightingSystemController extends AbstractBaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "消防系统列表查询(不分页)", notes = "下拉使用")
@GetMapping(value = "/systems")
public List<FireFightingSystemEntity> systems(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
Wrapper<FireFightingSystemEntity> wrapper = Wrappers.<FireFightingSystemEntity>lambdaQuery()
.likeRight(FireFightingSystemEntity::getBizOrgCode, bizOrgCode)
.isNotNull(FireFightingSystemEntity::getName)
.isNotNull(FireFightingSystemEntity::getSystemType);
return fireFightingSystemService.list(wrapper);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "消防系统树和消防建筑树", notes = "树菜单") @ApiOperation(value = "消防系统树和消防建筑树", notes = "树菜单")
@GetMapping(value = "/getBuildingTreeAndSystemTree") @GetMapping(value = "/getBuildingTreeAndSystemTree")
public Map<String, List> getBuildingTreeAndSystemTree(RequestBaseDto dto) { public Map<String, List> getBuildingTreeAndSystemTree(RequestBaseDto dto) {
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; 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.equipmanage.common.dto.FireFightingSystemGroupDto; import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.dto.FireFightingSystemGroupModalDto;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.service.FireFightingSystemGroupService; import com.yeejoin.equipmanage.service.FireFightingSystemGroupService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -16,49 +21,56 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -16,49 +21,56 @@ 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.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "消防系统分组") @Api(tags = "消防系统分组")
@RequestMapping(value = "/fire-fighting-system") @RequestMapping(value = "/fire-fighting-system-group")
public class FireFightingSystemGroupController extends BaseController { public class FireFightingSystemGroupController extends BaseController {
@Autowired @Autowired
private FireFightingSystemGroupService fireFightingSystemGroupService; private FireFightingSystemGroupService fireFightingSystemGroupService;
@PutMapping(value = "/save") @ApiOperation(value = "消防系统列表查询(未绑定分组的系统)", notes = "下拉使用")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "添加分组", notes = "添加分组") @GetMapping(value = "/systems")
public ResponseModel save(@RequestBody FireFightingSystemGroupDto dto) { public ResponseModel systems(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
if (!(Objects.nonNull(dto.getGroupName()) && Objects.nonNull(dto.getShowType()) && Objects.nonNull(dto.getSystemIds()) && !dto.getSystemEquipmentRelations().isEmpty())) { if (StringUtils.isEmpty(bizOrgCode)) {
return CommonResponseUtil.failure("非法参数");
}
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
dto.setBizOrgCode(reginParams.getCompany().getOrgCode()); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
dto.setBizOrgCode(reginParams.getCompany().getCompanyName()); if (!ValidationUtil.isEmpty(personIdentity)) {
return CommonResponseUtil.success(fireFightingSystemGroupService.saveOrUpdate(dto)); bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(fireFightingSystemGroupService.selectUnboundSystems(bizOrgCode));
} }
@PostMapping(value = "/update") @RequestMapping(value = "/save-or-update", method = {RequestMethod.PUT, RequestMethod.POST})
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "更新分组", notes = "更新分组") @ApiOperation(httpMethod = "PUT", value = "添加/更新分组", notes = "添加/更新分组")
public ResponseModel update(@RequestBody FireFightingSystemGroupDto dto) { public ResponseModel save(@RequestBody FireFightingSystemGroupModalDto dto) {
if (!(Objects.nonNull(dto.getId()) && Objects.nonNull(dto.getGroupName()) && Objects.nonNull(dto.getShowType()) && Objects.nonNull(dto.getSystemIds()) && !dto.getSystemEquipmentRelations().isEmpty())) { if (!(Objects.nonNull(dto.getGroupName()) && Objects.nonNull(dto.getDisplayType()) && Objects.nonNull(dto.getSystems()))) {
return CommonResponseUtil.failure("非法参数"); return CommonResponseUtil.failure("非法参数");
} }
ReginParams reginParams = getSelectedOrgInfo();
dto.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
dto.setBizOrgName(reginParams.getPersonIdentity().getCompanyName());
return CommonResponseUtil.success(fireFightingSystemGroupService.saveOrUpdate(dto)); return CommonResponseUtil.success(fireFightingSystemGroupService.saveOrUpdate(dto));
} }
@PostMapping(value = "/update-group-sort") @PutMapping(value = "/update-group-sort")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "更新分组展示顺序", notes = "更新分组展示顺序") @ApiOperation(httpMethod = "PUT", value = "更新分组展示顺序", notes = "更新分组展示顺序")
public ResponseModel updateGroupSort(@RequestBody List<Long> groupIds) { public ResponseModel updateGroupSort(@RequestParam("groupIds") String groupIds) {
if (Objects.isNull(groupIds) || groupIds.isEmpty()) { if (Objects.isNull(groupIds) || groupIds.isEmpty()) {
return CommonResponseUtil.failure("非法参数"); return CommonResponseUtil.failure("非法参数");
} }
fireFightingSystemGroupService.updateGroupSort(groupIds); List<Long> ids = Arrays.stream(groupIds.split(",")).map(Long::valueOf).mapToLong(Long::longValue).boxed().collect(Collectors.toList());
fireFightingSystemGroupService.updateGroupSort(ids);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
...@@ -78,8 +90,17 @@ public class FireFightingSystemGroupController extends BaseController { ...@@ -78,8 +90,17 @@ public class FireFightingSystemGroupController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询分组列表", notes = "查询分组列表") @ApiOperation(httpMethod = "GET", value = "查询分组列表", notes = "查询分组列表")
public ResponseModel list(@RequestParam(required = false) String bizOrgCode) { public ResponseModel list(@RequestParam(required = false) String bizOrgCode) {
if (StringUtils.isEmpty(bizOrgCode)) { if (StringUtils.isEmpty(bizOrgCode)) {
bizOrgCode = getOrgCode(); ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
} }
return CommonResponseUtil.success(fireFightingSystemGroupService.listGroup(bizOrgCode)); return CommonResponseUtil.success(fireFightingSystemGroupService.listGroup(bizOrgCode));
} }
@DeleteMapping(value = "/{id}")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "DELETE", value = "删除分组", notes = "删除分组")
public ResponseModel deteleGroup(@PathVariable("id") Long id) {
fireFightingSystemGroupService.deleteGroup(id);
return CommonResponseUtil.success();
}
} }
...@@ -29,7 +29,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -29,7 +29,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
int getEquipmentSpeCount(Map<String, Object> map); int getEquipmentSpeCount(Map<String, Object> map);
List<Map<String, Object>> getEquipmentSpecificCount(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getEquipmentCount(@Param("bizOrgCode") String bizOrgCode);
IPage<ComplementCodeVO> selectEquipmentSpecific(Page page, EquipmentSpecificDTO equipmentSpecificDTO); IPage<ComplementCodeVO> selectEquipmentSpecific(Page page, EquipmentSpecificDTO equipmentSpecificDTO);
...@@ -336,4 +336,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -336,4 +336,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<Map<String, Object>> selectZJEquipmentSpecificWWXByIds(String bussIds); List<Map<String, Object>> selectZJEquipmentSpecificWWXByIds(String bussIds);
Integer selectEquipmentCountBySystemId(@Param("systemId") Long systemId);
} }
...@@ -53,6 +53,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -53,6 +53,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/ */
List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId); List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId);
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@Param("page") Page<Object> page, @Param("systemId") Long systemId);
/** /**
* 保存 * 保存
* *
......
...@@ -2,19 +2,23 @@ package com.yeejoin.equipmanage.service; ...@@ -2,19 +2,23 @@ package com.yeejoin.equipmanage.service;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.dto.FireFightingSystemGroupDto;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity; import com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity;
import com.yeejoin.equipmanage.common.entity.dto.FireFightingSystemGroupModalDto;
import java.util.List; import java.util.List;
public interface FireFightingSystemGroupService extends IService<FireFightingSystemGroupEntity> { public interface FireFightingSystemGroupService extends IService<FireFightingSystemGroupEntity> {
/** /**
* 获取未绑定分组的系统列表
*/
JSONArray selectUnboundSystems(String bizOrgCode);
/**
* 保存分组 * 保存分组
* *
* @param fireFightingSystemGroupDto 分组信息 * @param fireFightingSystemGroupModalDto 分组信息
*/ */
Boolean saveOrUpdate(FireFightingSystemGroupDto fireFightingSystemGroupDto); Boolean saveOrUpdate(FireFightingSystemGroupModalDto fireFightingSystemGroupModalDto);
/** /**
* 更新分组排序 * 更新分组排序
...@@ -33,4 +37,9 @@ public interface FireFightingSystemGroupService extends IService<FireFightingSys ...@@ -33,4 +37,9 @@ public interface FireFightingSystemGroupService extends IService<FireFightingSys
* @return 分组列表 * @return 分组列表
*/ */
JSONArray listGroup(String bizOrgCode); JSONArray listGroup(String bizOrgCode);
/**
* 删除分组
*/
void deleteGroup(Long groupId);
} }
...@@ -60,6 +60,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -60,6 +60,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId); List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId);
/** /**
* 根据系统id查询分组设备数量
*
* @param systemId
* @return
*/
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize);
/**
* 保存 * 保存
* *
* @param vo * @param vo
......
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -6,6 +6,7 @@ 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;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -63,6 +64,7 @@ import java.net.NetworkInterface; ...@@ -63,6 +64,7 @@ import java.net.NetworkInterface;
import java.net.SocketException; import java.net.SocketException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -94,6 +96,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -94,6 +96,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Autowired @Autowired
EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper; EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper;
@Autowired @Autowired
EquipmentSpecificAlarmLogMapper equipmentSpecificAlarmLogMapper;
@Autowired
private SourceSceneMapper sourceSceneMapper; private SourceSceneMapper sourceSceneMapper;
@Value("${equipment.fire.systemid}") @Value("${equipment.fire.systemid}")
private String fireSystemId; private String fireSystemId;
...@@ -182,6 +186,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -182,6 +186,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize) {
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId);
}
@Override
public List<EquiplistSpecificBySystemVO> public List<EquiplistSpecificBySystemVO>
getEquiplistBySystemId(Long systemId) { getEquiplistBySystemId(Long systemId) {
return this.baseMapper.getEquiplistBySystemId(systemId); return this.baseMapper.getEquiplistBySystemId(systemId);
...@@ -1114,7 +1124,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1114,7 +1124,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public List<AlarmDataVO> getSystemById(Long id) { public List<AlarmDataVO> getSystemById(Long id) {
return this.baseMapper.getSystemById(id); List<AlarmDataVO> list = this.baseMapper.getSystemById(id);
// 部件总数
Integer equipmentCount = equipmentSpecificMapper.selectCount(
Wrappers.<EquipmentSpecific>lambdaQuery().eq(EquipmentSpecific::getSystemId, id)
);
// 今日报警次数
Integer alarmCount = equipmentSpecificAlarmLogMapper.selectCount(
Wrappers.<EquipmentSpecificAlarmLog>lambdaQuery()
.like(EquipmentSpecificAlarmLog::getSystemIds, id)
.eq(EquipmentSpecificAlarmLog::getStatus, "1")
.likeRight(EquipmentSpecificAlarmLog::getCreateDate, LocalDate.now().toString())
);
list.add(new AlarmDataVO("部件总数", equipmentCount + " 个", false));
list.add(new AlarmDataVO("今日报警次数", alarmCount + " 次", false));
return list;
} }
@Override @Override
......
...@@ -109,18 +109,21 @@ ...@@ -109,18 +109,21 @@
AND code like CONCAT('%',#{code},'%') AND code like CONCAT('%',#{code},'%')
</if> </if>
</select> </select>
<select id="getEquipmentSpecificCount" resultType="Map"> <select id="getEquipmentCount" resultType="Map">
SELECT SELECT
we.id as id, we.id AS equipmentId,
we.name as equipmentName, we.name AS equipmentName,
count(1) as count count(1) AS count,
u.name AS unit
FROM FROM
wl_equipment_specific wesp wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail wsd ON wesp.equipment_detail_id = wsd.id LEFT JOIN wl_equipment_detail wsd ON wesp.equipment_detail_id = wsd.id
LEFT JOIN wl_equipment we ON wsd.equipment_id = we.id LEFT JOIN wl_equipment we ON wsd.equipment_id = we.id
LEFT JOIN wl_unit u on u.id = we.unit_id
<where> <where>
we.id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND wesp.biz_org_code = concat(#{bizOrgCode},'%') AND wesp.biz_org_code like concat(#{bizOrgCode},'%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -2898,6 +2901,26 @@ ...@@ -2898,6 +2901,26 @@
</if> </if>
</select> </select>
<select id="selectEquipmentCountBySystemId" resultType="int">
SELECT
es.id,
es.name,
es.biz_org_name bizOrgName,
es.code,
es.position,
ed.standard,
DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AS dayNum
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND e.expiry_date IS NOT NULL
<if test="bussIds != null and bussIds != ''">
And find_in_set(es.id, #{bussIds}) > 0
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<result property="equipmentName" column="equipment_name"></result> <result property="equipmentName" column="equipment_name"></result>
<result property="equipmentNum" column="num"></result> <result property="equipmentNum" column="num"></result>
<result property="unitName" column="unit_name"></result> <result property="unitName" column="unit_name"></result>
<result property="img" column="img"></result>
</resultMap> </resultMap>
<resultMap id="CategoryAmountList" type="com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO"> <resultMap id="CategoryAmountList" type="com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO">
<result column="id" property="id"></result> <result column="id" property="id"></result>
...@@ -98,6 +99,25 @@ ...@@ -98,6 +99,25 @@
det.NAME equipment_name, det.NAME equipment_name,
count(spe.id) num, count(spe.id) num,
unit.name unit_name, unit.name unit_name,
wle.img,
cate.NAME AS equipmentCateGoryName
FROM
wl_equipment_specific AS spe
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_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
where
find_in_set(#{systemId},spe.system_id) and spe.single = true
group by wle.id
</select>
<select id="getEquipCountPageBySystemId" resultMap="EquipCountBySystemId">
SELECT
wle.id equipment_id,
det.NAME equipment_name,
count(spe.id) num,
unit.name unit_name,
wle.img,
cate.NAME AS equipmentCateGoryName cate.NAME AS equipmentCateGoryName
FROM FROM
wl_equipment_specific AS spe wl_equipment_specific AS spe
...@@ -719,7 +739,17 @@ ...@@ -719,7 +739,17 @@
f_fire_fighting_system fffs f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit) a where a.id=#{id} order by sort left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
UNION ALL
SELECT
fffs.id,
'保护区域' AS `key`,
pro_object AS value,
false as isHref,
9 as sort
FROM
f_fire_fighting_system fffs
) a where a.id=#{id} order by sort
</select> </select>
<select id="getEquipmentAlarmBySystemIdOrSourceIdVO" <select id="getEquipmentAlarmBySystemIdOrSourceIdVO"
resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO"> resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO">
......
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