NoticeMapper 接口:Java 数据表操作接口

package com.ideabobo.service;

import com.ideabobo.model.Notice;

public interface NoticeMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Notice record);

    int insertSelective(Notice record);

    Notice selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Notice record);

    int updateByPrimaryKey(Notice record);
}

该接口定义了对 Notice 模型对应数据表的常用操作方法,包含:

  1. deleteByPrimaryKey(Integer id): 根据主键 id 删除对应的记录。
  2. insert(Notice record): 插入一条新的记录,参数为 Notice 类型的实体对象。
  3. insertSelective(Notice record): 插入一条新的记录,只插入非空字段,参数为 Notice 类型的实体对象。
  4. selectByPrimaryKey(Integer id): 根据主键 id 查询对应的记录,返回 Notice 类型的实体对象。
  5. updateByPrimaryKeySelective(Notice record): 根据主键 id 更新对应的记录,只更新非空字段,参数为 Notice 类型的实体对象。
  6. updateByPrimaryKey(Notice record): 根据主键 id 更新对应的记录,更新所有字段,参数为 Notice 类型的实体对象。

通过该接口,可以方便地进行 Notice 模型对应数据表的增删改查操作。

NoticeMapper 接口:Java 数据表操作接口

原文地址: https://www.cveoy.top/t/topic/jn05 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录