json 解析  分页  条件查询

从数据库中查询出来的json数据乱码可以使用

json_extract(json字段,'$') json字段  

这个是json数据的条件查询

<sql id="Base_Column_List">id, company_id, tenant_id, created_by, creator_id, created_at, updated_by, modifier_id, updated_at, dr,json_extract(prod_info_json,'$') prod_info_json</sql><select id="findList" resultMap="BaseResultMap">select<include refid="Base_Column_List"/>from pc_company_product_info_jsonwhere dr = 0 and company_id = #{param.companyId}<if test="param.registNo != null and param.registNo!=''">prod_info_json -> '$.registInfo.registNo' like concat('%',#{param.registNo},'%')</if><if test="param.productName != null and param.productName!=''">and prod_info_json -> '$.chName' like concat('%',#{param.productName},'%')</if><if test="param.bigType != null">and prod_info_json -> '$.bigType' like concat('%',#{param.bigType},'%')</if><if test="param.customCode != null and param.customCode!=''">and prod_info_json -> '$.code' like concat('%',#{param.customCode},'%')</if><if test="param.platCode != null and param.platCode!=''">and prod_info_json -> '$.platCode' like concat('%',#{param.platCode},'%')</if><if test="param.companyName != null and param.companyName!=''">and prod_info_json -> '$.manufacturerName' like concat('%',#{param.companyName},'%')</if><if test="param.hasRelatedBarcode != null and param.hasRelatedBarcode == 0">and prod_info_json -> '$.pcItemBarcodes' is null</if><if test="param.hasRelatedBarcode != null and param.hasRelatedBarcode == 1">and prod_info_json -> '$.pcItemBarcodes' is not null</if><if test="param.specification != null and param.specification != ''">and prod_info_json -> '$.spec' like concat('%',#{param.specification},'%')</if><if test="param.manageType != null ">and prod_info_json -> '$.manageType' like concat('%',#{param.manageType},'%')</if><if test="param.upEnterPriseId != null and param.upEnterPriseId != '' ">and prod_info_json -> '$.upEnterPriseId' like concat('%',#{param.upEnterPriseId},'%')</if>order by created_at desc</select>

数据库中的表

分页

json数据条件查询,json数据sql查询中文乱码相关推荐

  1. 预编译sql查询语句_频繁查询重新编译– SQL查询性能杀手–检测

    预编译sql查询语句 previous part of this article, we presented query recompilation basics. We explained when ...

  2. MySQL导入sql脚本中文乱码设置和常用命令

    MySQL导入sql脚本中文乱码设置和常用命令 1. use database_name;  2. set names utf8; (或其他需要的编码)  3. source example.sql ...

  3. sql空字符串判断函数_Excel数据还可这样来查询:用SQL查询输出工作表指定区域更高效!...

    对于数据库编程的朋友而言,SQL结构化查询技术并不陌生,也非常好用,凭借SQL强大的功能可以有效实现对数据库的数据表数据的"增.删.改.查"操作.一般而言,比较高级的语言环境,例如 ...

  4. oracle查数据存入数组,如何在SQL查询中使用Oracle关联数组

    ODP.Net公开了将关联数组作为参数从C#传递到Oracle存储过程的能力.除非您尝试在sql查询中使用该关联数组中包含的数据,否则它是一个很好的功能. 原因是它需要上下文切换 – SQL语句需要S ...

  5. php多条件检索怎么写,sql查询同时满足三个条件 php查询数据库,同时满足三个条件的sql怎么写?...

    php查询数据库,同时满足三个条件的sql怎么写? 这样写没有问题的,是不是你传参数错了,输出语句看看$sql="SELECT*FROM表名字WHERE字段1=aand字段2=b" ...

  6. sql \n 查询_探索SQL查询提示选项(快速N)

    sql \n 查询 In this article, we will introduce SQL queries hint and will analyze the OPTION(Fast 'N') ...

  7. 【sql查询】使用sql查询一个物品是否在有效期内的方法(数据库无这个字段 通过生产日期和保质期进行计算得出)

    sql有效期查询 和筛选的方式 事件起因 问题描述: sql给后端提供数据 实际应用场景 针对上述sql缺点进行的一点改进 事件起因 今天在写一个查询一个产品的使用期限的时候遇到这个问题,物品的使用期 ...

  8. 预编译sql查询语句_频繁的查询重新编译– SQL查询性能的杀手–简介

    预编译sql查询语句 In this article, we will explain what compilations and recompilations are, and give recom ...

  9. oracle中导出查询结果,Oracle SQL 查询结果导出到文本或Excel文件方法

    (MEMO:利用spool缓冲池技术) 具体步骤如下: 1.在Oracle PL/SQL中输入缓冲开始命令,并指定输出的文件路径和文件名 spool d:\output.txt 2.在命令中输入相应的 ...

  10. 软件测试查询语句例题,SQL查询经典例题 - 青苹果测试博客 - 51Testing软件测试网 51Testing软件测试网-软件测试人的精神家园...

    通过以下习题的练习,我们能快速熟悉掌握sql语句查询的语法和要领,大家要用心领会其中的要领和步骤,要学会分析步骤. 一.单表查询练习 1.查询,查询学生"张三"的全部基本信息 Se ...

最新文章

  1. 有道智能学习灯 初体验
  2. 亚马逊DynamoDB
  3. std::map的insert和下标[]访问
  4. 保险条款精解(二) 丢车——如何将损失降到最低点?
  5. React+Webpack+Eslint+Babel构建React脚手架
  6. 手机屏幕坏了如何把手机里面的资料取出来_手机碎屏原来也有这么多讲究,早了解这几个方法就不会被坑了...
  7. Web前端求职必备 常见前端面试题汇总(二)
  8. 凭据分配没有加密oracle_远程连接身份验证错误,又找不到加密Oracle修正
  9. 合并账号_亚马逊账号最新死法:合并listing和折扣促销
  10. unicode编码对照表
  11. 设为首页 加入收藏代码
  12. Kafka踩坑 - Couldn't find leaders for Set
  13. python 抖音短视频 去水印_如何去除抖音快手等短视频平台的水印?(工具+原理)...
  14. 笔记本计算机在桌面显示器,笔记本连接显示器
  15. curl调用新版jenkins crumb报错 No valid crumb was included in the request 解决方法
  16. Ceph常见问题处理(octopus 15.2.13)
  17. python编程比赛初赛 组成最小罗马数字_leetcode 题解 12python3@ 通过使用罗马数字的最单元位来构造数组 + 构造数字算法...
  18. 浮点数与IEEE754
  19. 付费系列 2 - 美式和百慕大期权 PDE 有限差分
  20. 如何激活移动物联网卡

热门文章

  1. Kickstarter | 海外项目汇总
  2. android圆形进度条
  3. 当华为云WeLink遇上P40,多屏协同全场景办公有多神奇?
  4. 废品站老板切割金属罐体时发生爆炸致死
  5. 针对部分16系显卡通过VS2017编译的YOLOV3测试成功但图像无检测框的问题:
  6. 基于逆向工程的内存真值检查来保卫网络物理系统
  7. 7-14 输出大写英文字母 (15分) 瞎搞
  8. 使用openssl将pfx格式证书转换成key和crt
  9. 中国教育“善意的谎言”与恶果
  10. python自动化办公:excel篇,从此做表不加班。