Mybayis反向工程,自带方法的作用
public interface UserMapper {
//查询总数
int countByExample(UserExample example);
//根据where 限定条件删除
int deleteByExample(UserExample example);
//根据主键删除
int deleteByPrimaryKey(Integer id);
//插入数据
int insert(User record);
//只插入非空字段
int insertSelective(User record);
//根据限定条件查询
List selectByExample(UserExample example);
//根据主键查询
User selectByPrimaryKey(Integer id);
//只更新非空字段
int updateByExampleSelective(@Param(“record”) User record, @Param(“example”) UserExample example);
//所有字段都更新
int updateByExample(@Param(“record”) User record, @Param(“example”) UserExample example);
//根据主键更新,只更新非空字段
int updateByPrimaryKeySelective(User record);
//根据主键更新,全部更新
int updateByPrimaryKey(User record)