对比新文件 |
| | |
| | | package com.gk.firework.Service.ServiceImpl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gk.firework.Domain.Utils.PageInfo; |
| | | import com.gk.firework.Domain.Utils.StringUtils; |
| | | import com.gk.firework.Domain.WarningInfo; |
| | | import com.gk.firework.Mapper.WarningInfoMapper; |
| | | import com.gk.firework.Service.WarningService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("WarningService") |
| | | public class WarningServiceImpl extends ServiceImpl<WarningInfoMapper, WarningInfo> implements WarningService { |
| | | @Autowired |
| | | WarningInfoMapper warningInfoMapper; |
| | | |
| | | |
| | | @Override |
| | | public void selectDataGrid(PageInfo pageInfo) { |
| | | Page<WarningInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); |
| | | List<OrderItem> orderItems = new ArrayList<>(); |
| | | OrderItem orderItem = new OrderItem(); |
| | | if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { |
| | | orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); |
| | | orderItem.setColumn(pageInfo.getSort()); |
| | | }else { |
| | | orderItem.setAsc(true); |
| | | orderItem.setColumn("id"); |
| | | } |
| | | orderItems.add(orderItem); |
| | | page.setOrders(orderItems); |
| | | List<WarningInfo> list = warningInfoMapper.selectDataGrid(page,pageInfo.getCondition()); |
| | | pageInfo.setResult(list); |
| | | pageInfo.setTotalCount(page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | | public List<WarningInfo> selectByType(String warntype) { |
| | | return warningInfoMapper.selectByType(warntype); |
| | | } |
| | | } |