Exemplo n.º 1
0
 public Page<SysDicIndex> queryDicIndex(Map<String, Object> params) {
   Page<String> idPage = this.getPage(params);
   List<String> ids = dicIndexMapper.selectIdByMap(idPage, params);
   Page<SysDicIndex> page = new Page<SysDicIndex>(idPage.getCurrent(), idPage.getSize());
   page.setTotal(idPage.getTotal());
   if (ids != null) {
     ISysDicProvider provider = InstanceUtil.getBean(getClass());
     List<SysDicIndex> records = InstanceUtil.newArrayList();
     for (String id : ids) {
       records.add(provider.queryDicIndexById(id));
     }
     page.setRecords(records);
   }
   return page;
 }
Exemplo n.º 2
0
  @Cacheable(value = "sysDics")
  public Map<String, Map<String, String>> getAllDic() {
    List<String> records = dicIndexMapper.selectIdByMap(Collections.<String, Object>emptyMap());

    Map<String, String> dicIndexMap = InstanceUtil.newHashMap();
    for (String id : records) {
      dicIndexMap.put(id, dicIndexMapper.selectById(id).getKeyValue());
    }
    records = dicMapper.selectIdByMap(Collections.<String, Object>emptyMap());
    Page<String> idPage = new Page<String>(1, records.size());
    idPage.setRecords(records);
    Page<SysDic> sysDics = getPage(idPage, SysDic.class);
    Map<String, Map<String, String>> resultMap = InstanceUtil.newHashMap();
    for (SysDic sysDic : sysDics.getRecords()) {
      String key = dicIndexMap.get(sysDic.getIndexId());
      if (resultMap.get(key) == null) {
        Map<String, String> dicMap = InstanceUtil.newHashMap();
        resultMap.put(key, dicMap);
      }
      resultMap.get(key).put(sysDic.getCode(), sysDic.getCodeText());
    }
    return resultMap;
  }
Exemplo n.º 3
0
 public Page<SysDic> queryDic(Map<String, Object> params) {
   Page<String> page = this.getPage(params);
   page.setRecords(mapper.selectIdByMap(page, params));
   return getPage(page);
 }