package cn.stylefeng.team.project.modular.businessrender.sql.impl;

public class MybatisXmlStructureCreator {

    public static String createSelectPageXml(String selectPageSQL) {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
                "<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n" +
                "<mapper namespace=\"cn.stylefeng.team.project.modular.businessrender.mapper.BusinessRenderMapper\">\n" +
                "    <select id=\"customFindPage\" resultType=\"java.util.Map\">\n" +
                "\n" + selectPageSQL + "\n" +
                "    </select>\n" +
                "</mapper>";
    }

    public static String createSelectOneXml(String selectOneSQL) {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
                "<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n" +
                "<mapper namespace=\"cn.stylefeng.team.project.modular.businessrender.mapper.BusinessRenderMapper\">\n" +
                "    <select id=\"findOne\" resultType=\"java.util.Map\">\n" +
                "\n" + selectOneSQL + "\n" +
                "    </select>\n" +
                "</mapper>";
    }

    public static String createSelectListXml(String selectListSQL) {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
                "<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n" +
                "<mapper namespace=\"cn.stylefeng.team.project.modular.businessrender.mapper.BusinessRenderMapper\">\n" +
                "    <select id=\"findList\" resultType=\"java.util.Map\">\n" +
                "\n" + selectListSQL + "\n" +
                "    </select>\n" +
                "</mapper>";
    }

    public static String createDeleteXml(String deleteSql) {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
                "<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n" +
                "<mapper namespace=\"cn.stylefeng.team.project.modular.businessrender.mapper.BusinessRenderMapper\">\n" +
                "\n" +
                "    <delete id=\"executeDelete\">\n" +
                "        \n" + deleteSql + "\n" +
                "    </delete>\n" +
                "    \n" +
                "</mapper>\n";
    }

    public static String createUpdateXml(String updateSql) {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
                "<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n" +
                "<mapper namespace=\"cn.stylefeng.team.project.modular.businessrender.mapper.BusinessRenderMapper\">\n" +
                "\n" +
                "    <update id=\"executeUpdate\" parameterType=\"map\">\n" +
                "        \n" + updateSql + "\n" +
                "    </update>\n" +
                "    \n" +
                "</mapper>\n";
    }

}
