package com.xisc.pm.infra.repository.impl;

import com.xisc.pm.domain.entity.PmCompositeSlabDiv;
import com.xisc.pm.domain.repository.PmCompositeSlabDivRepository;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.hzero.mybatis.domian.Condition;
import org.hzero.mybatis.util.Sqls;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 复合/叠轧坯分张命令表 资源库实现
 *
 * @author 曾俊 jun.zeng@hand-china.com 2024-09-05 10:20:49
 */
@Component
public class PmCompositeSlabDivRepositoryImpl extends BaseRepositoryImpl<PmCompositeSlabDiv> implements PmCompositeSlabDivRepository {

    @Override
    public List<PmCompositeSlabDiv> selectByPonoSlabList(List<String> basePonoSlabList, Long tenantId) {
        return this.selectByCondition(Condition.builder(PmCompositeSlabDiv.class)
                        .andWhere(Sqls.custom().andIn(PmCompositeSlabDiv.FIELD_PONO_SLAB, basePonoSlabList))
                        .andWhere(Sqls.custom().andEqualTo(PmCompositeSlabDiv.FIELD_TENANT_ID, tenantId))
                .build());
    }
}
