@Override
    public List<Element> incrementSetElementGenerated(IntrospectedColumn introspectedColumn, String prefix, boolean hasComma) {
        List<Element> list = new ArrayList<>();

        if (this.supportColumn(introspectedColumn)) {
            // 1. column = 节点
            list.add(new TextElement(MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn) + " = "));

            // 2. 选择节点
            // 条件
            XmlElement choose = new XmlElement("choose");

            // 没有启用增量操作
            XmlElement when = new XmlElement("when");
            when.addAttribute(new Attribute(
                    "test",
                    (prefix != null ? prefix : "_parameter.") + IncrementsPlugin.METHOD_INC_CHECK
                            + "('" + MyBatis3FormattingUtilities.escapeStringForMyBatis3(introspectedColumn.getActualColumnName()) + "')"
            ));
            TextElement spec = new TextElement(
                    MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn)
                            + " ${" + (prefix != null ? prefix : "_parameter.")
                            + IncrementsPlugin.METHOD_GET_INC_MAP + "()." + MyBatis3FormattingUtilities.escapeStringForMyBatis3(introspectedColumn.getActualColumnName()) + ".value} "
                            + MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, prefix));
            when.addElement(spec);
            choose.addElement(when);

            // 启用了增量操作
            XmlElement otherwise = new XmlElement("otherwise");
            TextElement normal = new TextElement(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, prefix));
            otherwise.addElement(normal);
            choose.addElement(otherwise);

            list.add(choose);

            // 3. 结尾逗号
            if (hasComma) {
                list.add(new TextElement(","));
            }
        }

        return list;
    }
@Override
    public List<Element> incrementSetElementGenerated(IntrospectedColumn introspectedColumn, String prefix, boolean hasComma) {
        List<Element> list = new ArrayList<>();

        if (this.supportColumn(introspectedColumn)) {
            
            list.add(new TextElement(MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn) + " = "));

            
            
            XmlElement choose = new XmlElement("choose");

            
            XmlElement when = new XmlElement("when");
            when.addAttribute(new Attribute(
                    "test",
                    (prefix != null ? prefix : "_parameter.") + IncrementsPlugin.METHOD_INC_CHECK
                            + "('" + MyBatis3FormattingUtilities.escapeStringForMyBatis3(introspectedColumn.getActualColumnName()) + "')"
            ));
            TextElement spec = new TextElement(
                    MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn)
                            + " ${" + (prefix != null ? prefix : "_parameter.")
                            + IncrementsPlugin.METHOD_GET_INC_MAP + "()." + MyBatis3FormattingUtilities.escapeStringForMyBatis3(introspectedColumn.getActualColumnName()) + ".value} "
                            + MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, prefix));
            when.addElement(spec);
            choose.addElement(when);

            
            XmlElement otherwise = new XmlElement("otherwise");
            TextElement normal = new TextElement(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn, prefix));
            otherwise.addElement(normal);
            choose.addElement(otherwise);

            list.add(choose);

            
            if (hasComma) {
                list.add(new TextElement(","));
            }
        }

        return list;
    }
@ Override public List < Element > incrementSetElementGenerated ( IntrospectedColumn introspectedColumn , String prefix , boolean hasComma ) { List < Element > list = new ArrayList <> ( ) ; if ( this . supportColumn ( introspectedColumn ) ) { // 1. column = 节点 list . add ( new TextElement ( MyBatis3FormattingUtilities . getEscapedColumnName ( introspectedColumn ) + " = " ) ) ; // 2. 选择节点 // 条件 XmlElement choose = new XmlElement ( "choose" ) ; // 没有启用增量操作 XmlElement when = new XmlElement ( "when" ) ; when . addAttribute ( new Attribute ( "test" , ( prefix != null ? prefix : "_parameter." ) + IncrementsPlugin . METHOD_INC_CHECK + "('" + MyBatis3FormattingUtilities . escapeStringForMyBatis3 ( introspectedColumn . getActualColumnName ( ) ) + "')" ) ) ; TextElement spec = new TextElement ( MyBatis3FormattingUtilities . getEscapedColumnName ( introspectedColumn ) + " ${" + ( prefix != null ? prefix : "_parameter." ) + IncrementsPlugin . METHOD_GET_INC_MAP + "()." + MyBatis3FormattingUtilities . escapeStringForMyBatis3 ( introspectedColumn . getActualColumnName ( ) ) + ".value} " + MyBatis3FormattingUtilities . getParameterClause ( introspectedColumn , prefix ) ) ; when . addElement ( spec ) ; choose . addElement ( when ) ; // 启用了增量操作 XmlElement otherwise = new XmlElement ( "otherwise" ) ; TextElement normal = new TextElement ( MyBatis3FormattingUtilities . getParameterClause ( introspectedColumn , prefix ) ) ; otherwise . addElement ( normal ) ; choose . addElement ( otherwise ) ; list . add ( choose ) ; // 3. 结尾逗号 if ( hasComma ) { list . add ( new TextElement ( "," ) ) ; } } return list ; }
生成增量操作节点
@param introspectedColumn
@param prefix
@param hasComma
@return
生成增量操作节点