| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Assert; |
| | | import com.baomidou.mybatisplus.core.toolkit.ReflectionKit; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.utils.BeanCopyUtils; |
| | | import com.ruoyi.common.utils.reflect.ReflectUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return getBaseMapper().selectVoList(queryWrapper, voClass); |
| | | } |
| | | |
| | | /** |
| | | * 翻页查询 |
| | | */ |
| | | @Override |
| | | public PagePlus<T, V> pageVo(PagePlus<T, V> page, Wrapper<T> queryWrapper) { |
| | | PagePlus<T, V> result = getBaseMapper().selectPage(page, queryWrapper); |
| | | List<V> volist = BeanCopyUtils.copyList(result.getRecords(), voClass); |
| | | result.setRecordsVo(volist); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 翻页查询 |
| | | * |
| | | * @param page 翻页对象 |
| | | * @param queryWrapper 实体对象封装操作类 |
| | | */ |
| | | public IPage<V> pageVo(IPage<T> page, Wrapper<T> queryWrapper) { |
| | | public <P extends IPage<V>> P pageVo(IPage<T> page, Wrapper<T> queryWrapper) { |
| | | return getBaseMapper().selectVoPage(page, queryWrapper, voClass); |
| | | } |
| | | |