use of com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder in project dal by ctripcorp.
the class ConfigTemplateDao method getConfigTemplateByConditions.
public ConfigTemplate getConfigTemplateByConditions(ConfigTemplate configTemplate) throws SQLException {
if (configTemplate == null)
return null;
FreeSelectSqlBuilder<ConfigTemplate> builder = new FreeSelectSqlBuilder<>(dbCategory);
builder.setTemplate("SELECT ID, CONFIG_TYPE, LANG_TYPE, TEMPLATE FROM config_template WHERE CONFIG_TYPE=? AND LANG_TYPE=?");
StatementParameters parameters = new StatementParameters();
int i = 1;
parameters.set(i++, "CONFIG_TYPE", Types.INTEGER, configTemplate.getConfig_type());
parameters.set(i++, "LANG_TYPE", Types.INTEGER, configTemplate.getLang_type());
builder.mapWith(configTemplateRowMapper).requireFirst().nullable();
DalHints hints = DalHints.createIfAbsent(null).allowPartial();
return queryDao.query(builder, parameters, hints);
}
Aggregations