src/main/java/com/itfsw/mybatis/generator/plugins/LogicalDeletePlugin.java
@Override
    public void initialized(IntrospectedTable introspectedTable) {
        super.initialized(introspectedTable);
        this.logicalUnDeleteEnumIndex = 0;
        this.logicalDeleteEnumIndex = 1;

        // 1. 获取配置的逻辑删除列
        Properties properties = getProperties();
        String logicalDeleteColumn = properties.getProperty(PRO_LOGICAL_DELETE_COLUMN);
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) != null) {
            logicalDeleteColumn = introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN);
        }
        this.logicalDeleteColumn = IntrospectedTableTools.safeGetColumn(introspectedTable, logicalDeleteColumn);
        // 判断如果表单独配置了逻辑删除列，但是却没有找到对应列进行提示
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) != null && this.logicalDeleteColumn == null) {
            warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "没有找到您配置的逻辑删除列(" + introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) + ")！");
        }

        // 2. 获取逻辑删除常量值
        this.enableLogicalDeleteConst = properties.getProperty(PRO_ENABLE_LOGICAL_DELETE_CONST) == null ? true : StringUtility.isTrue(properties.getProperty(PRO_ENABLE_LOGICAL_DELETE_CONST));
        if (this.enableLogicalDeleteConst) {
            if (properties.getProperty(PRO_LOGICAL_DELETE_CONST_NAME) != null) {
                this.logicalDeleteConstName = properties.getProperty(PRO_LOGICAL_DELETE_CONST_NAME).toUpperCase();
            }
            if (properties.getProperty(PRO_LOGICAL_UN_DELETE_CONST_NAME) != null) {
                this.logicalUnDeleteConstName = properties.getProperty(PRO_LOGICAL_UN_DELETE_CONST_NAME).toUpperCase();
            }
        }

        // 3.判断逻辑删除值是否配置了
        this.logicalDeleteValue = properties.getProperty(PRO_LOGICAL_DELETE_VALUE);
        this.logicalUnDeleteValue = properties.getProperty(PRO_LOGICAL_UN_DELETE_VALUE);
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_VALUE) != null) {
            this.logicalDeleteValue = introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_VALUE);
        }
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_UN_DELETE_VALUE) != null) {
            this.logicalUnDeleteValue = introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_UN_DELETE_VALUE);
        }
        if (this.logicalDeleteValue == null || this.logicalUnDeleteValue == null) {
            this.logicalDeleteColumn = null;
            warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "没有找到您配置的逻辑删除值，请全局或者局部配置logicalDeleteValue和logicalUnDeleteValue值！");
        }

        // 4. 优先借助 EnumTypeStatusPlugin 插件，去注解里面解析枚举
        if (this.logicalDeleteColumn != null) {
            EnumTypeStatusPlugin.EnumInfo enumInfo = null;
            try {
                enumInfo = new EnumTypeStatusPlugin.EnumInfo(this.logicalDeleteColumn);
                // 解析注释
                enumInfo.parseRemarks(this.logicalDeleteColumn.getRemarks());
            } catch (EnumTypeStatusPlugin.EnumInfo.NotSupportTypeException e) {
                this.logicalDeleteColumn = null;
                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "逻辑删除列(" + introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) + ")的类型不在支持范围（请使用数字列，字符串列，布尔列）！");
            } catch (EnumTypeStatusPlugin.EnumInfo.CannotParseException e) {
                // 这个异常不管，没有配置是正常的
            } finally {

                if (enumInfo != null) {
                    // 这个是注释里配置了枚举
                    if (enumInfo.hasItems()) {
                        if (enumInfo.getItems().size() < 2) {
                            this.logicalDeleteColumn = null;
                            warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "在配合EnumTypeStatusPlugin插件使用时，枚举数量必须大于等于2！");
                        } else {
                            this.logicalDeleteEnumIndex = -1;
                            this.logicalUnDeleteEnumIndex = -1;
                            for (int i = 0; i < enumInfo.getItems().size(); i++) {
                                EnumTypeStatusPlugin.EnumInfo.EnumItemInfo enumItemInfo = enumInfo.getItems().get(i);
                                if (this.logicalDeleteValue.equals(enumItemInfo.getOriginalValue())) {
                                    this.logicalDeleteEnumIndex = i;
                                } else if (this.logicalUnDeleteValue.equals(enumItemInfo.getOriginalValue())) {
                                    this.logicalUnDeleteEnumIndex = i;
                                }
                            }
                            if (this.logicalDeleteEnumIndex == -1) {
                                this.logicalDeleteColumn = null;
                                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "在配合EnumTypeStatusPlugin插件使用时，逻辑删除值“" + this.logicalDeleteValue + "”未在枚举中找到！");
                            } else if (this.logicalDeleteEnumIndex == -1) {
                                this.logicalDeleteColumn = null;
                                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "在配合EnumTypeStatusPlugin插件使用时，逻辑未删除值“" + this.logicalUnDeleteValue + "”未在枚举中找到！");
                            } else {
                                this.logicalDeleteEnum = enumInfo.generateEnum(commentGenerator, introspectedTable);
                            }

                        }
                    } else {
                        // 兼容处理以前一些老用户配置的Long 和 Float配置问题
                        if (this.logicalDeleteColumn.getFullyQualifiedJavaType().getFullyQualifiedName().equals(Long.class.getName())) {
                            this.logicalUnDeleteValue = this.logicalUnDeleteValue.replaceAll("L|l", "");
                            this.logicalDeleteValue = this.logicalDeleteValue.replaceAll("L|l", "");
                        } else if (this.logicalDeleteColumn.getFullyQualifiedJavaType().getFullyQualifiedName().equals(Float.class.getName())) {
                            this.logicalUnDeleteValue = this.logicalUnDeleteValue.replaceAll("F|f", "");
                            this.logicalDeleteValue = this.logicalDeleteValue.replaceAll("F|f", "");
                        }

                        enumInfo.addItem(this.logicalUnDeleteConstName, "未删除", this.logicalUnDeleteValue);
                        enumInfo.addItem(this.logicalDeleteConstName, "已删除", this.logicalDeleteValue);
                        this.logicalDeleteEnum = enumInfo.generateEnum(commentGenerator, introspectedTable);
                    }
                }
            }
        }

        // 5. 防止增强的selectByPrimaryKey中逻辑删除键冲突
        if (this.logicalDeleteColumn != null) {
            Field logicalDeleteField = JavaBeansUtil.getJavaBeansField(this.logicalDeleteColumn, context, introspectedTable);
            if (logicalDeleteField.getName().equals(PARAMETER_LOGICAL_DELETED)) {
                this.logicalDeleteColumn = null;
                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "配置的逻辑删除列和插件保留关键字(" + PARAMETER_LOGICAL_DELETED + ")冲突！");
            }
        }
    }
@Override
    public void initialized(IntrospectedTable introspectedTable) {
        super.initialized(introspectedTable);
        this.logicalUnDeleteEnumIndex = 0;
        this.logicalDeleteEnumIndex = 1;

        // 1. 获取配置的逻辑删除列
        Properties properties = getProperties();
        String logicalDeleteColumn = properties.getProperty(PRO_LOGICAL_DELETE_COLUMN);
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) != null) {
            logicalDeleteColumn = introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN);
        }
        this.logicalDeleteColumn = IntrospectedTableTools.safeGetColumn(introspectedTable, logicalDeleteColumn);
        // 判断如果表单独配置了逻辑删除列，但是却没有找到对应列进行提示
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) != null && this.logicalDeleteColumn == null) {
            warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "没有找到您配置的逻辑删除列(" + introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) + ")！");
        }

        // 2. 获取逻辑删除常量值
        this.enableLogicalDeleteConst = properties.getProperty(PRO_ENABLE_LOGICAL_DELETE_CONST) == null ? true : StringUtility.isTrue(properties.getProperty(PRO_ENABLE_LOGICAL_DELETE_CONST));
        if (this.enableLogicalDeleteConst) {
            if (properties.getProperty(PRO_LOGICAL_DELETE_CONST_NAME) != null) {
                this.logicalDeleteConstName = properties.getProperty(PRO_LOGICAL_DELETE_CONST_NAME).toUpperCase();
            }
            if (properties.getProperty(PRO_LOGICAL_UN_DELETE_CONST_NAME) != null) {
                this.logicalUnDeleteConstName = properties.getProperty(PRO_LOGICAL_UN_DELETE_CONST_NAME).toUpperCase();
            }
        }

        // 3.判断逻辑删除值是否配置了
        this.logicalDeleteValue = properties.getProperty(PRO_LOGICAL_DELETE_VALUE);
        this.logicalUnDeleteValue = properties.getProperty(PRO_LOGICAL_UN_DELETE_VALUE);
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_VALUE) != null) {
            this.logicalDeleteValue = introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_VALUE);
        }
        if (introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_UN_DELETE_VALUE) != null) {
            this.logicalUnDeleteValue = introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_UN_DELETE_VALUE);
        }
        if (this.logicalDeleteValue == null || this.logicalUnDeleteValue == null) {
            this.logicalDeleteColumn = null;
            warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "没有找到您配置的逻辑删除值，请全局或者局部配置logicalDeleteValue和logicalUnDeleteValue值！");
        }

        // 4. 优先借助 EnumTypeStatusPlugin 插件，去注解里面解析枚举
        if (this.logicalDeleteColumn != null) {
            EnumTypeStatusPlugin.EnumInfo enumInfo = null;
            try {
                enumInfo = new EnumTypeStatusPlugin.EnumInfo(this.logicalDeleteColumn);
                // 解析注释
                enumInfo.parseRemarks(this.logicalDeleteColumn.getRemarks());
            } catch (EnumTypeStatusPlugin.EnumInfo.NotSupportTypeException e) {
                this.logicalDeleteColumn = null;
                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "逻辑删除列(" + introspectedTable.getTableConfigurationProperty(PRO_LOGICAL_DELETE_COLUMN) + ")的类型不在支持范围（请使用数字列，字符串列，布尔列）！");
            } catch (EnumTypeStatusPlugin.EnumInfo.CannotParseException e) {
                // 这个异常不管，没有配置是正常的
            } finally {

                if (enumInfo != null) {
                    // 这个是注释里配置了枚举
                    if (enumInfo.hasItems()) {
                        if (enumInfo.getItems().size() < 2) {
                            this.logicalDeleteColumn = null;
                            warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "在配合EnumTypeStatusPlugin插件使用时，枚举数量必须大于等于2！");
                        } else {
                            this.logicalDeleteEnumIndex = -1;
                            this.logicalUnDeleteEnumIndex = -1;
                            for (int i = 0; i < enumInfo.getItems().size(); i++) {
                                EnumTypeStatusPlugin.EnumInfo.EnumItemInfo enumItemInfo = enumInfo.getItems().get(i);
                                if (this.logicalDeleteValue.equals(enumItemInfo.getOriginalValue())) {
                                    this.logicalDeleteEnumIndex = i;
                                } else if (this.logicalUnDeleteValue.equals(enumItemInfo.getOriginalValue())) {
                                    this.logicalUnDeleteEnumIndex = i;
                                }
                            }
                            if (this.logicalDeleteEnumIndex == -1) {
                                this.logicalDeleteColumn = null;
                                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "在配合EnumTypeStatusPlugin插件使用时，逻辑删除值“" + this.logicalDeleteValue + "”未在枚举中找到！");
                            } else if (this.logicalDeleteEnumIndex == -1) {
                                this.logicalDeleteColumn = null;
                                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "在配合EnumTypeStatusPlugin插件使用时，逻辑未删除值“" + this.logicalUnDeleteValue + "”未在枚举中找到！");
                            } else {
                                this.logicalDeleteEnum = enumInfo.generateEnum(commentGenerator, introspectedTable);
                            }

                        }
                    } else {
                        // 兼容处理以前一些老用户配置的Long 和 Float配置问题
                        if (this.logicalDeleteColumn.getFullyQualifiedJavaType().getFullyQualifiedName().equals(Long.class.getName())) {
                            this.logicalUnDeleteValue = this.logicalUnDeleteValue.replaceAll("L|l", "");
                            this.logicalDeleteValue = this.logicalDeleteValue.replaceAll("L|l", "");
                        } else if (this.logicalDeleteColumn.getFullyQualifiedJavaType().getFullyQualifiedName().equals(Float.class.getName())) {
                            this.logicalUnDeleteValue = this.logicalUnDeleteValue.replaceAll("F|f", "");
                            this.logicalDeleteValue = this.logicalDeleteValue.replaceAll("F|f", "");
                        }

                        enumInfo.addItem(this.logicalUnDeleteConstName, "未删除", this.logicalUnDeleteValue);
                        enumInfo.addItem(this.logicalDeleteConstName, "已删除", this.logicalDeleteValue);
                        this.logicalDeleteEnum = enumInfo.generateEnum(commentGenerator, introspectedTable);
                    }
                }
            }
        }

        // 5. 防止增强的selectByPrimaryKey中逻辑删除键冲突
        if (this.logicalDeleteColumn != null) {
            Field logicalDeleteField = JavaBeansUtil.getJavaBeansField(this.logicalDeleteColumn, context, introspectedTable);
            if (logicalDeleteField.getName().equals(PARAMETER_LOGICAL_DELETED)) {
                this.logicalDeleteColumn = null;
                warnings.add("itfsw(逻辑删除插件):" + introspectedTable.getFullyQualifiedTable() + "配置的逻辑删除列和插件保留关键字(" + PARAMETER_LOGICAL_DELETED + ")冲突！");
            }
        }
    }
初始化阶段
具体执行顺序 http://www.mybatis.org/generator/reference/pluggingIn.html
@param introspectedTable
@return