package com.palmnest.dao.repair.impl;

import com.palmnest.dao.hibernate.GenericDaoHibernate;
import com.palmnest.dao.repair.RepairAddressDao;
import com.palmnest.model.repair.RepairAddress;
import com.palmnest.model.repair.RepairMaterial;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 服务之窗1L- ReapirAddressDaoImpl
 *
 * @Description TODO
 * @author: jiangyong
 * @since: 2020/8/13 16:21
 */
@Repository("repairAddressDao")
public class ReapirAddressDaoImpl extends GenericDaoHibernate<RepairAddress, Long> implements RepairAddressDao {

    public ReapirAddressDaoImpl() {
        super(RepairAddress.class);
    }


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