| | |
| | | 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); |
| | | } |