|
|
@@ -225,5 +225,29 @@ public class BasicEnumServiceImpl implements BasicEnumService {
|
|
225
|
225
|
return msg;
|
|
226
|
226
|
}
|
|
227
|
227
|
|
|
|
228
|
+ @Override
|
|
|
229
|
+ public Map<String, Object> getIdByNameAndParentId(Integer parentId, String enumName) throws Exception {
|
|
|
230
|
+ Map<String, Object> modelMap = new HashMap<>();
|
|
|
231
|
+
|
|
|
232
|
+ Integer enumId = 0;
|
|
|
233
|
+ BasicEnumExample enumExample = new BasicEnumExample();
|
|
|
234
|
+ Criteria Criteria = enumExample.createCriteria();
|
|
|
235
|
+ // 拼接查询条件
|
|
|
236
|
+ if (null != enumName && !"".equals(enumName)) {
|
|
|
237
|
+ Criteria.andEnumnameLike("%"+enumName+"%");
|
|
|
238
|
+ }
|
|
|
239
|
+ Criteria.andDelflagEqualTo(1); //查询正常数据
|
|
|
240
|
+ if (null != parentId) {
|
|
|
241
|
+ Criteria.andParentidEqualTo(parentId); //只查询顶级菜单
|
|
|
242
|
+ }
|
|
|
243
|
+
|
|
|
244
|
+ List<BasicEnum> list = enumMapper.selectByExample(enumExample);
|
|
|
245
|
+ if(list.size()>0){
|
|
|
246
|
+ enumId = list.get(0).getEnumid();
|
|
|
247
|
+ }
|
|
|
248
|
+ modelMap.put("enumId", enumId);
|
|
|
249
|
+ return modelMap;
|
|
|
250
|
+ }
|
|
|
251
|
+
|
|
228
|
252
|
|
|
229
|
253
|
}
|