SmsInstructionDAO extends BaseIbatisDAO { public SmsInstruction queryByPrimaryKey(final String instructionCode) { return (SmsInstruction) super.queryForObject( "SMS_INSTRUCTION.queryByPrimaryKey", instructionCode); }  @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 testQueryByPrimaryKey() throws Exception { SmsInstruction instruction = new SmsInstruction(); instruction.setCouponCode("couponCode"); instruction.setCouponId("23,233,231"); instruction.setDescription("测试用例"); instruction.setInstructionCode("test321"); smsInstructionDAO.save(instruction); SmsInstruction actualSmsInstruction = smsInstructionDAO.queryByPrimaryKey("test321"); Assert.assertEquals(actualSmsInstruction.getInstructionCode(), instruction.getInstructionCode()); Assert.assertEquals(actualSmsInstruction.getCouponCode(), instruction.getCouponCode()); Assert.assertEquals(actualSmsInstruction.getDescription(), instruction.getDescription()); Assert.assertEquals(actualSmsInstruction.getCouponId(), instruction.getCouponId()); }