فهرست منبع

[task-843]修改根据父节点id获取到该节点下的子节点信息,现需要添加地点进行数据过滤

szjbdgzl 2 سال پیش
والد
کامیت
054046f794

+ 1 - 1
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/common/cat/repository/TypeRepository.java

@@ -60,7 +60,7 @@ public interface TypeRepository extends IRepository<String, TypePo,Type>{
 	 * @param id 父节点id
 	 * @return
 	 */
-	List<TypePo> getOwnerByParentId(String id);
+	List<TypePo> getOwnerByParentId(String id,String diDian);
 
 
 	/**

+ 2 - 2
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/common/cat/repository/impl/TypeRepositoryImpl.java

@@ -102,10 +102,10 @@ public class TypeRepositoryImpl extends AbstractRepository<String, TypePo, Type>
 	}
 
 	@Override
-	public List<TypePo> getOwnerByParentId(String id) {
+	public List<TypePo> getOwnerByParentId(String id,String diDian) {
 		String currentUserId = currentContext.getCurrentUserId();
 		List<TypePo> typeList = findByKey("getOwnerByParentIdAndUserId", "getIdsOwnerByParentIdAndUserId",
-				b().a("parentId", id).a("userId", currentUserId).p());
+				b().a("parentId", id).a("userId", currentUserId).a("diDian", "%" + diDian + "%").p());
 		return typeList;
 	}
 

+ 6 - 0
ibps-model-root/modules/org-model/src/main/resources/com/lc/ibps/cat/persistence/mapping/Type.map.xml

@@ -112,6 +112,9 @@
 		select t.* 
 		from IBPS_CAT_TYPE t  
 		where t.PARENT_ID_= #{parentId} and (t.OWNER_ID_= '0' or t.OWNER_ID_ = #{userId})
+		<if test="diDian!=null">
+			AND t.AUTHORITY_NAME like #{diDian}
+		</if>
 		order by t.SN_,t.ID_
 	</select>
 	
@@ -119,6 +122,9 @@
 		select t.ID_,t.SN_ 
 		from IBPS_CAT_TYPE t  
 		where t.PARENT_ID_= #{parentId} and (t.OWNER_ID_= '0' or t.OWNER_ID_ = #{userId})
+		<if test="diDian!=null">
+			AND t.AUTHORITY_NAME like #{diDian}
+		</if>
 		order by t.SN_,t.ID_
 	</select>
 	

+ 2 - 1
ibps-provider-base-root/modules/provider-platform-api/src/main/java/com/lc/ibps/common/api/ITypeService.java

@@ -160,7 +160,8 @@ public interface ITypeService {
 	@RequestMapping(value = "/findByParentId", method = { RequestMethod.GET})
 	public APIResult<List<TypePo>> findByParentId(
 			@NotBlank(message = "{com.lc.ibps.common.typeId}") 
-			@RequestParam(name = "typeId", required = true) String typeId);
+			@RequestParam(name = "typeId", required = true) String typeId,
+			@RequestParam(name = "diDian", required = false) String diDian);
 	
 	/**
 	 * 

+ 4 - 2
ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/common/provider/TypeProvider.java

@@ -261,10 +261,12 @@ public class TypeProvider extends GenericProvider implements ITypeService, IType
 	@Override
 	public APIResult<List<TypePo>> findByParentId(
 			@ApiParam(name = "typeId", value = "父分类id", required = true) 
-			@RequestParam(name = "typeId", required = true) String typeId) {
+			@RequestParam(name = "typeId", required = true) String typeId,
+			@ApiParam(name = "diDian", value = "地点", required = false)
+			@RequestParam(name = "diDian", required = false) String diDian) {
 		APIResult<List<TypePo>> result = new APIResult<>();
 		try {
-			List<TypePo> typeList = typeRepository.getOwnerByParentId(typeId);
+			List<TypePo> typeList = typeRepository.getOwnerByParentId(typeId,diDian);
 			result.setData(typeList);
 		} catch (Exception e) {
 			setExceptionResult(result, StateEnum.ERROR_CAT_TYPE.getCode(), I18nUtil.getMessage(StateEnum.ERROR_CAT_TYPE.getCode()+""), e);