package comdianmapper;import comdiandomainFeiyong;import orgapacheibatisannotationsParam;import javautilList;public interface FeiyongMapper int deleteByPrimaryKeyInteger id; int insertFeiyong r
这段代码是一个MyBatis的Mapper接口,用于定义Feiyong(费用)对象的数据库操作方法。其中,Feiyong是一个Java Bean类,对应数据库中的一张表。
该Mapper接口中定义了以下方法:
- deleteByPrimaryKey(Integer id):根据主键id删除一条记录。
- insert(Feiyong record):插入一条记录。
- insertSelective(Feiyong record):插入一条记录,但只插入非空字段。
- selectByPrimaryKey(Integer id):根据主键id查询一条记录。
- selectByLeixing(Integer id):根据类型id查询一条记录。
- updateByPrimaryKeySelective(Feiyong record):根据主键id更新一条记录,但只更新非空字段。
- updateByPrimaryKey(Feiyong record):根据主键id更新一条记录。
此外,还定义了两个查询方法:
- query(int pageIndex, int pageSize):分页查询,返回指定页数和大小的记录列表。
- query():查询所有记录。
注解@Param用于给方法参数取别名,方便在SQL语句中引用
原文地址: https://www.cveoy.top/t/topic/dqtp 著作权归作者所有。请勿转载和采集!