| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.BaseParamMapper; |
| | | import com.ruoyi.basic.pojo.BaseParam; |
| | |
| | | public class BaseParamServiceImpl extends ServiceImpl<BaseParamMapper, BaseParam> implements BaseParamService { |
| | | |
| | | @Override |
| | | public List<BaseParam> baseParamList(BaseParam baseParam) { |
| | | public IPage<BaseParam> baseParamList(Page<BaseParam> page, BaseParam baseParam) { |
| | | LambdaQueryWrapper<BaseParam> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (StringUtils.isNotEmpty(baseParam.getParamName())) { |
| | | queryWrapper.like(BaseParam::getParamName, baseParam.getParamName()); |
| | | } |
| | | List<BaseParam> list = list(queryWrapper); |
| | | if (list == null || list.isEmpty()) { |
| | | return new ArrayList<>(0); |
| | | Page<BaseParam> paramPage = page(page, queryWrapper); |
| | | if (paramPage == null || paramPage.getRecords().isEmpty()) { |
| | | return new Page<>(); |
| | | } |
| | | |
| | | // 处理日期格式展示 |
| | | list.forEach(item -> { |
| | | paramPage.getRecords().forEach(item -> { |
| | | if (Integer.valueOf(4).equals(item.getParamType()) && StringUtils.isNotEmpty(item.getParamFormat())) { |
| | | item.setParamFormat(toUpperCasePattern(item.getParamFormat())); |
| | | } |
| | | }); |
| | | |
| | | return list; |
| | | return paramPage; |
| | | } |
| | | |
| | | @Override |