package com.tofly.gpsboot.common.system;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * 文件/数据表 类型
 *
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum FileTableEnum {
    /**
     * 隐患上报信息表
     */
    TF_YWPN_TROUBLE_W("TF_YWPN_TROUBLE_W","troubleService"),
    /**
     * 隐患消除记录表
     */
    TF_YWPN_TOUBLECLEAR_W("TF_YWPN_TOUBLECLEAR_W","toubleclearService"),
    /**
     * 工地监护上报信息表
     */
    TF_YWPN_BUILD_W("TF_YWPN_BUILD_W","buildService"),
    /**
     * 工地监护结束记录表
     */
    TF_YWPN_BULIDCLEAR_W("TF_YWPN_BULIDCLEAR_W","bulidclearService"),
    /**
     * 巡查过程记录表
     */
    TF_YWPN_RECORD_W("TF_YWPN_RECORD_W","recordService"),
    /**
     * 管线巡查记录上报表
     */
    TF_YWPN_PIPERECORD_W("TF_YWPN_PIPERECORD_W","piperecordService"),
    /**
     * 水压测试记录上报表
     */
    TF_YWPN_PRESSRECORD_W("TF_YWPN_PRESSRECORD_W","pressrecordService"),
    /**
     * 工单上报
     */
    TF_YWPN_REPAIRORDER_W("TF_YWPN_REPAIRORDER_W","repairorderService"),
    /**
     * 消防栓上报
     */
    TF_YWPN_HYDRANTRECORD_W("TF_YWPN_HYDRANTRECORD_W","hydrantrecordService"),

    /**
     * 探漏记录表
     */
    TF_YMPN_LEAK_RECORD_W("TF_YMPN_LEAK_RECORD_W","leakRecordService"),

    /**
     * 管网设施维护保养记录
     */
    TF_YMPN_PIPE_MF_RECORD_W("TF_YMPN_PIPE_MF_RECORD_W","pipeMfRecordService"),
    ;

    /**
     * 内容
     */
    private String tableName;

    /**
     * 注入服务名称
     */
    private String injectionServerType;

    public static String getCodeForValue(String tableName) {
        String path = "";
        if (StringUtils.isEmpty(tableName)) {
            return path;
        }

        for (FileTableEnum e : FileTableEnum.values()) {
            if (e.tableName.equalsIgnoreCase(tableName)) {
                path = e.injectionServerType;
                break;
            }
        }
        return path;
    }

}
