package com.service;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.ehcache.CacheName;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DictExtService {

    public static final DictExtService me = new DictExtService();


    @CacheName("dictExtMap")
    public Map<String,String> dictExtMap(){
        Map<String,String> reMap = new HashMap();
        List<Record> dicExtList = Db.find("select * from t_dict_ext");
        for(Record record : dicExtList) {
            String key = record.getStr("name") + record.get("type");
            reMap.put(key,record.get("parentdicid"));
        }
        return reMap;
    }

}
