rk
6 天以前 2acc40db4dd14c3d27ea1645f2b5833969e5c1cb
server/services/src/main/java/com/doumee/biz/system/impl/AreasBizImpl.java
@@ -1,8 +1,10 @@
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;
@@ -16,15 +18,27 @@
public class AreasBizImpl implements AreasBiz {
    @Autowired
    private AreasService areasService;
    private AreasMapper areasMapper;
    @Override
    public Areas resolveArea(Integer areaId) {
        if (areaId == null) {
            return null;
        }
        // cacheData 中已为每条区县记录填充了 provinceId/provinceName/cityId/cityName
        return areasService.findById(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);
    }
}