首页 > 代码库 > 拼接sql

拼接sql

String whereArgs = taskTable + " where 1=1 ";

if (upCheck) {
whereArgs += " and type = 2 ";
}
if (gameID != null && !gameID.equals("0")) {
whereArgs += " and gameID = " + gameID;
}
if (searchProjectkey != null && !searchProjectkey.trim().equals("")) {
whereArgs += " and projectID like " + "‘%" + searchProjectkey
+ "%‘";
}
if (searchChannelkey != null && !searchChannelkey.trim().equals("")) {
whereArgs += " and channelName like " + "‘%" + searchChannelkey
+ "%‘";
}

拼接sql