| | |
| | | @ApiOperation(value = "列表", notes = "传入isAreaSelect、areaId、status") |
| | | public R<List<FwDeviceVO>> list(@RequestParam(value = "isAreaSelect", required = false) Integer isAreaSelect, |
| | | @RequestParam(value = "areaId", required = false) Long areaId, |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | List<FwDeviceEntity> list = fwDeviceService.selectFwDeviceList(isAreaSelect, areaId, status); |
| | | @RequestParam(value = "status", required = false) Integer status, |
| | | @RequestParam(value = "isTrack", required = false) Integer isTrack) { |
| | | List<FwDeviceEntity> list = fwDeviceService.selectFwDeviceList(isAreaSelect, areaId, status, isTrack); |
| | | FwDeviceWrapper wrapper = FwDeviceWrapper.build(); |
| | | return R.data(list.stream().map(wrapper::entityVO).collect(Collectors.toList())); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<FwDeviceEntity> selectFwDeviceList(@Param("isAreaSelect") Integer isAreaSelect, @Param("areaId") Long areaId, |
| | | @Param("status") Integer status); |
| | | @Param("status") Integer status, @Param("isTrack") Integer isTrack); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | <select id="selectFwDevicePage" resultMap="fwDeviceResultMap"> |
| | | select |
| | | *, |
| | | ( |
| | | select |
| | | count(*) |
| | | from |
| | | ja_fw_device_track tmp |
| | | where |
| | | ja_fw_device.id = tmp.device_id |
| | | ) out_count |
| | | from |
| | | ja_fw_device |
| | | select * from ja_fw_device |
| | | <where> |
| | | is_deleted = 0 |
| | | <if test="param2.id != null and param2.id != ''"> |
| | |
| | | <if test="status != null"> |
| | | and status = #{status} |
| | | </if> |
| | | <if test="isTrack != null and isTrack == 1"> |
| | | and (SELECT COUNT(*) FROM ja_fw_device_track tmp WHERE ja_fw_device.id = tmp.device_id) > 0 |
| | | </if> |
| | | <if test="isTrack != null and isTrack == 2"> |
| | | and (SELECT COUNT(*) FROM ja_fw_device_track tmp WHERE ja_fw_device.id = tmp.device_id) = 0 |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | * @param status 设备状态 |
| | | * @return |
| | | */ |
| | | List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status); |
| | | List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack); |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status) { |
| | | return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status); |
| | | public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack) { |
| | | return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status, isTrack); |
| | | } |
| | | |
| | | |