当前位置:网站首页>常用sql集合
常用sql集合
2022-07-03 21:18:00 【捕風捉影】
@valid 校验方式:
如果你是 springboot 项目,那么可以不用引入了,已经引入了,他就存在于最核心的 web 开发包里面。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
如果你不是 springboot 项目,那么引入下面依赖即可:
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.4.1.Final</version>
</dependency>
在实体类之间进行引入注解
/** 姓名 */
@NotBlank(message = "请输入名称")
@Length(message = "名称不能超过个 {max} 字符", max = 10)
public String name;
/** 年龄 */
@NotNull(message = "请输入年龄")
@Range(message = "年龄范围为 {min} 到 {max} 之间", min = 1, max = 100)
public Integer age;

异常信息:
迷糊查询加上foreach批量操作:
<select id="searchPrivate" resultType="">
select *
from customer c LEFT JOIN base_user bu ON c.cur_uid = bu.id AND bu.status = 1
<where>
c.del_flag = 0
<if test="param.cusName != null and param.cusName != ''">
and c.cus_name like concat('%',#{
param.cusName},'%')
</if>
<if test="param.cusId != null and param.cusId != ''">
and c.cus_id = #{
param.cusId}
</if>
<if test="param.intentElecStart != null">
and <![CDATA[ c.intent_elec >= #{
param.intentElecStart} ]]>
</if>
<if test="param.intentElecEnd != null">
and <![CDATA[ c.intent_elec <= #{
param.intentElecEnd} ]]>
</if>
<if test="param.cusType != null">
and c.cus_type = #{
param.cusType}
</if>
<if test="null != param.userIdList and param.userIdList.size() > 0">
and c.cur_uid in (
<foreach collection="param.userIdList" item="item" separator=",">
#{
item}
</foreach>
)
</if>
<if test="null != param.cusIds and param.cusIds.size() > 0">
or c.cus_id in (
<foreach collection="param.cusIds" item="item" separator=",">
#{
item}
</foreach>
)
</if>
</where>
order by c.update_time desc
</select>
边栏推荐
- 90 後,辭職創業,說要卷死雲數據庫
- MySQL——idea连接MySQL
- Tidb's initial experience of ticdc6.0
- Is flush account opening and registration safe and reliable? Is there any risk?
- MySQL - idea connects to MySQL
- Talk about daily newspaper design - how to write a daily newspaper and what is the use of a daily newspaper?
- MySQL - SQL injection problem
- Memory analyzer (MAT)
- Reinforcement learning - learning notes 1 | basic concepts
- 强化學習-學習筆記1 | 基礎概念
猜你喜欢
![抓包整理外篇——————autoResponder、composer 、statistics [ 三]](/img/bf/ac3ba04c48e80b2d4f9c13894a4984.png)
抓包整理外篇——————autoResponder、composer 、statistics [ 三]
![[secretly kill little buddy pytorch20 days -day02- example of image data modeling process]](/img/14/8ab1f1fb142e10dead124851180d03.jpg)
[secretly kill little buddy pytorch20 days -day02- example of image data modeling process]

Day 9 HomeWrok-ClassHierarchyAnalysis

一台服务器最大并发 tcp 连接数多少?65535?

Nmap and masscan have their own advantages and disadvantages. The basic commands are often mixed to increase output

TiDB 之 TiCDC6.0 初体验

Single page application architecture

Selenium has three waiting methods (forced waiting, implicit waiting, and display waiting)

MySQL - index

MySQL——索引
随机推荐
Do you really know how old you are?
Apprentissage intensif - notes d'apprentissage 1 | concepts de base
90 后,辞职创业,说要卷死云数据库
Hcie security Day10: six experiments to understand VRRP and reliability
Summary of common operation and maintenance commands
2022 low voltage electrician examination and low voltage electrician simulation examination question bank
Last week's content review
Baohong industry | good habits that Internet finance needs to develop
UI automation test: selenium+po mode +pytest+allure integration
No matter how hot the metauniverse is, it cannot be separated from data
"Designer universe" argument: Data Optimization in the design field ultimately falls on cost, safety and health | chinabrand.com org
如临现场的视觉感染力,NBA决赛直播还能这样看?
Sort out several network request methods of JS -- get rid of callback hell
Capture de paquets et tri du contenu externe - - autoresponder, composer, statistiques [3]
[vulnhub shooting range] impulse: lupinone
Gee calculated area
内存分析器 (MAT)
JVM JNI and PVM pybind11 mass data transmission and optimization
Transformer structure analysis and the principle of blocks in it
jvm jni 及 pvm pybind11 大批量数据传输及优化