@Override public AdWebTrxInfo getAdWebTrxInfoByTrxId(String trxOrderId) { String sql = "select bai.trxorderid,bai.adweb_cid,bai.adweb_wi,bai.buycount,bai.ordermoney,bai.ordertime,bai.userid,ba.adweb_trxurl from beiker_adwebtrxinfo bai left join beiker_adweb ba on bai.adwebid=adweb_id where trxorderid=?"; List list = getSimpleJdbcTemplate().queryForList(sql, trxOrderId); if (list == null || list.size() == 0) return null; AdWebTrxInfo ati = new AdWebTrxInfo(); Map map = (Map) list.get(0); ati.setTrxorderid((String) map.get(("trxorderid"))); ati.setAdcid((String) map.get("adweb_cid")); ati.setAdwi((String) map.get("adweb_wi")); ati.setBuycount(((Number) map.get("buycount")).intValue()); ati.setOrderMoney(((Number) map.get("ordermoney")).doubleValue()); ati.setOrderTime((Timestamp) map.get("ordertime")); ati.setAdweb_trxurl((String) map.get(("adweb_trxurl"))); return ati; }
@Override public AdWebTrxInfo mapRow(ResultSet rs, int num) throws SQLException { AdWebTrxInfo adWebTrxInfo = new AdWebTrxInfo(); adWebTrxInfo.setAdWebTrxId(rs.getLong("adwebtrx_id")); adWebTrxInfo.setTrxorderid(rs.getString("trxorderid")); adWebTrxInfo.setAdcid(rs.getString("adweb_cid")); adWebTrxInfo.setAdwebid(rs.getLong("adwebid")); adWebTrxInfo.setAdwi(rs.getString("adweb_wi")); adWebTrxInfo.setBuycount(rs.getInt("buycount")); adWebTrxInfo.setOrderMoney(rs.getDouble("ordermoney")); adWebTrxInfo.setOrderTime(rs.getTimestamp("ordertime")); String adweb_trxurl = rs.getString("adweb_trxurl"); if (adweb_trxurl != null) { adWebTrxInfo.setAdweb_trxurl(adweb_trxurl); } return adWebTrxInfo; }
@Override public AdWebTrxInfo getAdWebTrxInfo(Long adwebid, String adcid, String adwi) { String sql = "select adwebid,adweb_cid,adweb_wi,adwebtrx_id,trxorderid,buycount,ordermoney,ordertime from beiker_adwebtrxinfo where adwebid=? and adweb_cid=? and adweb_wi=?"; List list = getSimpleJdbcTemplate().queryForList(sql, adwebid, adcid, adwi); if (list == null || list.size() == 0) return null; AdWebTrxInfo ati = new AdWebTrxInfo(); Map map = (Map) list.get(0); ati.setAdWebTrxId(((Number) map.get(("adwebtrx_id"))).longValue()); ati.setTrxorderid((String) map.get(("trxorderid"))); ati.setAdcid((String) map.get("adweb_cid")); ati.setAdwebid(((Number) map.get("adwebid")).longValue()); ati.setAdwi((String) map.get("adweb_wi")); ati.setBuycount(((Number) map.get("buycount")).intValue()); ati.setOrderMoney(((Number) map.get("ordermoney")).doubleValue()); ati.setOrderTime((Timestamp) map.get("ordertime")); return ati; }