@Override
    public boolean sqlMapUpdateByPrimaryKeySelectiveElementGenerated(XmlElement element, IntrospectedTable introspectedTable) {
        // 清空
        XmlElement answer = new XmlElement("update");
        answer.addAttribute(new Attribute("id", introspectedTable.getUpdateByPrimaryKeySelectiveStatementId()));
        answer.addAttribute(new Attribute("parameterType", "map"));

        commentGenerator.addComment(answer);

        StringBuilder sb = new StringBuilder();

        sb.append("update ");
        sb.append(introspectedTable.getFullyQualifiedTableNameAtRuntime());
        answer.addElement(new TextElement(sb.toString()));

        // selective
        answer.addElement(new TextElement("SET"));
        answer.addElement(this.generateSetsSelective(ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns())));

        XmlElementGeneratorTools.generateWhereByPrimaryKeyTo(answer, introspectedTable.getPrimaryKeyColumns(), "record.");

        XmlElementTools.replaceXmlElement(element, answer);
        return super.sqlMapUpdateByPrimaryKeySelectiveElementGenerated(element, introspectedTable);
    }
@Override
    public boolean sqlMapUpdateByPrimaryKeySelectiveElementGenerated(XmlElement element, IntrospectedTable introspectedTable) {
        
        XmlElement answer = new XmlElement("update");
        answer.addAttribute(new Attribute("id", introspectedTable.getUpdateByPrimaryKeySelectiveStatementId()));
        answer.addAttribute(new Attribute("parameterType", "map"));

        commentGenerator.addComment(answer);

        StringBuilder sb = new StringBuilder();

        sb.append("update ");
        sb.append(introspectedTable.getFullyQualifiedTableNameAtRuntime());
        answer.addElement(new TextElement(sb.toString()));

        
        answer.addElement(new TextElement("SET"));
        answer.addElement(this.generateSetsSelective(ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns())));

        XmlElementGeneratorTools.generateWhereByPrimaryKeyTo(answer, introspectedTable.getPrimaryKeyColumns(), "record.");

        XmlElementTools.replaceXmlElement(element, answer);
        return super.sqlMapUpdateByPrimaryKeySelectiveElementGenerated(element, introspectedTable);
    }
@ Override public boolean sqlMapUpdateByPrimaryKeySelectiveElementGenerated ( XmlElement element , IntrospectedTable introspectedTable ) { // 清空 XmlElement answer = new XmlElement ( "update" ) ; answer . addAttribute ( new Attribute ( "id" , introspectedTable . getUpdateByPrimaryKeySelectiveStatementId ( ) ) ) ; answer . addAttribute ( new Attribute ( "parameterType" , "map" ) ) ; commentGenerator . addComment ( answer ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "update " ) ; sb . append ( introspectedTable . getFullyQualifiedTableNameAtRuntime ( ) ) ; answer . addElement ( new TextElement ( sb . toString ( ) ) ) ; // selective answer . addElement ( new TextElement ( "SET" ) ) ; answer . addElement ( this . generateSetsSelective ( ListUtilities . removeGeneratedAlwaysColumns ( introspectedTable . getNonPrimaryKeyColumns ( ) ) ) ) ; XmlElementGeneratorTools . generateWhereByPrimaryKeyTo ( answer , introspectedTable . getPrimaryKeyColumns ( ) , "record." ) ; XmlElementTools . replaceXmlElement ( element , answer ) ; return super . sqlMapUpdateByPrimaryKeySelectiveElementGenerated ( element , introspectedTable ) ; }
updateByPrimaryKeySelective
具体执行顺序 http://www.mybatis.org/generator/reference/pluggingIn.html
@param element
@param introspectedTable
@return
updateByPrimaryKeySelective 具体执行顺序 http : // www . mybatis . org / generator / reference / pluggingIn . html