Commit 75e74d54 authored by yanzg's avatar yanzg

常规BUG的修改

parent 1dd16657
......@@ -74,39 +74,39 @@ public class DaoConst {
* 单位地址
*/
public static final int CODE_UNIT = 2;
/**
* 表名代码片段
* 插入SQL语句模板
*/
public static final String TABLE_CODE = "{TABLE}";
public static final String SQL_INSERT = "INSERT INTO {TABLE}({FIELD}) VALUES({VALUES})";
/**
* 字段代码片段
* 更新SQL语句模板
*/
public static final String FIELD_CODE = "{FIELD}";
public static final String SQL_UPDATE = "UPDATE {TABLE} AS a {INNER} SET {FIELD} WHERE 1=1 {WHERE}";
/**
* 值代码片段
* 删除SQL语句模板
*/
public static final String VALUES_CODE = "{VALUES}";
public static final String SQL_REMOVE = "DELETE a FROM {TABLE} AS a {INNER} WHERE 1=1 {WHERE}";
/**
* WHERE条件代码片段
* 加载SQL语句模板
*/
public static final String WHERE_CODE = "{WHERE}";
public static final String SQL_LOAD = "SELECT a.*{FIELD} FROM {TABLE} AS a {INNER} WHERE 1=1 {WHERE}";
/**
* 插入SQL语句模板
* 表名代码片段
*/
public static final String INSERT_MODEL = "INSERT INTO {TABLE}({FIELD}) VALUES({VALUES})";
public static final String CODE_TABLE = "{TABLE}";
/**
* 更新SQL语句模板
* 字段代码片段
*/
public static final String UPDATE_MODEL = "UPDATE {TABLE} AS a {INNER} SET {FIELD} WHERE 1=1 {WHERE}";
public static final String CODE_FIELD = "{FIELD}";
/**
* 删除SQL语句模板
* 值代码片段
*/
public static final String REMOVE_MODEL = "DELETE a FROM {TABLE} AS a {INNER} WHERE 1=1 {WHERE}";
public static final String CODE_VALUES = "{VALUES}";
/**
* 加载SQL语句模板
* WHERE条件代码片段
*/
public static final String LOAD_MODEL = "SELECT a.*{FIELD} FROM {TABLE} AS a {INNER} WHERE 1=1 {WHERE}";
public static final String CODE_WHERE = "{WHERE}";
/**
* 更新字段模板
*/
......
package com.yanzuoguang.dao;
import com.yanzuoguang.util.helper.StringHelper;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
......@@ -18,7 +20,7 @@ public @interface TableAnnotation {
*
* @return
*/
String value();
String value() default StringHelper.EMPTY;
/**
* 字段类型
......
......@@ -84,7 +84,7 @@ public class AllBeanRowMapper<T> implements RowMapper<T> {
} else if (field.getGetMethod() != null) {
annotation = field.getGetMethod().getAnnotation(TableAnnotation.class);
}
if (annotation != null) {
if (annotation != null && !StringHelper.isEmpty(annotation.value())) {
name = annotation.value();
}
String underscoredName = underscoreName(name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment