com.jeesuite.mybatis.crud.builder.SqlTemplate Maven / Gradle / Ivy
/**
*
*/
package com.jeesuite.mybatis.crud.builder;
/**
* @description
* @author vakin
* @date 2016年10月25日
*/
public class SqlTemplate {
public static final String IF_TAG_TEAMPLATE = "%s, ";
public static final String SCRIPT_TEMAPLATE = "";
public static final String TRIM_PREFIX = "\n";
public static final String TRIM_SUFFIX = " ";
public static final String INSERT = "INSERT INTO %s \n %s \n VALUES \n %s";
public static final String UPDATE_BY_KEY = "UPDATE %s %s \n WHERE %s = #{%s}";
public static String wrapIfTag(String fieldName,String expr,boolean skip){
if(skip)return expr;
return String.format(IF_TAG_TEAMPLATE, fieldName,expr);
}
}