package thyyxxk.webserver.entity.orderZdMaintain.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import thyyxxk.webserver.entity.orderZdMaintain.enums.SupplyClass;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "mz_zd_supply_type")
public class MzZdSupplyType {
    /**
     * supplyCode
     */
    @TableField(value = "supply_code")
    private String supplyCode;

    /**
     * supplyName
     */
    @TableField(value = "supply_name")
    private String supplyName;

    /**
     * supplyOcc
     */
    @TableField(value = "supply_occ")
    private String supplyOcc;

    /**
     * delFlag
     */
    @TableField(value = "del_flag")
    private String delFlag;

    /**
     * sortCode
     */
    @TableField(value = "sort_code")
    private Integer sortCode;

    /**
     * class
     */
    @TableField(value = "class_code")
    private Integer classCode;

    /**
     * printName
     */
    @TableField(value = "print_name")
    private String printName;

    /**
     * pyCode
     */
    @TableField(value = "py_code")
    private String pyCode;

    /**
     * dCode
     */
    @TableField(value = "d_code")
    private String dCode;

    @TableField(value = "child_code")
    private String childCode;

    /**
     * tryFlag
     */
    @TableField(value = "try_flag")
    private String tryFlag;

    @TableField(exist = false)
    private String childName;


    public static LambdaQueryWrapper<YzSupplyTypeDTO> lambdaQueryWrapper() {
        return new LambdaQueryWrapper<>();
    }

    public static QueryWrapper<YzSupplyTypeDTO> queryWrapper() {
        return new QueryWrapper<>();
    }

    public String getClassName() {
        return SupplyClass.getNameByCode(this.classCode, "zy");
    }

}
