Mybatis的delete方法
生活随笔
收集整理的這篇文章主要介紹了
Mybatis的delete方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Delete方法
根據id,刪除記錄
public void deleteLogicalAccount(Long Id) {employeeExtService.delete(Id); }deleteLogically方法
根據id,刪除記錄
public void deleteLogicalAccount(Long Id) {employeeExtService.deleteLogically(Id); }deleteBatchEmployee方法
根據ids,刪除記錄,形式為數組
public void deleteLogicalAccount(Long[] Ids) {employeeExtService.deleteBatchEmployee(Ids); }deleteByExample方法
根據實體字段,刪除記錄
public void deleteLogical(String id) {SpecimenPreservingTimeExample example = new SpecimenPreservingTimeExample();SpecimenPreservingTimeExample.Criteria criteria = example.createCriteria();String[] iArray = id.split("-");if(iArray.length == 2){criteria.andSampleBizModelIdEqualTo(iArray[0]);criteria.andSpecimenModelIdEqualTo(iArray[1]);}this.specimenPreservingTimeService.deleteByExample(example); }總結
以上是生活随笔為你收集整理的Mybatis的delete方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Mybatis的update方法
- 下一篇: Mybatis的resultMap