sql 1=1
sql.Append(" SELECT * ");
sql.Append(" FROM bank bk ");
sql.Append(" WHERE 1 = 1 "); //便于进行后面的条件判断,和动态 and sql 动态语句拼装
if (trueFlag1){
sql.Append(" AND bk.state = 1");
}
if (trueFlag2){
sql.Append(" AND bk.isBack = 1");
}
if (trueFlag3){
sql.Append(" AND bk.isFree = 1");
}