Spring jdbctemplate 模糊查询Like

阅读更多
StringBuffer sbf = new StringBuffer();
sbf.append("SELECT  ");
sbf.append("acc_sign.AVATAR,");
sbf.append("acc_sign.USER_NAME,");
sbf.append("acc_sign.DISTANCE, ");
sbf.append("acc_sign.SIGN_TIME ");
sbf.append("FROM ");
sbf.append("acc_sign ");
sbf.append("WHERE ");
sbf.append("acc_sign.CORP_CODE = ? ");
sbf.append("AND STATUS = ? ");
sbf.append("AND STORE_CODE = ? ");
sbf.append("AND USER_NAME LIKE ? ");
sbf.append("AND ISACTIVE = 'Y' ");
sbf.append("LIMIT ?,? ");
return sbf.toString();

》》》》》参数
param[3]  = "%"+MapUtil.getParam(db.data,"user_name")+"%";

你可能感兴趣的:(jdbctemplate,模糊查询)