add
yj
2024-12-05 b9900893177c78fc559223521fe839aa21000017
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.iotechn.unimall.admin.api.address;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.AddressDO;
import com.iotechn.unimall.data.mapper.AddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
/**
 * Description:
 * User: rize
 * Date: 2020/8/13
 * Time: 10:01
 */
@Service("adminAddressService")
public class AdminAddressServiceImpl implements AdminAddressService {
 
    @Autowired
    private AddressMapper addressMapper;
 
    @Override
    public Page<AddressDO> list(Long userId, Integer page, Integer limit, Long adminId) throws ServiceException {
        QueryWrapper<AddressDO> wrapper = new QueryWrapper<>();
        if (userId != null) {
            wrapper.eq("user_id", userId);
        }
        return addressMapper.selectPage(Page.div(page, limit, AddressDO.class), wrapper);
    }
}