package market.Cm.mapper;
import java.util.List;

import market.Cm.vo.BaseDstItem;
import market.Cm.vo.BaseOracleTableInfo;
import market.Cm.vo.CostAcmProd;
import market.Lms.Warehouse.vo.YdmProductDetail;
import market.Lms.Warehouse.vo.YdmProductOutlist;
import market.Mes.Pickle.Performance.vo.MesPlmM;
import market.Mes.Rolling.Performance.vo.MesRcmM;
import market.Mes.Tpm.vo.MesTpmM;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.hnshituo.orm.GenericMapper;

public interface CostAcmProdMapper extends GenericMapper<CostAcmProd,Object> {
		
	//查找归集期间的所在投料时间内的的入库数据
	public List<CostAcmProd> doQuaryYdmProductInlistForCap(String startTime,String endTime);
		
	//查询出库数据：投入量 = 上工序的产出量
	public List<YdmProductOutlist> doQuaryYpoForCap(YdmProductDetail ypd);
	
	//删除成本期间内的投入产出归集数据
	public void deleteCostAcmProdByPrdnum(String prd_num);
	
	//获取主键ID
	public String getAcm_id(String param);
	
	//查询所有的表名
	public List<BaseOracleTableInfo> doQueryOracleTable(String condition);
	
	//查询某表的列名
	public List<BaseOracleTableInfo> doQueryOracleColumn(String condition);
	
	//查询授权角色
	public List<BaseDstItem> doQuarySysRole();
		
	//查询本年累计的投入产出数据
	public List<CostAcmProd> doQueryTotalCostAcmProd(CostAcmProd cap);
	
	//审核及反审操作
	public void doChangeCostAcmProdAuditFlg(CostAcmProd cap);
	
	//产量明细中间表的核算数据来源
	public List<CostAcmProd> doQuaryCcapForCrpd(CostAcmProd cap);
	
	//反写投入产出的单位加工成本
	public void doUpdateCostAcmProd(CostAcmProd cap);
	
	//查询3mm横剪机组，生产处理号对应的作业计划号的总投入量
	public Double doQuary3mmInweight(String process_no,String prd_num);
	
	//产品收发存统计的核算
	public List<CostAcmProd> doQuaryCcapForCrpi(CostAcmProd cap);
	
	//产品收发存统计的核算(在制品的减少量)
	public List<CostAcmProd> doQuaryOutCcapForCrpi(CostAcmProd cap);
	
	public List<CostAcmProd> doQuary12mmAnd4mm(String prd_num);
	@Select("${sql}")
	public int doQuary3mm(@Param("sql")String sql);

	//投入产出汇总统计
	public List<CostAcmProd> doQueryGbSumCostAcmProd(String prd_num);
	
	//产品成本明细报表
	public List<CostAcmProd> doQuaryCcapForReportDetail(CostAcmProd cap);
	
	@Update("update cm_cost_acm_prod t set t.prv_org_code=null,t.prv_org_name=null where t.acm_id = #{acm_id}")
	public void doReMovePrvOrg(@Param("acm_id")String acm_id);
	
	
	public List<MesRcmM> doQuaryMrmForCmCostAcmProd(String material_no_src,String order_no, String prd_num);
	public List<MesTpmM> doQuaryMtmForCmCostAcmProd(String material_no_src,String order_no, String prd_num);
	
	//价格反写，获取自制卷的投入量-产出量
	public List<CostAcmProd> doQuaryCostAcmProdForWriteBack(String prd_num);
}
