package com.palmnest.dao.repair.impl;

import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.dao.repair.RepairBillMaterialDao;
import com.palmnest.dao.repair.RepairMaterialDao;
import com.palmnest.model.repair.RepairBillMaterial;
import com.palmnest.model.repair.RepairMaterial;
import com.palmnest.model.repair.RepairOperateRecord;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 服务之窗1L- RepairMaterialDaoImpl
 *
 * @Description TODO
 * @author: jiangyong
 * @since: 2020/8/13 11:20
 */
@Repository("repairMaterialDao")
public class RepairMaterialDaoImpl extends GenericDaoHibernate<RepairMaterial, Long> implements RepairMaterialDao {

    public RepairMaterialDaoImpl() {
        super(RepairMaterial.class);
    }


    @Override
    public List<RepairMaterial> findByOrgId(Integer orgId) {
        String strHql = "from RepairMaterial where enabled = 1 and orgId = ?  order by createTime desc ";
        List<RepairMaterial> list = getSession().createQuery(strHql).setLong(0, orgId).list();
        return list;
    }


}
