feat(cockpit): 添加设备启用状态过滤功能
- 在 FwDeviceDTO 中新增 isEnabled 字段用于标识设备启用状态
- 在 CockpitServiceImpl 中设置设备启用状态默认值为 1
- 修改 FwDeviceMapper.xml 查询条件,将原有的 is_enabled = 1
条件改为动态条件并增加 track_status 状态检查
- 实现设备统计数据查询时支持启用状态的动态过滤
| | |
| | | fwDeviceDTO.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | fwDeviceDTO.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode())); |
| | | fwDeviceDTO.setFlyTime(new Date()); |
| | | fwDeviceDTO.setIsEnabled(1); |
| | | return fwDeviceService.getDeviceStatistics(fwDeviceDTO); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty(value = "使用年限(单位:年)") |
| | | private Integer serviceLife; |
| | | // isEnabled |
| | | @ApiModelProperty(value = "是否启用") |
| | | private Integer isEnabled; |
| | | |
| | | } |
| | |
| | | AND ad.is_deleted = 0 |
| | | WHERE |
| | | d.is_deleted = 0 |
| | | AND d.is_enabled = 1 |
| | | AND d.track_status = 1 |
| | | <if test="isEnabled != null"> |
| | | AND d.is_enabled = #{isEnabled} |
| | | </if> |
| | | AND d.track_status = 1 |
| | | AND d.final_outbound_area IS NOT NULL |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and ( d.final_outbound_area_code::text LIKE concat(#{regionCode}, '%') |