package org.cs.mgr.sys.service.impl;

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

import org.cs.core.model.Dic;
import org.cs.core.service.impl.BaseService;
import org.cs.mgr.sys.service.IDicMgrService;
import org.cs.util.Pager;
import org.springframework.stereotype.Service;

@Service("dicMgrService")
public class DicMgrService extends BaseService<Dic> implements IDicMgrService{

	@Override
	public Pager getDicList(Pager page) {
		// TODO Auto-generated method stub
		return this.findPageByHql("from Dic", page, null);
	}
	
	@Override
	public Pager getDicList(Pager page, Map<String, Object> params) {
		String hql="from Dic where type=:type";
		if(params.get("name")!=null){
			hql+=" and name like '%"+params.get("name").toString()+"%'";
		}
		Map<String, Object> para=new HashMap<String, Object>();
		para.put("type", params.get("type"));
		return this.findPageByHql(hql, page, para);
	}
}
