2019独角兽企业重金招聘Python工程师标准>>>
insert
String[] columns = {};
String sql = "INSERT INTO %s(%s) VALUES(%s)";
sql = String.format(sql, tableName, StringUtils.join(columns, ","), StringUtils.repeat("?", ",", columns.length));
update
String[] columns = {};
String sql = "UPDATE %s SET %s WHERE %s=?";
sql = String.format(sql, tableName, StringUtils.join(columns, "=?,") + "=?", pkCol);
selectByPk(hibernate传递参数方式)
String[] columns = {};
String sql = "SELECT %1$s FROM %2$s WHERE %3$s IN (:%3$s)";
sql = String.format(sql, StringUtils.join(columns, ","), tableName, pkCol);