新增地区查询接口
This commit is contained in:
parent
3da1d02e1e
commit
8fab7a8981
@ -64,6 +64,14 @@ public interface IAreaService {
|
||||
*/
|
||||
AreaDTO get(String areaId);
|
||||
|
||||
/**
|
||||
* 通过编码获取地区字典详情
|
||||
*
|
||||
* @param areaCode
|
||||
* @return
|
||||
*/
|
||||
AreaDTO getByCode(String areaCode);
|
||||
|
||||
/**
|
||||
* 通过上级ID获取地区字典列表
|
||||
*
|
||||
@ -99,8 +107,16 @@ public interface IAreaService {
|
||||
/**
|
||||
* 地区字典列表(通过地区字典编码)
|
||||
*
|
||||
* @param areaCode
|
||||
* @param areaCode 地区编码
|
||||
* @return
|
||||
*/
|
||||
List<AreaDTO> listByCode(String areaCode);
|
||||
|
||||
/**
|
||||
* 地区字典子列表(不包含本级)
|
||||
*
|
||||
* @param areaCode 地区编码
|
||||
* @return
|
||||
*/
|
||||
List<AreaDTO> listSubByCode(String areaCode);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.ZTreeDTO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import ink.wgink.util.string.WStringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -69,6 +70,13 @@ public class AreaServiceImpl extends DefaultBaseService implements IAreaService
|
||||
return areaDao.get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDTO getByCode(String areaCode) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("areaCode", areaCode);
|
||||
return areaDao.get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaDTO> listByParentId(String areaParentId) {
|
||||
Map<String, Object> params = getHashMap(1);
|
||||
@ -106,7 +114,15 @@ public class AreaServiceImpl extends DefaultBaseService implements IAreaService
|
||||
@Override
|
||||
public List<AreaDTO> listByCode(String areaCode) {
|
||||
Map<String, Object> params = getHashMap(1);
|
||||
params.put("areaCode", areaCode);
|
||||
params.put("areaCode", WStringUtil.cutContinuityRepeatCharDesc(areaCode, '0'));
|
||||
return areaDao.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaDTO> listSubByCode(String areaCode) {
|
||||
Map<String, Object> params = getHashMap(4);
|
||||
params.put("areaCode", WStringUtil.cutContinuityRepeatCharDesc(areaCode, '0'));
|
||||
params.put("excludeAreaCode", areaCode);
|
||||
return areaDao.list(params);
|
||||
}
|
||||
|
||||
|
@ -208,6 +208,10 @@
|
||||
AND
|
||||
area_code LIKE CONCAT(#{areaCode}, '%')
|
||||
</if>
|
||||
<if test="excludeAreaCode != null and excludeAreaCode != ''">
|
||||
AND
|
||||
area_code != #{excludeAreaCode}
|
||||
</if>
|
||||
<if test="areaIds != null and areaIds.size > 0">
|
||||
AND
|
||||
area_id IN
|
||||
@ -248,6 +252,10 @@
|
||||
AND
|
||||
t1.area_id = #{areaId}
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
AND
|
||||
t1.area_code = #{areaCode}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 子节点数量 -->
|
||||
|
Loading…
Reference in New Issue
Block a user