@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 List<AdWebTrxInfo> getAdWebTrxInfoList( String fromDate, String endDate, String trxOrderId) { String sql = "select adweb_wi,trxorderid,status,ordertime from beiker_adwebtrxinfo where ordertime>=? and ordertime<=? and adweb_cid=?"; List list = getSimpleJdbcTemplate().queryForList(sql, fromDate, endDate, trxOrderId); List<AdWebTrxInfo> listTrxInfo = new ArrayList<AdWebTrxInfo>(); if (list == null || list.size() == 0) return null; for (int i = 0; i < list.size(); i++) { Map map = (Map) list.get(i); AdWebTrxInfo ati = new AdWebTrxInfo(); ati.setTrxorderid((String) map.get("trxorderid")); ati.setTrxStatus((String) map.get("status")); ati.setOrderTime((Timestamp) map.get("ordertime")); ati.setAdwi((String) map.get("adweb_wi")); listTrxInfo.add(ati); } return listTrxInfo; }
@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; }
@Override public List<AdWebTrxInfo> getAdWebTrxInfoList( String fromDate, String endDate, String srccode, String cid) { String sql = "select adweb_wi,ordermoney,ordertime,trxorderid from beiker_adwebtrxinfo bai left join beiker_adweb ba on bai.adwebid=adweb_id where ba.adweb_code=? and bai.adweb_cid=? and bai.ordertime>=? and bai.ordertime<=? and bai.trxorderid is not null"; List list = this.getSimpleJdbcTemplate().queryForList(sql, srccode, cid, fromDate, endDate); if (list == null || list.size() == 0) return null; List<AdWebTrxInfo> listAdTrxInfo = new ArrayList<AdWebTrxInfo>(); for (int i = 0; i < list.size(); i++) { AdWebTrxInfo ati = new AdWebTrxInfo(); Map map = (Map) list.get(i); String adweb_wi = (String) map.get("adweb_wi"); ati.setAdwi(adweb_wi); ati.setTrxorderid((String) map.get(("trxorderid"))); Double ordermoney = ((BigDecimal) map.get("ordermoney")).doubleValue(); ati.setOrderMoney(ordermoney); Timestamp ordertime = (Timestamp) map.get("ordertime"); ati.setOrderTime(ordertime); listAdTrxInfo.add(ati); } return listAdTrxInfo; }