Search in sources :

Example 6 with ConfigTemplate

use of com.ctrip.platform.dal.daogen.entity.ConfigTemplate 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);
}
Also used : FreeSelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder) ConfigTemplate(com.ctrip.platform.dal.daogen.entity.ConfigTemplate) DalHints(com.ctrip.platform.dal.dao.DalHints) StatementParameters(com.ctrip.platform.dal.dao.StatementParameters)

Aggregations

ConfigTemplate (com.ctrip.platform.dal.daogen.entity.ConfigTemplate)6 Status (com.ctrip.platform.dal.daogen.domain.Status)3 DalHints (com.ctrip.platform.dal.dao.DalHints)1 StatementParameters (com.ctrip.platform.dal.dao.StatementParameters)1 FreeSelectSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder)1