/****************************************************************************** O * Copyright (C) 2014 Shenzhen Penguin Network Technology Co., Ltd * All Rights Reserved. * ±¾Èí¼þΪÉîÛÚÆó¶ìÍøÂç¿Æ¼¼ÓÐÏÞ¹«Ë¾¿ª·¢ÑÐÖÆ¡£Î´¾­±¾¹«Ë¾ÕýʽÊéÃæÍ¬Ò⣬ÆäËûÈκθöÈË¡¢ÍÅÌå * ²»µÃʹÓᢸ´ÖÆ¡¢Ð޸Ļò·¢²¼±¾Èí¼þ. *****************************************************************************/ package com.qxueyou.scc.base.dao; import java.util.List; import org.springframework.stereotype.Repository; import com.qxueyou.scc.base.util.CollectionUtils; import com.qxueyou.scc.sys.model.SysConfig; import com.qxueyou.scc.sys.model.SysDictionary; @Repository(value="commonDao") /** * ͨÓÃDAOÀà * * @author Ïĵ»¢ * @since JDK1.7 * @history 2014-11-18 Ïĵ»¢ н¨ */ public class CommonDAO extends BaseDAO{ /** * ¸ù¾ÝÅäÖÃkey²éѯvalueÖµ * @param key * @return */ public String queryConfigValue(String key){ String hql = "from SysConfig where configKey=?"; List lstConfig = this.find(hql, CollectionUtils.newList(key), SysConfig.class); if(lstConfig.isEmpty()){ return null; } return lstConfig.get(0).getValue(); } /** * ¸ù¾Ý×ÖµäÀàÐͲéѯ×ÖµäÄÚÈݵÄlist * @param dicType * @return */ public List queryDictConfigMap(String dicType){ String hql = "from SysDictionary where typeId = (select dictionaryTypeId from SysDictionaryType where type = ? ) and status=1"; return this.find(hql, CollectionUtils.newList(dicType), SysDictionary.class); } }