UserPointLogDAO extends BaseIbatisDAO { public Long getSumUserPoint(final Map<String, Object> parameters) { if (LOG.isDebugEnabled()) { LOG.debug("查询：" + parameters + "的积分总和"); } return (Long) super.queryForObject("USER_POINT_LOG.sumPoint", parameters); }  void insert(final UserPointLog userPointLog); Long getSumUserPoint(final Map<String, Object> parameters); @SuppressWarnings("unchecked") List<UserPointLogWithDescription> getUserPointLog(final Map<String, Object> parameters); Long getCountUserPointLog(final Map<String, Object> parameters);  }
@Test public void testGetSumUserPoint() { UserPointLog upl = new UserPointLog(); upl.setUserId(1l); upl.setRuleId("POINT_RULE_FOR_REGISTER_TEST"); upl.setPoint(200L); upl.setMemo("TEST"); userPointLogDAO.insert(upl); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("userId", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); parameters.put("memo", "TESt"); Assert.assertEquals(200L, userPointLogDAO.getSumUserPoint(parameters).longValue()); }