| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.dao.enums; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/5/27 14:22 |
| | | */ |
| | | public enum OrderByEnums { |
| | | /** |
| | | * 管çåå表 |
| | | */ |
| | | //ID |
| | | ADMIN_ID("id"), |
| | | //å建æ¶é´ |
| | | ADMIN_CREATE_TIME("create_time"), |
| | | //ç»å½æ¶é´ |
| | | ADMIN_LOGIN_TIME("login_time"), |
| | | |
| | | /** |
| | | * 鳿±ç´ æå表 |
| | | */ |
| | | //å建æ¶é´ |
| | | IP_VOLUME_FILE_CREATE_TIME("create_time"), |
| | | |
| | | |
| | | /** |
| | | * æåºæ¹å¼ |
| | | */ |
| | | //æ£åº |
| | | ASC("ASC"), |
| | | //ååº |
| | | DESC("DESC"), |
| | | ; |
| | | |
| | | private final String code; |
| | | |
| | | OrderByEnums(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | } |
| | |
| | | |
| | | @Log("åå°ç¨æ·å表") |
| | | @GetMapping(value = "/list") |
| | | public ResponseVO<Object> listAdmin(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | public ResponseVO<Object> listAdmin(BaseConditionVO baseConditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.ADMIN_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺å°å¯¹åºç¨æ·æé"); |
| | | } |
| | | return ResponseUtil.successPage(adminService.listAdmin(baseConditionVO, keyword)); |
| | | return ResponseUtil.successPage(adminService.listAdmin(baseConditionVO, keyword, order, seq)); |
| | | } |
| | | |
| | | @Log("åå°ç¨æ·æ³¨å") |
| | |
| | | import com.sandu.ximon.dao.domain.Role; |
| | | import com.sandu.ximon.dao.domain.RoleMenuRelation; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.AdminMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | |
| | | return updateById(one); |
| | | } |
| | | |
| | | public List<AdminBo> listAdmin(BaseConditionVO baseConditionVO, String keyword) { |
| | | if (baseConditionVO != null) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | public List<AdminBo> listAdmin(BaseConditionVO baseConditionVO, String keyword, Integer order, Integer seq) { |
| | | //æåºå段 |
| | | String orderByResult = OrderByEnums.ADMIN_ID.getCode(); |
| | | //æ£åºãåå |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.ADMIN_ID.getCode(); |
| | | break; |
| | | case 2: |
| | | orderByResult = OrderByEnums.ADMIN_CREATE_TIME.getCode(); |
| | | break; |
| | | case 3: |
| | | orderByResult = OrderByEnums.ADMIN_LOGIN_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //æåºæ¹å¼ |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy); |
| | | |
| | | return adminMapper.listAdmin(keyword); |
| | | } |
| | |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.dao.domain.IpVolumeFile; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.IpVolumeFileMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | |
| | | //æåºå段 |
| | | String orderByResult = "create_time"; |
| | | String orderByResult = OrderByEnums.IP_VOLUME_FILE_CREATE_TIME.getCode(); |
| | | //æ£åºãåå |
| | | String orderBySeq = "ASC"; |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = "create_time"; |
| | | orderByResult = OrderByEnums.IP_VOLUME_FILE_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = " ASC"; |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = " DESC"; |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |