| | |
| | | package com.jilongda.manage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.mapper.TOrderMapper; |
| | | import com.jilongda.manage.model.TAppUser; |
| | | import com.jilongda.manage.mapper.TAppUserMapper; |
| | | import com.jilongda.manage.model.TOrder; |
| | | import com.jilongda.manage.query.TAppUserQuery; |
| | | import com.jilongda.manage.service.TAppUserService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.manage.vo.TAppUserVO; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TAppUserServiceImpl extends ServiceImpl<TAppUserMapper, TAppUser> implements TAppUserService { |
| | | |
| | | @Autowired |
| | | private TOrderMapper orderMapper; |
| | | @Override |
| | | public PageInfo<TAppUserVO> pageList(TAppUserQuery query) { |
| | | PageInfo<TAppUserVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TAppUserVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (TAppUserVO tAppUserVO : list) { |
| | | Long l = orderMapper.selectCount(new LambdaQueryWrapper<TOrder>() |
| | | .eq(TOrder::getUserId, tAppUserVO.getId())); |
| | | tAppUserVO.setSalesCount(l.intValue()); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |