码迷,mamicode.com
首页 > 其他好文 > 详细

把查询出来的结果进行修改再赋值给list

时间:2017-06-15 16:32:14      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:pattern   turn   date   log   ima   ant   anti   date()   eset   

List<RivBillNoPatternL> list = this.jdbcTemplate.getJdbcOperations().query(sqlSb.toString(), params.toArray(), new RowMapper<RivBillNoPatternL>(){

            @Override
            public RivBillNoPatternL mapRow(ResultSet rs, int rowNum)
                    throws SQLException {
                RivBillNoPatternL billNoPatternL = new RivBillNoPatternL();
                billNoPatternL.setBnplId(rs.getInt("bnpl_id"));
                billNoPatternL.setBnplHeaderId(rs.getInt("bnpl_header_id"));
                billNoPatternL.setBnplOrder(rs.getBigDecimal("bnpl_order"));
                billNoPatternL.setBnplPatternType(rs.getString("bnpl_pattern_type"));
                billNoPatternL.setBnplPattern(rs.getString("bnpl_pattern"));
                billNoPatternL.setBnplResetNumber(rs.getBigDecimal("bnpl_reset_number"));
                return billNoPatternL;
            }});
final List<RivExpiredWarningL> list = new ArrayList<RivExpiredWarningL>();
        final Date date = new Date();
        jdbcTemplate.query(sql, params.toArray(),new RowCallbackHandler(){
            @Override
            public void processRow(ResultSet rs) throws SQLException {
                RivExpiredWarningL exw = new RivExpiredWarningL();
                exw.setExwWarningDatetime(date);
                exw.setExwOrgId(rs.getInt(1));
                exw.setExwOwnerId(rs.getInt(2));
                exw.setExwQuantId(rs.getInt(3));
                list.add(exw);
            }
        });
        return list;

 

把查询出来的结果进行修改再赋值给list

标签:pattern   turn   date   log   ima   ant   anti   date()   eset   

原文地址:http://www.cnblogs.com/tonggc1668/p/7018158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!