rk
15 小时以前 ab9cd2c82bd64de8e33510db1d1e78a5b3b4de70
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
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.doumee.biz.system.impl;
 
import com.doumee.biz.system.AreasBiz;
import com.doumee.dao.business.AreasMapper;
import com.doumee.dao.business.model.Areas;
import com.doumee.service.business.AreasService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
/**
 * 区划信息业务封装实现
 *
 * @author rk
 * @date 2026/04/10
 */
@Service
public class AreasBizImpl implements AreasBiz {
 
    @Autowired
    private AreasMapper areasMapper;
 
    @Override
    public Areas resolveArea(Integer areaId) {
 
        return areasMapper.selectJoinOne(Areas.class,new MPJLambdaWrapper<Areas>()
                .selectAll(Areas.class)
                .select(" a1.id ",Areas::getCityId)
                .select(" a1.name ",Areas::getCityName)
                .select(" a2.id ",Areas::getProvinceId)
                .select(" a2.name ",Areas::getProvinceName)
                .leftJoin("areas a1 on a1.id = t.PARENT_ID")
                .leftJoin("areas a2 on a2.id = a1.PARENT_ID")
                .eq(Areas::getId, areaId)
        );
 
//        if (areaId == null) {
//            return null;
//        }
//        // cacheData 中已为每条区县记录填充了 provinceId/provinceName/cityId/cityName
//        return areasMapper.selectById(areaId);
    }
 
}