| | |
| | | import com.sandu.ximon.dao.bo.MonitorBo; |
| | | import com.sandu.ximon.dao.domain.Monitor; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.MonitorMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | /** |
| | | * 模糊查询 |
| | | */ |
| | | public CommonPage listMonitorByKeyword(BaseConditionVO baseConditionVO, MonitorParam monitorParam) { |
| | | public CommonPage listMonitorByKeyword(BaseConditionVO baseConditionVO,Integer order,Integer seq, MonitorParam monitorParam) { |
| | | //绑定状态:已绑定/未绑定/全部 |
| | | if (monitorParam.getBindingState() == null) { |
| | | //全部 |
| | | monitorParam.setBindingState(2); |
| | | } |
| | | //排序字段 |
| | | String orderByResult = "id"; |
| | | //正序、倒叙 |
| | | String orderBySeq =OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.MONITOR_POLE_NAME.getCode(); |
| | | break; |
| | | case 2: |
| | | orderByResult = OrderByEnums.MONITOR_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = " ASC"; |
| | | break; |
| | | case 2: |
| | | orderBySeq = " DESC"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | List<MonitorBo> list; |
| | | if (SecurityUtils.getClientId() == null) { |
| | | list = monitorMapper.listMonitorDeviceSerial1(null, monitorParam.getKeyword(), monitorParam.getBindingState()); |
| | | list = monitorMapper.listMonitorDeviceSerial1(null, monitorParam.getKeyword(), monitorParam.getBindingState(),orderBy); |
| | | } else { |
| | | list = monitorMapper.listMonitorDeviceSerial1(SecurityUtils.getUserId(), monitorParam.getKeyword(), monitorParam.getBindingState()); |
| | | list = monitorMapper.listMonitorDeviceSerial1(SecurityUtils.getUserId(), monitorParam.getKeyword(), monitorParam.getBindingState(),orderBy); |
| | | } |
| | | |
| | | //没有数据时候直接返回空数组 |