MyBatis

mybatis 之批量模糊查询、foreach string[] 的用法

房东的猫 提交于 2021-01-07 08:04:03
List<Recipe> randomRecipe(@Param("str")String[] strs,@Param("num")int num); 功能:随机查询num个不含strs[]的的Recipe 注:str:["苹果","甘蓝"] num:5 <!-java www.fhadmin.org-!> <select id="randomRecipe" resultType="cn.jwm.onMK.po.Recipe"> select* from recipestable <where> mainmaterialname not like <foreach item="str" index="index" collection="str" open="(" separator="AND" close=")"> CONCAT('%',#{str},'%') </foreach> </where> order by rand() limit #{num} </select> DEBUG [http-nio-8080-exec-3] - ==> Preparing: select* from recipestable WHERE mainmaterialname not like ( CONCAT('%',?,'%') AND CONCAT('%',?,'%') ) order

Error querying database. Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

吃可爱长大的小学妹 提交于 2021-01-07 05:53:46
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 ### Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844) javax.servlet.http.HttpServlet.service

Java学习视频教程一网打尽

≯℡__Kan透↙ 提交于 2021-01-07 04:59:36
戳上面的蓝字可以关注我哦! 前言 对于自学Java的初学者来说,一定会非常希望有个大神带你一步一步由浅入深系统的学习Java知识,绕过所有的坑,那么跟着视频教程学肯定是最好的途径了。 本文汇总java开发中使用的优质视频教程,此外,本文还将持续汇总更新Java学习的各种视频教程, 有需要的同学可以关注公众号,或者转发至朋友圈收藏一下。 希望对你在学习Java的道路上有所帮助。 1 Java基础视频教程 本套视频可谓目前同类视频中代码量最大、案例最多、实战性最强的Java基础视频。本教程注重技术原理剖析,同时全程贯穿代码实战,用实践驱动理论,所有知识点的讲解都围绕实际案例展开,并配有相应的代码练习。 获取地址 链接:http://pan.baidu.com/s/1dFCK7uD 密码:nsjx 2 jQuery视频教程 jQuery是一个快速、简洁的JavaScript框架,是继Prototype之后又一个优秀的JavaScript代码库(或JavaScript框架)。jQuery设计的宗旨是“write Less,Do More”,即倡导写更少的代码,做更多的事情。它封装JavaScript常用的功能代码,提供一种简便的JavaScript设计模式,优化HTML文档操作、事件处理、动画设计和Ajax交互。 获取地址 链接:http://pan.baidu.com/s/1b6mYn0

mybatis 之批量模糊查询、foreach string[] 的用法

China☆狼群 提交于 2021-01-06 12:40:32
List<Recipe> randomRecipe( @Param( "str" ) String[] strs, @Param( "num" ) int num); 功能:随机查询num个不含strs[]的的Recipe 注:str:["苹果","甘蓝"] num:5 <!-java项目www.fhadmin.org-!> < select id = "randomRecipe" resultType = "cn.jwm.onMK.po.Recipe" > select * from recipestable < where > mainmaterialname not like < foreach item = "str" index = "index" collection = "str" open = "(" separator = "AND" close = ")" > CONCAT( '%' , #{str},'%') </ foreach > </ where > order by rand () limit # {num} </ select > DEBUG [http-nio-8080-exec-3] - ==> Preparing: select* from recipestable WHERE mainmaterialname not like (

JNPF快速开发平台-快速开发Web+APP项目的java开发平台

若如初见. 提交于 2021-01-06 10:44:56
JNPF快速开发平台 JNPF快速开发平台 采用前后端分离技术、采用B/S架构开发,形成一站式开发多端(APP+PC)使用。 JAVA版介绍 java版采用前后端分离,前端项目与后端项目是两个项目,需要独立部署,两个不同的工程,两个不同的代码库,前端通过 ajax 来调用 http 请求调用后端的 restful api。 JNPF架构体系 主体架构 JNPF快速开发平台采用前后端分离技术、采用B/S架构开发,形成一站式开发多端(APP+PC)使用, 实现统一的权限管理、灵活的接口调用、拖拽式流程搭建等操作,使用业界领先地位的研发技术体系。 JNPF开发环境 前端 Vue2.x;ElementUI;Axios;WebScoket; 后端 SpringBoot、SpringCloud、Mybatis、Maven、.NET Core3.1、Ocelot、EFCore、Nuget; 移动端 Android、IOS、微信小程序、混合应用、uniapp; 数据库 Oracle、SQLServer、MySQL; JNPF特点 拖拉、可视化设计表单 我们采用所见即所得的表单设计方式,通过简单的拖拽控件及数据绑定设置即可完成表单设计工作。因此,通过我们提供的表单设计器,您不需要专业的电脑知识,即可在几分钟内设计出非常专业的表单。设计出来的所有表单都是标准的表单,具有良好的互操作性和可扩展性

基于springboot2的开源OA办公系统

心已入冬 提交于 2021-01-06 01:10:42
Active4j-oa是基于 active4j-jsp 快速开发框架构建而来的OA办公系统。基于springboot2.0,以Spring Framework为核心容器,Spring MVC为模型视图控制器,Mybatis Plus为数据访问层, Apache Shiro为权限授权层, Redis为分布式缓存,Quartz为分布式集群调度,JSP作为前端页面引擎,采用JSTL标签库封装组件的开源框架。 项目介绍 Active4j-oa是基于 active4j-jsp 快速开发框架构建而来的OA办公系统。基于springboot2.0,以Spring Framework为核心容器,Spring MVC为模型视图控制器,Mybatis Plus为数据访问层, Apache Shiro为权限授权层, Redis为分布式缓存,Quartz为分布式集群调度,JSP作为前端页面引擎,采用JSTL标签库封装组件的开源框架。 Active4j-oa目前内置了绝大部分常见办公系统功能,包括系统管理,工作流管理,个人办公,人力资源管理,执行力管理等几大模块。开发者只需根据具体业务需求,稍加改进,就可以开发出一套完整的OA办公系统。 技术文档 讨论加群:qq群①:203802692 qq群②:773872959 演示地址: http://www.active4j.com:9005/oa 官方网站:

一条失去where的动态SQL导致的线上故障

泪湿孤枕 提交于 2021-01-05 22:18:33
关注公众号: 后端技术漫谈 ,技术之路不迷路~ 前言 好了,进入今天的正文,今天想跟大家聊聊一次 mybatis 动态 SQL 引发的生产事故。 事情这样的,我们有个订单相关数据库服务,专门负责订单相关的增删改查。这个服务运行了很久,一直都没有问题。 直到某天中午,正想躺下休息一下,就突然接到系统报警,大量订单创建失败。订单服务可以说是核心服务,这个服务不可用,整个流程都会被卡主,交易都将会失败。 马上没了睡意,立刻起来登上生产运维机,查看订单服务的系统日志。 Caused by: java.util.concurrent.RejectedExecutionException: Thread pool is EXHAUSTED! Thread Name: DubboServerHandler-xxip, Pool Size: 200 (active: 200, core: 200, max: 200, largest: 200), Task: 165633 (completed: 165433), Executor status:(isShutdown:false, isTerminated:false, isTerminating:false), in 1! at com.alibaba.dubbo.common.threadpool.support

idea 实现逆向工程(反向工程)

前提是你 提交于 2021-01-05 16:52:56
pom.xml 配置 在build里添加 1 <!-- 逆向工程 --> 2 < plugins > 3 < plugin > 4 < groupId > org.mybatis.generator </ groupId > 5 < artifactId > mybatis-generator-maven-plugin </ artifactId > 6 < version > 1.3.2 </ version > 7 < dependencies > 8 < dependency > 9 < groupId > mysql </ groupId > 10 < artifactId > mysql-connector-java </ artifactId > 11 < version > 5.1.22 </ version > 12 </ dependency > 13 </ dependencies > 14 < configuration > 15 <!-- 配置文件的路径 --> 16 < configurationFile > src/main/resources/generatorConfig.xml </ configurationFile > 17 < overwrite > true </ overwrite > 18 </ configuration > 19 <

Show SQL trace (Springboot+Mybatis)

非 Y 不嫁゛ 提交于 2021-01-05 06:42:23
问题 My project is built with Spring boot and Mybatis, I want to see the sql query statements, what can I do? 回答1: Assuming your mappers are in a package your.pkg.mapper , adding the following line to application.properties tells MyBatis to print statements, parameters and query results. logging.level.your.pkg.mapper=TRACE The below is the console output of the sample project. 2019-05-17 01:01:01.631 DEBUG 76540 --- [ main] s.m.mapper.CityMapper.selectCityById : ==> Preparing: select id, name,

Show SQL trace (Springboot+Mybatis)

不打扰是莪最后的温柔 提交于 2021-01-05 06:42:08
问题 My project is built with Spring boot and Mybatis, I want to see the sql query statements, what can I do? 回答1: Assuming your mappers are in a package your.pkg.mapper , adding the following line to application.properties tells MyBatis to print statements, parameters and query results. logging.level.your.pkg.mapper=TRACE The below is the console output of the sample project. 2019-05-17 01:01:01.631 DEBUG 76540 --- [ main] s.m.mapper.CityMapper.selectCityById : ==> Preparing: select id, name,