Search in sources :

Example 1 with ApproveTask

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

the class ApproveTaskDao method processList.

private void processList(List<ApproveTask> list) {
    if (list == null || list.size() == 0)
        return;
    for (ApproveTask entity : list) {
        Date date = new Date(entity.getCreate_time().getTime());
        entity.setStr_create_time(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date));
    }
}
Also used : ApproveTask(com.ctrip.platform.dal.daogen.entity.ApproveTask) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Example 2 with ApproveTask

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

the class ApproveTaskDao method getAllApproveTaskByApproverId.

public List<ApproveTask> getAllApproveTaskByApproverId(Integer approverId) throws SQLException {
    FreeSelectSqlBuilder<List<ApproveTask>> builder = new FreeSelectSqlBuilder<>(dbCategory);
    builder.setTemplate("SELECT id, task_id, task_type, create_time, create_user_id, approve_user_id FROM approve_task WHERE approve_user_id=?");
    StatementParameters parameters = new StatementParameters();
    int i = 1;
    parameters.set(i++, "approve_user_id", Types.INTEGER, approverId);
    builder.mapWith(approveTaskRowMapper);
    DalHints hints = DalHints.createIfAbsent(null).allowPartial();
    List<ApproveTask> list = queryDao.query(builder, parameters, hints);
    processList(list);
    return list;
}
Also used : FreeSelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder) DalHints(com.ctrip.platform.dal.dao.DalHints) StatementParameters(com.ctrip.platform.dal.dao.StatementParameters) List(java.util.List) ApproveTask(com.ctrip.platform.dal.daogen.entity.ApproveTask)

Aggregations

ApproveTask (com.ctrip.platform.dal.daogen.entity.ApproveTask)2 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 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 List (java.util.List)1