package com.casic.PgInterface.intelPlan.dto;

import com.casic.PgInterface.intelPlan.domain.PgPile;

import java.util.ArrayList;
import java.util.List;

public class PgPileDTO {

    private Long id;
    private String pileCode;//编号
    private boolean active;//状态位

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPileCode() {
        return pileCode;
    }

    public void setPileCode(String pileCode) {
        this.pileCode = pileCode;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public static PgPileDTO ConvertToDTO(PgPile pgPile){
        if(pgPile==null) return null;
        PgPileDTO pgLineDTO=new PgPileDTO();

        pgLineDTO.setId(pgPile.getId());
        pgLineDTO.setPileCode(pgPile.getPileCode());

        return pgLineDTO;
    }

    public static List<PgPileDTO> ConvertToDTOList(List<PgPile> pgPileList){

        if(pgPileList==null) return null;
        List<PgPileDTO> pgLineDTOList=new ArrayList<>();

        for(PgPile pgPile:pgPileList){
            pgLineDTOList.add(ConvertToDTO(pgPile));
        }
        return pgLineDTOList;
    }

}