Search in sources :

Example 1 with UserProject

use of com.ctrip.platform.dal.daogen.entity.UserProject in project dal by ctripcorp.

the class DaoOfUserProject method getMinUserProjectByProjectId.

public UserProject getMinUserProjectByProjectId(int project_id) throws SQLException {
    FreeSelectSqlBuilder<UserProject> builder = new FreeSelectSqlBuilder<>(dbCategory);
    builder.setTemplate("SELECT id,project_id, user_no FROM user_project WHERE id=(SELECT min(id) FROM user_project WHERE project_id = ?)");
    StatementParameters parameters = new StatementParameters();
    int i = 1;
    parameters.set(i++, "project_id", Types.INTEGER, project_id);
    builder.mapWith(userProjectRowMapper).requireFirst().nullable();
    DalHints hints = DalHints.createIfAbsent(null).allowPartial();
    return queryDao.query(builder, parameters, hints);
}
Also used : FreeSelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder) DalHints(com.ctrip.platform.dal.dao.DalHints) UserProject(com.ctrip.platform.dal.daogen.entity.UserProject) StatementParameters(com.ctrip.platform.dal.dao.StatementParameters)

Aggregations

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 UserProject (com.ctrip.platform.dal.daogen.entity.UserProject)1