package com.palmnest.dao.release.impl;

import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.dao.release.GoodsDetailDao;
import com.palmnest.model.release.GoodsDetail;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author HIAPAD
 * @Description TODO
 * @Date 2018/9/14 14:13
 **/
@Repository("goodsDetailDao")
public class GoodsDetailDaoImpl extends GenericDaoHibernate<GoodsDetail, Long> implements GoodsDetailDao {

	public GoodsDetailDaoImpl() {
		super(GoodsDetail.class);
	}

	@Override
	public List<GoodsDetail> getGoodsDetailByBillId(Long billId) {
		String sql = "from GoodsDetail where releaseId=?";
		return getSession().createQuery(sql).setLong(0, billId).list();
	}
}
