UserPointLogDAO extends BaseIbatisDAO { public void insert(final UserPointLog userPointLog) { super.insert("USER_POINT_LOG.insert", userPointLog); if (LOG.isDebugEnabled()) { LOG.debug("成功插入用户积分记录" + userPointLog); } }  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 testInsert() throws Exception { UserPointLog upl = new UserPointLog(); upl.setUserId(1l); upl.setRuleId("POINT_RULE_FOR_REGISTER_TEST"); upl.setPoint(200L); upl.setMemo("TEST"); userPointLogDAO.insert(upl); Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery("select * from user_point_log where rule_id = 'POINT_RULE_FOR_REGISTER_TEST'"); rs.next(); Assert.assertEquals("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", rs.getString("user_id")); Assert.assertEquals("POINT_RULE_FOR_REGISTER_TEST", rs.getString("rule_id")); Assert.assertNotNull(rs.getDate("created_date")); Assert.assertEquals(200L, rs.getLong("point")); Assert.assertEquals("TEST", rs.getString("memo")); }