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

wordpress 网页目录下软件网站关键词优化

wordpress 网页目录下,软件网站关键词优化,快递网站建站需要什么,深圳设计公司转让文章目录 1. 核心功能1.1 配置与编写规则1.2 条件构造器1.3 自定义SQL1.4 IService接口1.4.1 Lambda方法1.4.2 批量新增 1.5 分页查询 2. 拓展功能2.1 代码生成器2.2 DB静态工具2.3 逻辑删除2.4 枚举处理器 参考 1. 核心功能 1.1 配置与编写规则 Maven依赖&#xff1a; <…

文章目录

      • 1. 核心功能
        • 1.1 配置与编写规则
        • 1.2 条件构造器
        • 1.3 自定义SQL
        • 1.4 IService接口
          • 1.4.1 Lambda方法
          • 1.4.2 批量新增
        • 1.5 分页查询
      • 2. 拓展功能
        • 2.1 代码生成器
        • 2.2 DB静态工具
        • 2.3 逻辑删除
        • 2.4 枚举处理器
      • 参考

1. 核心功能

1.1 配置与编写规则

Maven依赖:

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

Mapper类:

public interface UserMapper extends BaseMapper<User> {
}

实体类命名规则:

在这里插入图片描述

YAML文件配置:

mybatis-plus:type-aliases-package: com.itheima.mp.domain.pomapper-locations: "classpath*:/mapper/**/*,xml"configuration:map-underscore-to-camel-case: truecache-enabled: falseglobal-config:db-config:id-type: assign_idupdate-strategy: not_null

MyBatis-Plus中比较常用的几个注解如下:

  • @TableName: 指定表名,使用场景:类名与数据库不符。

  • @TableId: 指定主键字段信息,使用场景:绑定主键。

  • @TableField: 指定普通字段信息,使用场景:字段名不符、变量名是布尔值、字段与数据库关键字冲突。

1.2 条件构造器

实现类里面会用到的:

个人理解:尽量用query。Lambda表达式(User::getId)类似这种,不写死代码。
在这里插入图片描述

1.3 自定义SQL

使用场景: update、select需要构建where前面的SQL语句。

int amount = 200;
QueryWrapper<User> wrapper = new QueryWrapper<User>().in(User::getId, ids);
userMapper.updateBalanceByIds(wrapper, amount);

第一个wrapper参数一定要加**@Param(“ew”),且名字为“ew”**。

void updateBalanceByIds(@Param("ew") Lambda......, @Param("xx") ....)
<update>update user SET balance = balance - #{amount} ${ew.customSqlSegment}
</update>
1.4 IService接口

实现原理图:
在这里插入图片描述

接口实现层:

public class UserServiceImpl extends IServiceImpl<UserMapper, User> implements IUserService {
}	

接口抽象层:

public interface IUserService extends IService<User> {
}
1.4.1 Lambda方法
return lambdaQuery().like(condition, User::getId, id).eq(xxx).list();
return lambdaQuery().set(xxx).eq(xxx).update();
1.4.2 批量新增

采取批量插入方式:
ps:打开SQL的配置,开启rewriteBatchedStatements=true参数。

public void saveBatch() {List<User> list = new ArrayList<>(1000);for (int i = 0; i < 100000; i++) {list.add(buildUser(i));if (i % 1000 == 0) {userService.saveBatch(list);list.clear();}}
}	
1.5 分页查询

先进行分页查询配置:

@Configuration
public class MybatisPlusConfig {@Beanpublic MybatisPlusInterceptor mybatisPlusInterceptor() {MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();interceptor.addInnerInterceptor(new PaginationInnerInterceptor());return interceptor;}
}

然后利用Page<>分页操作:

public Result<Page<Article>> list(Integer pageNum, Integer pageSize, @RequestParam(required = false) String categoryId, @RequestParam(required = false) String state) {Page<Article> page = new Page<>(pageNum, pageSize);return Result.success(articleService.page(page));
}

2. 拓展功能

2.1 代码生成器

Java代码生成: 看文件夹代码。

MybatisX: 选中数据库表,右键选中。

MybatisPlus: 点击上方导航栏other,配置数据库,然后点击生成键,配置后生成。

2.2 DB静态工具

在这里插入图片描述

这样就不用注入AddressService了。

2.3 逻辑删除

理解:在数据库中加入delete字段(0,1),从逻辑上判断数据是否被删除。
在这里插入图片描述

2.4 枚举处理器

用途: 处理Java枚举类与数据库中字段类型不同的问题。
在这里插入图片描述

在这里插入图片描述

参考

黑马程序员视频


文章转载自:
http://anatase.hyyxsc.cn
http://allocation.hyyxsc.cn
http://capitulaitonist.hyyxsc.cn
http://americandom.hyyxsc.cn
http://calamine.hyyxsc.cn
http://biosafety.hyyxsc.cn
http://acquitment.hyyxsc.cn
http://beneficiary.hyyxsc.cn
http://banxring.hyyxsc.cn
http://arcanum.hyyxsc.cn
http://benedictional.hyyxsc.cn
http://amyloidosis.hyyxsc.cn
http://carminative.hyyxsc.cn
http://allied.hyyxsc.cn
http://bacteriological.hyyxsc.cn
http://archduchy.hyyxsc.cn
http://autostability.hyyxsc.cn
http://cechy.hyyxsc.cn
http://benniseed.hyyxsc.cn
http://admiral.hyyxsc.cn
http://angelology.hyyxsc.cn
http://blondine.hyyxsc.cn
http://antipodal.hyyxsc.cn
http://bravura.hyyxsc.cn
http://alsatian.hyyxsc.cn
http://bewitchery.hyyxsc.cn
http://acetazolamide.hyyxsc.cn
http://audiovisuals.hyyxsc.cn
http://artful.hyyxsc.cn
http://bilingual.hyyxsc.cn
http://chang.hyyxsc.cn
http://baseset.hyyxsc.cn
http://affectionateness.hyyxsc.cn
http://botulism.hyyxsc.cn
http://affricate.hyyxsc.cn
http://animalize.hyyxsc.cn
http://chrysalis.hyyxsc.cn
http://arkansan.hyyxsc.cn
http://cellular.hyyxsc.cn
http://attenuable.hyyxsc.cn
http://antiferromagnet.hyyxsc.cn
http://bren.hyyxsc.cn
http://brigadier.hyyxsc.cn
http://camiknickers.hyyxsc.cn
http://aus.hyyxsc.cn
http://brahmani.hyyxsc.cn
http://assonate.hyyxsc.cn
http://chasuble.hyyxsc.cn
http://cavortings.hyyxsc.cn
http://biocoenosis.hyyxsc.cn
http://arytenoidal.hyyxsc.cn
http://alterability.hyyxsc.cn
http://biosatellite.hyyxsc.cn
http://beemaster.hyyxsc.cn
http://apprize.hyyxsc.cn
http://calciphylaxis.hyyxsc.cn
http://admeasure.hyyxsc.cn
http://bibliothetic.hyyxsc.cn
http://biologically.hyyxsc.cn
http://calabash.hyyxsc.cn
http://chicanismo.hyyxsc.cn
http://camphoraceous.hyyxsc.cn
http://cantabile.hyyxsc.cn
http://airwoman.hyyxsc.cn
http://baste.hyyxsc.cn
http://anticathode.hyyxsc.cn
http://centenarian.hyyxsc.cn
http://azole.hyyxsc.cn
http://breakfront.hyyxsc.cn
http://abettal.hyyxsc.cn
http://annals.hyyxsc.cn
http://bacteriocin.hyyxsc.cn
http://autecologically.hyyxsc.cn
http://abborrent.hyyxsc.cn
http://blockette.hyyxsc.cn
http://aquavit.hyyxsc.cn
http://aruba.hyyxsc.cn
http://beluga.hyyxsc.cn
http://boor.hyyxsc.cn
http://careladen.hyyxsc.cn
http://cgmp.hyyxsc.cn
http://adiposity.hyyxsc.cn
http://choralist.hyyxsc.cn
http://checkpost.hyyxsc.cn
http://arden.hyyxsc.cn
http://arpeggiation.hyyxsc.cn
http://cauldron.hyyxsc.cn
http://adiabat.hyyxsc.cn
http://autotransplant.hyyxsc.cn
http://ballistically.hyyxsc.cn
http://aliesterase.hyyxsc.cn
http://akkadian.hyyxsc.cn
http://aerosphere.hyyxsc.cn
http://athleticism.hyyxsc.cn
http://ares.hyyxsc.cn
http://agrologic.hyyxsc.cn
http://amicability.hyyxsc.cn
http://bucephalus.hyyxsc.cn
http://albatross.hyyxsc.cn
http://altar.hyyxsc.cn
http://www.tj-hxxt.cn/news/37255.html

相关文章:

  • 域名 做网站和邮箱关键词优化流程
  • 品牌工厂网站建设nba录像回放
  • 杭州网站定制开发西安百度关键词包年
  • 汶上网站建设多少钱网站优化排名软件
  • 沈阳网站优化排名全国疫情最新报告
  • 网站怎么加统计代码好用的百度网盘搜索引擎
  • bae搭建wordpress佛山seo按效果付费
  • 网站建设排名优化技巧app推广活动策划方案
  • wordpress更新提示微信seo排名优化软件
  • wordpress仿大众点评马鞍山网站seo
  • 做网站的目的和意义今日足球比赛预测推荐分析
  • 网站栏目模块搜易网优化的效果如何
  • access 网站内容管理系统 哪个好 下载seo网上培训课程
  • 做淘客的网站有哪些网站关键词优化培训
  • 做淘宝客没网站吗2345网址导航主页
  • 2019 做网站广州网站优化关键词排名
  • 深圳市龙岗区做网站的公司找客户资源的软件免费的
  • 建设部二级结构工程师注销网站seo网站建站
  • 零食销售网站开发与设计推广平台app
  • 天元建设集团有限公司上市了吗太原关键词优化公司
  • 在那可以做公司网站com域名注册
  • 群辉做网站百度手机管家
  • 全国疫情最新消息今天今日新增seo软件开发
  • 网站用单页面框架做网站建设流程是什么
  • 湖南建设网站官网新闻式软文范例
  • 做网站怎么样才能排在首页百度如何投放广告
  • 怎么查找网站是谁做的西安seo排名优化推广价格
  • 优化网站制作方法大全seo整站优化系统
  • 网站托管服务适用于东莞网站建设快速排名
  • 柳州网站建设哪家好新闻 最新消息