类 SqlUpdateBuilder
java.lang.Object
com.sh.wf.module.helper.SqlUpdateBuilder
Description: 添加、修改SQL构造
Title:首亨软件 - TSS/CRM等
- 从以下版本开始:
- 2020年7月24日
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明protected static org.apache.logging.log4j.Loggerstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addBigIntCol(String colName, Object obj) addCol(String colName, String colType, Object obj, boolean isWhereCondition, boolean isIn, boolean isSelfExp) addDoubleCol(String colName, Object obj) addIntegerCol(String colName, Object obj) addObjectCol(String colName, Object obj) addStringCol(String colName, Object obj) addSystemTime(String colName) addTextCol(String colName, Object obj) addTimestampCol(String colName, String time, String format) addTimestampCol(String colName, Timestamp timestamp) addTimestampCol(String colName, LocalDateTime localDateTime) addTimestampCol(String colName, Date date) addTimestampColZone(String colName, String time, String format) addWhereBigIntCol(String colName, Object obj) addWhereBigIntCol_in(String colName, String obj) addWhereCol(String colName, String colType, Object obj) addWhereCol_in(String colName, String colType, String obj) addWhereDoubleCol(String colName, Object obj) addWhereIntegerCol(String colName, Object obj) addWhereIntegerCol_in(String colName, String obj) addWhereObjectol(String colName, Object obj) addWhereSelf(String exp) addWhereStringCol(String colName, Object obj) addWhereStringCol_in(String colName, String obj) addWhereTextCol(String colName, Object obj) asDelete()asInsert()使用on duplicate key update方式判断添加或修改数据,只有MySQL有效asUpdate()String[]delete(boolean commit) 执行删除操作int获取自增长值getBuilderCol(String colName) getBuilderWhereCol(String colName) doublegetColDoubleValue(String colName) doublegetColDoubleValue(String colName, double defaultValue) intgetColIntValue(String colName) intgetColIntValue(String colName, int defaultValue) longgetColLongValue(String colName) longgetColLongValue(String colName, long defaultValue) getColStringValue(String colName) getColValue(String colName) 查询值getDc()intgetSqlUpdateBuilderCol(String colName) getSqlUpdateBuilderCol(String colName, boolean isWhereCondition) 获取列信息insertEnable(boolean flag) insertEnable(String colName, boolean flag) insertValueRightExpress(String express) insertValueRightExpress(String colName, String express) booleanisColExists(String colName) 判断列是否存在,包括条件列或更新列booleanbooleanint判断记录是否存在isRecordExistsAndData(String... cols) booleanisUpdateColExists(String colName) 判断列是否存在booleanisWhereColExists(String colName) 判断条件列是否存在printLog(boolean logEnable) printLog(org.apache.logging.log4j.Logger log4j, boolean logEnable) 删除指定的列reset()重置参数,不改变表名setDc(DataCenter dc) setGetAutoValue(boolean autoValue) setOnlyInsert(boolean onlyInsert) setOnlyUpdate(boolean onlyUpdate) setTableName(String tableName) setWhereColOperator(String flag) setWhereColOperator(String colName, String flag) 设置where条件列的操作符,默认为 =String[]update()String[]update(boolean commit) 执行数据库操作updateEnable(boolean flag) updateEnable(String colName, boolean flag) updateValueRightExpress(String express) updateValueRightExpress(String colName, String express)
-
字段详细资料
-
_log4j
protected static org.apache.logging.log4j.Logger _log4j -
INSERT
public static final int INSERT- 另请参阅:
-
UPDATE
public static final int UPDATE- 另请参阅:
-
REPLACE
public static final int REPLACE- 另请参阅:
-
INSERT_UPDATE
public static final int INSERT_UPDATE- 另请参阅:
-
INSERT_IGNORE
public static final int INSERT_IGNORE- 另请参阅:
-
INSERT_UPDATE_DUPLICATE_KEY
public static final int INSERT_UPDATE_DUPLICATE_KEY- 另请参阅:
-
DELETE
public static final int DELETE- 另请参阅:
-
EXISTS
public static final int EXISTS- 另请参阅:
-
ERROR
public static final int ERROR- 另请参阅:
-
NOT_EXISTS
public static final int NOT_EXISTS- 另请参阅:
-
-
构造器详细资料
-
SqlUpdateBuilder
public SqlUpdateBuilder() -
SqlUpdateBuilder
-
SqlUpdateBuilder
-
SqlUpdateBuilder
-
-
方法详细资料
-
printLog
-
printLog
-
asInsert
-
asInsertIgnore
-
asUpdate
-
asInsertOrUpdate
-
asInsertOrUpdateOnDuplicateKey
使用on duplicate key update方式判断添加或修改数据,只有MySQL有效- 返回:
-
asReplace
-
onlyInsert
-
onlyUpdate
-
asDelete
-
setGetAutoValue
-
addWhereCol
-
addWhereCol_in
-
addWhereStringCol
-
addWhereStringCol_in
-
addWhereTextCol
-
addWhereIntegerCol
-
addWhereIntegerCol_in
-
addWhereBigIntCol
-
addWhereBigIntCol_in
-
addWhereDoubleCol
-
addWhereObjectol
-
addCol
-
addStringCol
-
addTextCol
-
addIntegerCol
-
addBigIntCol
-
addDoubleCol
-
addObjectCol
-
addTimestampCol
-
addTimestampColZone
-
addTimestampCol
-
addTimestampCol
-
addTimestampCol
-
getBuilderCol
-
getBuilderWhereCol
-
getSqlUpdateBuilderCol
-
getSqlUpdateBuilderCol
public SqlUpdateBuilder.SqlUpdateBuilderCol getSqlUpdateBuilderCol(String colName, boolean isWhereCondition) 获取列信息- 参数:
colName- StringisWhereCondition- boolean- 返回:
- SqlUpdateBuilderCol
-
addSelf
-
addWhereSelf
-
addCol
public SqlUpdateBuilder addCol(String colName, String colType, Object obj, boolean isWhereCondition) -
addCol
public SqlUpdateBuilder addCol(String colName, String colType, Object obj, boolean isWhereCondition, boolean isIn) -
addCol
public SqlUpdateBuilder addCol(String colName, String colType, Object obj, boolean isWhereCondition, boolean isIn, boolean isSelfExp) -
addSystemTime
-
updateValueRightExpress
-
updateValueRightExpress
-
insertValueRightExpress
-
insertValueRightExpress
-
insertEnable
-
insertEnable
-
updateEnable
-
updateEnable
-
setWhereColOperator
-
setWhereColOperator
设置where条件列的操作符,默认为 =- 参数:
colName-flag-- 返回:
-
update
-
update
执行数据库操作- 参数:
commit- boolean- 返回:
- String[]
-
delete
执行删除操作- 参数:
commit- boolean- 返回:
- String[]
-
isRecordExists
public int isRecordExists()判断记录是否存在- 返回:
- int
-
isRecordExistsAndData
-
removeCol
删除指定的列- 参数:
colName- String- 返回:
- SqlUpdateBuilder
-
isColExists
判断列是否存在,包括条件列或更新列- 参数:
colName- boolean- 返回:
- boolean
-
isWhereColExists
判断条件列是否存在- 参数:
colName- boolean- 返回:
- boolean
-
isUpdateColExists
判断列是否存在- 参数:
colName- String- 返回:
- boolean
-
getColStringValue
-
getColIntValue
-
getColIntValue
-
getColLongValue
-
getColLongValue
-
getColDoubleValue
-
getColDoubleValue
-
getColValue
查询值- 参数:
colName- String- 返回:
- Object
-
getTableName
-
setTableName
-
getDc
-
setDc
-
getColList
-
getWhereColList
-
isOnlyInsert
public boolean isOnlyInsert() -
setOnlyInsert
-
isOnlyUpdate
public boolean isOnlyUpdate() -
setOnlyUpdate
-
reset
-
resetParameter
重置参数,不改变表名- 返回:
-
getOperateType
public int getOperateType() -
getAutoGeneratedValue
public int getAutoGeneratedValue()获取自增长值- 返回:
- int
-