ssm使用全注解实现增删改查案例——DeptMapperImpl
生活随笔
收集整理的這篇文章主要介紹了
ssm使用全注解实现增删改查案例——DeptMapperImpl
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
package org.dao.impl;import java.util.List;import org.dao.IDeptMapper;
import org.entity.Dept;
import org.springframework.beans.factory.annotation.Autowired;public class DeptMapperImpl implements IDeptMapper {//自動注入@Autowiredprivate IDeptMapper deptMapper;/*** (非 Javadoc)* <p>Description(描述): 根據編號刪除</p>* <p>Title: deleteByPrimaryKey</p>* @param id* @return* @see org.dao.IDeptMapper#deleteByPrimaryKey(java.lang.Integer)*/@Overridepublic int deleteByPrimaryKey(Integer id) {return deptMapper.deleteByPrimaryKey(id);}/*** (非 Javadoc)* <p>Description(描述):添加信息 </p>* <p>Title: insert</p>* @param record* @return* @see org.dao.IDeptMapper#insert(org.entity.Dept)*/@Overridepublic int insert(Dept record) {// TODO Auto-generated method stubreturn deptMapper.insert(record);}/**3* (非 Javadoc)* <p>Description(描述):根據主鍵刪除 </p>* <p>Title: selectByPrimaryKey</p>* @param id* @return* @see org.dao.IDeptMapper#selectByPrimaryKey(java.lang.Integer)*/@Overridepublic Dept selectByPrimaryKey(Integer id) {// TODO Auto-generated method stubreturn deptMapper.selectByPrimaryKey(id);}/*** (非 Javadoc)* <p>Description(描述):修改信息 </p>* <p>Title: updateByPrimaryKey</p>* @param record* @return* @see org.dao.IDeptMapper#updateByPrimaryKey(org.entity.Dept)*/@Overridepublic int updateByPrimaryKey(Dept record) {// TODO Auto-generated method stubreturn deptMapper.updateByPrimaryKey(record);}/*** (非 Javadoc)* <p>Description(描述):查詢全部 </p>* <p>Title: findDeptAll</p>* @return* @see org.dao.IDeptMapper#findDeptAll()*/@Overridepublic List<Dept> findDeptAll() {// TODO Auto-generated method stubreturn deptMapper.findDeptAll();}}
總結
以上是生活随笔為你收集整理的ssm使用全注解实现增删改查案例——DeptMapperImpl的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mybatis使用全注解的方式案例(包含
- 下一篇: 如何降低屏幕亮度