| | |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleLightemitEntity; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.PoleLightemitEntityMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @param isOnLine |
| | | * @return |
| | | */ |
| | | public List<PoleLightemitEntity> listLed(String keyword, boolean isOnLine) { |
| | | public List<PoleLightemitEntity> listLed(String keyword,Integer order,Integer seq, boolean isOnLine) { |
| | | List<PoleLightemitEntity> poleLightemitEntityList; |
| | | //排序字段 |
| | | String orderByResult = "id"; |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.LED_S_CODE.getCode(); |
| | | break; |
| | | case 2: |
| | | orderByResult = OrderByEnums.LED_S_NAME.getCode(); |
| | | break; |
| | | case 3: |
| | | orderByResult = OrderByEnums.LED_S_POLE_NAME.getCode(); |
| | | break; |
| | | case 4: |
| | | orderByResult = OrderByEnums.LED_S_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; |
| | | |
| | | //超管 |
| | | if (SecurityUtils.getClientId() == null) { |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, null); |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, null,orderBy); |
| | | } else { |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, SecurityUtils.getUserId()); |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, SecurityUtils.getUserId(),orderBy); |
| | | } |
| | | |
| | | List<PoleLightemitEntity> temp = new ArrayList<>(); |