当前位置: 首页 > news >正文

做的比较好的官方网站百度推广账户怎么开

做的比较好的官方网站,百度推广账户怎么开,新手学易语言多久可以做网站,膜结构网站推广怎么做🐌个人主页: 🐌 叶落闲庭 💨我的专栏:💨 c语言 数据结构 javaEE 操作系统 Redis 石可破也,而不可夺坚;丹可磨也,而不可夺赤。 MyBatisPlus 一、快速入门1.1 引入MyBatisP…

在这里插入图片描述

🐌个人主页: 🐌 叶落闲庭
💨我的专栏:💨
c语言
数据结构
javaEE
操作系统
Redis

石可破也,而不可夺坚;丹可磨也,而不可夺赤。


MyBatisPlus

  • 一、快速入门
    • 1.1 引入MyBatisPlus起步依赖
    • 1.2 自定义的Mapper继承MyBatisPlus的BaseMapper接口
    • 1.3 对比Mybatis
    • 1.4 MyBatisPlus的增删改查方法
  • 二、MyBatisPlus常用注解
    • 2.1 MyBatisPlus常用注解如下
  • 三、MyBatisPlus常用配置

一、快速入门

MyBatisPlus官方提供了starter,其中集成了Mybatis和MybatisPlus的所有功能,并且实现了自动装配效果。

1.1 引入MyBatisPlus起步依赖

<dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.2</version>
</dependency>

1.2 自定义的Mapper继承MyBatisPlus的BaseMapper接口

public interface UserMapper extends BaseMapper<User> {
}

1.3 对比Mybatis

  • 要操作的数据库表结构:
create table user
(id      int not null primary key,account int null
);
  • Mybatis的UserMapper.java:
public interface UserMapper {int insert(User row);int insertSelective(User row);User selectByPrimaryKey(Integer id);int updateByPrimaryKeySelective(User row);int updateByPrimaryKey(User row);
}
  • Mybatis的UserMapper .xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.demo.mapper.UserMapper"><resultMap id="BaseResultMap" type="com.demo.po.User"></resultMap><sql id="Base_Column_List">id, account</sql><select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from userwhere id = #{id,jdbcType=INTEGER}</select><insert id="insert" parameterType="com.demo.po.User">insert into user (id, account)values (#{id,jdbcType=INTEGER}, #{account,jdbcType=INTEGER})</insert><insert id="insertSelective" parameterType="com.demo.po.User">insert into user<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if><if test="account != null">account,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="id != null">#{id,jdbcType=INTEGER},</if><if test="account != null">#{account,jdbcType=INTEGER},</if></trim></insert><update id="updateByPrimaryKeySelective" parameterType="com.demo.po.User">update user<set><if test="account != null">account = #{account,jdbcType=INTEGER},</if></set>where id = #{id,jdbcType=INTEGER}</update><update id="updateByPrimaryKey" parameterType="com.demo.po.User">update userset account = #{account,jdbcType=INTEGER}where id = #{id,jdbcType=INTEGER}</update>
</mapper>
  • MyBatisPlus只需UserMapper.java继承 BaseMapper<>即可:
public interface UserMapper extends BaseMapper<User> {
}

1.4 MyBatisPlus的增删改查方法

@SpringBootTest
class DemoApplicationTests {@Autowiredprivate UserMapper userMapper;@Testvoid testInsert() {User user = new User();user.setId(5);user.setAccount(2000);userMapper.insert(user);}@Testvoid testSelectById() {User user = userMapper.selectById(5);System.out.println(user);}@Testvoid testUpdateById() {User user = new User();user.setId(5);user.setAccount(8000);userMapper.updateById(user);}@Testvoid testDeleteById() {userMapper.deleteById(5);}}

二、MyBatisPlus常用注解

MyBatisPlus:通过扫描实体类,并基于反射获取实体类信息作为数据库表信息。

  • 类名驼峰转下划线作为表名
  • 名为id的字段作为主键
  • 变量名驼峰转下划线作为表的字段名

2.1 MyBatisPlus常用注解如下

  • @TableName:用来指定表名
  • @TableId:用来指定表中的主键字段信息
  • @TableFiled:用来指定表中的普通字段信息

MyBatisPlus官网:https://www.baomidou.com/pages/223848/#tablename


在这里插入图片描述


在这里插入图片描述


在这里插入图片描述


在这里插入图片描述


三、MyBatisPlus常用配置

MyBatisPlus中的配置大都是默认配置好的,我们使用的时候基本不用修改大量的配置,除非遇到特殊的情况需要设置一些配置,可以参考MyBatisPlus的官方文档进行修改。

mybatis-plus:type-aliases-package: com.demo.pomapper-locations: classpath*:mapper/**/*.xml  # 默认global-config:db-config:id-type: auto # id类型自增长

在这里插入图片描述


在这里插入图片描述


在这里插入图片描述


http://www.hkea.cn/news/407358/

相关文章:

  • 做外贸的b2b网站域名批量查询系统
  • 建设网站需要哪些职位网站建设策划书
  • 苏州网站建设哪里好网站点击排名优化
  • 网站建设收费标准策划百度推广关键词越多越好吗
  • 网站怎么做更新吗如何建立网页
  • 国外建设工程招聘信息网站tool站长工具
  • 专业做相册书的网站电商网站建设制作
  • 银川网站开发公司电话东莞网
  • 环境保护局网站管理制度建设百度指数的主要功能有
  • 安装wordpress提示500错误关键词优化的策略有哪些
  • 企业网站建设公司排名深圳高端seo公司助力企业
  • 做网站套餐网站seo
  • 网站上的代码网页怎么做的下载百度软件
  • 网站功能模块建设搜狗推广
  • 网站做推广有用吗网站页面设计
  • 做简报的网站广州搜发网络科技有限公司
  • 南乐县住房和城乡建设局网站制作网站的步骤是什么
  • 金华做网站最专业的公司搜易网提供的技术服务
  • wordpress适合门户网站吗怎么营销自己的产品
  • 常用的网站类型有哪些seo优化专员编辑
  • 网站专题框架怎么做海阳seo排名
  • 手机网站代码下载黄页网站推广服务
  • 做网站前端多少钱在线bt种子
  • wordpress+模版+推荐专业网站seo推广
  • 浦项建设公司员工网站2023免费推广入口
  • 如何查询某个网站的设计公司最新推广注册app拿佣金
  • 八宝山做网站公司打广告
  • wordpress vip查看插件南宁seo费用服务
  • 建站之星模板怎么设置手机如何做网站
  • 上海公司网站制作价格西安百度关键词排名服务