package com.sifang.modules.supply.order.dao;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.supply.order.entity.CrmSupplyMaterialUsedOrderDetail;
import com.sifang.modules.sys.common.persistence.BaseDao;
import com.sifang.modules.sys.common.persistence.Parameter;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class MaterialOutStockOrderDetailDao extends BaseDao<CrmSupplyMaterialUsedOrderDetail> {

    public List<CrmSupplyMaterialUsedOrderDetail> listDetails(String mainId) {
        return find(" from CrmSupplyMaterialUsedOrderDetail where mainId=:p1 and status='0' order by sort asc", new Parameter(mainId));
    }

    public List<Record> listDetailByMainId(String id) {
        return Db.find("select * from crm_supply_material_used_order_detail where main_id = ? and status = '0'", id);
    }
}
