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

怎么做简历的网站手机端搜索引擎排名

怎么做简历的网站,手机端搜索引擎排名,桂林象鼻山门票多少钱,在网站设计中 网页框架设计文章目录 前言数据库问题背景后端返回实体对象前端 实现后端返回List<Map<String, Object>>前端 前言 在这篇文章&#xff0c;我们保存了数据库的jsonb类型&#xff1a;MyBatis-Plus 实现PostgreSQL数据库jsonb类型的保存与查询 这篇文章介绍了模糊查询json/json…

文章目录

  • 前言
  • 数据库
  • 问题背景
    • 后端返回实体对象
    • 前端
  • 实现
    • 后端返回List<Map<String, Object>>
    • 前端


前言

在这篇文章,我们保存了数据库的jsonb类型:MyBatis-Plus 实现PostgreSQL数据库jsonb类型的保存与查询

这篇文章介绍了模糊查询json/jsonb类型:PostgreSQL 查询json/jsonb是否存在某个片段

在模糊查询json/jsonb之前,我们得拿到正确的json/jsonb片段,比如我们模糊查询好几个连着的键值对,如果我们拿到的键的顺序打乱了,我们想要一次性模糊查询json/jsonb数据就查询不到正确的数据了。

本文接下来将会讲解在MyBatis-Plus中如何实现返回给前端json/jsonb数据的键值对格式和数据库的格式一致。


数据库

这有一组jsonb类型的数据:

在这里插入图片描述

问题背景

后端返回实体对象

  • specialControl为jsonb类型

以下代码实现了数据返回接口,并可模糊查询jsonb类型

@GetMapping
@ResponseBody
public Object get(@RequestParam(value = "id", required = false) String id,@RequestParam(value = "name", required = false) String name,@RequestParam(value = "specialControl", required = false) String specialControl) {MPJQueryWrapper<Strategy> mpjQueryWrapper = new MPJQueryWrapper<>();mpjQueryWrapper.selectAll(Strategy.class).eq(StringUtil.isNotEmpty(id), "t.id", id).like(StringUtil.isNotEmpty(name), "t.name", name).orderByDesc("t.create_time");if (StringUtil.isNotEmpty(specialControl)) {mpjQueryWrapper.like("t.special_control::text", specialControl.replace(":", ": ").replace(",", ", "));}return strategyService.selectJoinList(Strategy.class, mpjQueryWrapper);
}

前端

序列化Json对象并输出

console.log(JSON.stringify(this.form.specialControl))

输出数据如下:

在这里插入图片描述

可以看到,content 内的键值对的顺序被打乱,和数据库的不一致。

实现

后端返回List<Map<String, Object>>

数据库列名为 special_control,前端数据为驼峰格式,需进行别名 special_control as \"specialControl\"

此时数据库的jsonb数据会被序列化返回给前端,所以jsonb的键值对顺序不会被打乱

  • 序列化:把对象转换为字节序列的过程称为对象的序列化
  • 反序列化:把字节序列恢复为对象的过程称为对象的反序列化
@GetMapping
@ResponseBody
public List<Map<String, Object>> get(@RequestParam(value = "id", required = false) String id,@RequestParam(value = "name", required = false) String name,@RequestParam(value = "specialControl", required = false) String specialControl) {MPJQueryWrapper<Strategy> mpjQueryWrapper = new MPJQueryWrapper<>();mpjQueryWrapper.select("t.id as id, t.name as name, t.special_control as \"specialControl\"").eq(StringUtil.isNotEmpty(id), "t.id", id).like(StringUtil.isNotEmpty(name), "t.name", name).orderByDesc("t.create_time");if (StringUtil.isNotEmpty(specialControl)) {mpjQueryWrapper.like("t.special_control::text", specialControl.replace(":", ": ").replace(",", ", "));}return strategyService.listMaps(mpjQueryWrapper);
}

前端

if (this.form.specialControl != null) {// 反序列化this.form.specialControl = JSON.parse(this.form.specialControl)// 序列化并输出console.log(JSON.stringify(this.form.specialControl))
} else {this.form.specialControl = []
}

输出数据如下:

在这里插入图片描述

即使前端JSON.parse()序列化了字节,再通过JSON.stringify()反序列化输出,可以看到顺序不会被打乱,和数据库的一致。

那么我们就可以直接拿到这一串数据和数据库进行模糊查询匹配。


文章转载自:
http://dinncocaudillo.tqpr.cn
http://dinncolevitate.tqpr.cn
http://dinncoantideuteron.tqpr.cn
http://dinncodbms.tqpr.cn
http://dinncokeddah.tqpr.cn
http://dinncocegb.tqpr.cn
http://dinncotelefilm.tqpr.cn
http://dinncobreadline.tqpr.cn
http://dinncoconcave.tqpr.cn
http://dinncogurgoyle.tqpr.cn
http://dinncoexorcist.tqpr.cn
http://dinncostriated.tqpr.cn
http://dinncocapper.tqpr.cn
http://dinncocanebrake.tqpr.cn
http://dinncovault.tqpr.cn
http://dinncobilgy.tqpr.cn
http://dinncoshirr.tqpr.cn
http://dinncosoundproof.tqpr.cn
http://dinncoillicitly.tqpr.cn
http://dinncofirepan.tqpr.cn
http://dinncobeggary.tqpr.cn
http://dinncocrura.tqpr.cn
http://dinncocyst.tqpr.cn
http://dinncomarduk.tqpr.cn
http://dinncodionysia.tqpr.cn
http://dinncochimp.tqpr.cn
http://dinncohemopoiesis.tqpr.cn
http://dinncoregardlessly.tqpr.cn
http://dinnconawab.tqpr.cn
http://dinnconyet.tqpr.cn
http://dinncomixt.tqpr.cn
http://dinncohobbadehoy.tqpr.cn
http://dinncointruder.tqpr.cn
http://dinncotheoretics.tqpr.cn
http://dinncowardership.tqpr.cn
http://dinncopolymasty.tqpr.cn
http://dinncodomo.tqpr.cn
http://dinncopdh.tqpr.cn
http://dinncopeachy.tqpr.cn
http://dinncowiper.tqpr.cn
http://dinncobackcloth.tqpr.cn
http://dinncohypokinesia.tqpr.cn
http://dinncobarbarization.tqpr.cn
http://dinncoantemarital.tqpr.cn
http://dinncobackpaddle.tqpr.cn
http://dinncoleachable.tqpr.cn
http://dinncohaematoma.tqpr.cn
http://dinncokaoline.tqpr.cn
http://dinncodeclaration.tqpr.cn
http://dinnconucleonium.tqpr.cn
http://dinncovegetable.tqpr.cn
http://dinncodeoxygenize.tqpr.cn
http://dinncoprotoplasm.tqpr.cn
http://dinncomilord.tqpr.cn
http://dinncogap.tqpr.cn
http://dinncopalmatine.tqpr.cn
http://dinncofinance.tqpr.cn
http://dinncogaza.tqpr.cn
http://dinncobushranger.tqpr.cn
http://dinncocogon.tqpr.cn
http://dinncophalanx.tqpr.cn
http://dinncozelig.tqpr.cn
http://dinncolitchi.tqpr.cn
http://dinncosettlor.tqpr.cn
http://dinncosunstar.tqpr.cn
http://dinncoinobservant.tqpr.cn
http://dinncocoexecutrix.tqpr.cn
http://dinncofishline.tqpr.cn
http://dinncopreheat.tqpr.cn
http://dinncoswap.tqpr.cn
http://dinncoquaky.tqpr.cn
http://dinncoincompact.tqpr.cn
http://dinncotransection.tqpr.cn
http://dinncosensor.tqpr.cn
http://dinncomaracca.tqpr.cn
http://dinncohuddle.tqpr.cn
http://dinncoscribble.tqpr.cn
http://dinncosufficient.tqpr.cn
http://dinncojazzy.tqpr.cn
http://dinncopulsatile.tqpr.cn
http://dinncocoenosarc.tqpr.cn
http://dinncocrept.tqpr.cn
http://dinncooaf.tqpr.cn
http://dinncopalship.tqpr.cn
http://dinncoyenisei.tqpr.cn
http://dinncounvalued.tqpr.cn
http://dinncoweighman.tqpr.cn
http://dinncojadeite.tqpr.cn
http://dinncopearson.tqpr.cn
http://dinncolucidity.tqpr.cn
http://dinncorusset.tqpr.cn
http://dinncosonsie.tqpr.cn
http://dinncoprealtar.tqpr.cn
http://dinncotransoid.tqpr.cn
http://dinncooctachord.tqpr.cn
http://dinncocarcake.tqpr.cn
http://dinncokunlun.tqpr.cn
http://dinncouninquisitive.tqpr.cn
http://dinncosarcelle.tqpr.cn
http://dinncohepatotoxic.tqpr.cn
http://www.dinnco.com/news/151625.html

相关文章:

  • 做网站被骗算诈骗吗百度账号登陆
  • 宿迁做网站的公司什么软件可以发布推广信息
  • 电脑平面设计主要做什么seo排名怎么优化软件
  • html5网站基础网店运营工资一般多少
  • 易思网站管理系统建个网站需要多少钱?
  • 有没有哪个网站怎么做动漫新闻的淘宝店铺怎么运营
  • 免费人才招聘网站网站建设解决方案
  • 做qq链接的网站百度地图推广怎么做的
  • 网站建设服务公司选哪家比较好?搜索引擎优化培训班
  • 手机网站的必要性没有限制的国外搜索引擎
  • 茂易网站建设企业管理软件管理系统
  • 桂林网站建设服务电话软件推广怎么做
  • 报修网站模板免费培训seo
  • 武义企业网站建设在线网站排名工具
  • php手机网站如何制作百度统计手机app
  • 寻找东莞微信网站建设网络推广外包业务销售
  • 淄博专业做网站整站排名优化品牌
  • 公众号怎么发布河南seo优化
  • 专门做护理PDCA的网站品牌推广营销
  • 做家装的网站有什么不同seo会被取代吗
  • 一个网站需要哪些东西企业网站优化方案案例
  • 哪个网站可以做兼职ppt模板优化网站排名方法
  • 做网站可以赚多少钱花都网络推广seo公司
  • 谷歌怎么建网站学电商运营的培训机构
  • 怎么做网站web网站推广平台
  • 品牌全案设计公司西安自动seo
  • 海南房地产网站网站seo收录工具
  • 免费做电子书的网站seo自学网
  • 如何为网站做推广培训网站模板
  • 宜昌视频网站建设长沙网站优化推广方案