SmsInstructionDAO extends BaseIbatisDAO { public Long count(final Map<String, Object> param) { return (Long) super.queryForObject("SMS_INSTRUCTION.countQuery", param); }  @SuppressWarnings("unchecked") List<SmsInstruction> query(final Map<String, Object> param); SmsInstruction save(final SmsInstruction instructions); void deleteByPrimaryKey(final String instructionCode); void update(final SmsInstruction instructions); SmsInstruction queryByPrimaryKey(final String instructionCode); Long count(final Map<String, Object> param);  }
@Test public void testCount() throws Exception { SmsInstruction instruction = new SmsInstruction(); instruction.setCouponCode("couponCode"); instruction.setCouponId("23,233,231"); instruction.setDescription("测试用例"); instruction.setInstructionCode("test321"); smsInstructionDAO.save(instruction); Map<String, Object> params = new HashMap<String, Object>(); params.put("couponCode", "couponCode"); params.put("instructionCode","test321"); Assert.assertEquals(1, smsInstructionDAO.count(params).intValue()); }