package com.palmnest.dao.washcar.impl;

import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.dao.washcar.ProjectSetDao;
import com.palmnest.model.washcar.ProjectSet;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 项目设置dao实现类
 *
 * @author longmeizhen
 */
@Slf4j
@Repository("projectSetDao")
public class ProjectSetDaoImpl extends GenericDaoHibernate<ProjectSet, Long> implements ProjectSetDao {


	public ProjectSetDaoImpl() {
		super(ProjectSet.class);
	}

	@Override
	public ProjectSet fingByProjectId(String projectId) throws Exception {

		String sql = "from ProjectSet where projectId=? ";

		List<ProjectSet> custList = getSession().createQuery(sql).setString(0, projectId).list();

		if (custList != null && custList.size() > 0) {
			return custList.get(0);
		}
		return null;
	}


}
