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() .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); } }