package com.xisc.pm.domain.repository;

import com.xisc.pm.domain.entity.PmProCont;
import com.xisc.pm.domain.entity.PmProContProdTtr;
import com.xisc.pm.domain.entity.PmSampleReserveBt;
import com.xisc.pm.domain.vo.QdOrderVO;
import com.xisc.pm.domain.vo.QdToLineupResultSteelVO;
import org.hzero.mybatis.base.BaseRepository;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 生产合同产品属性表资源库
 *
 * @author 曾俊 jun.zeng@hand-china.com 2024-07-29 14:28:18
 */
public interface PmProContProdTtrRepository extends BaseRepository<PmProContProdTtr> {

    /**
     * 
     * 通过订单编码和租户ID删除指定合同编码的产品属性数据
     * 
     * @param orderNoList
     * @param tenantId
     * @return 返回删除数据条数
     */
    int deleteByOrderNoList(List<String> orderNoList, Long tenantId);
    
    /**
     * 通过订单编码和租户ID查询指定合同编码的产品属性数据
     * @param orderNoList
     * @param tenantId
     * @return 返回属性数据
     */
    List<PmProContProdTtr> selectByOrderNoList(List<String> orderNoList, Long tenantId);

    /**
     * 生产合同属性信息
     *
     * @param pmProConts
     * @param poOrderMap
     * @param diOrderSet
     * @param pmSampleReserveBtMap
     * @return
     */
    List<PmProContProdTtr> createProContProdTtr(List<PmProCont> pmProConts, Map<String, QdOrderVO> poOrderMap, Set<String> diOrderSet,
                                                Map<String, PmSampleReserveBt> pmSampleReserveBtMap,  Map<String, String> qdOrderTechMap);

    /**
     * 查询板坯位置代码
     *
     * @param mscLineNoList
     * @param orderNoList
     * @param tenantId
     * @return
     */
    List<QdToLineupResultSteelVO> selectSlabPlaceCode(List<String> mscLineNoList, List<String> orderNoList, Long tenantId);
}
