SmsInstructionDAO extends BaseIbatisDAO { public void deleteByPrimaryKey(final String instructionCode) { super.delete("SMS_INSTRUCTION.delete", 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 testDeleteByPrimaryKey() throws Exception { SmsInstruction instruction = new SmsInstruction(); instruction.setCouponCode("couponCode"); instruction.setCouponId("23,233,231"); instruction.setDescription("测试用例"); instruction.setInstructionCode("test321"); smsInstructionDAO.save(instruction); smsInstructionDAO.deleteByPrimaryKey(instruction.getInstructionCode()); Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery("SELECT * FROM sms_instruction WHERE instruction_code = 'test321'"); if (rs.next()) { fail("删除记录有错误"); } }