当前位置:网站首页>Common SQL sets
Common SQL sets
2022-07-03 21:19:00 【Catch clues】
@valid Verification method :
If you are springboot project , So you don't have to introduce , Has introduced , He exists at the core of web In the development package .
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
If you're not springboot project , Then introduce the following dependencies :
<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>
Introduce annotations between entity classes
/** full name */
@NotBlank(message = " Please enter name ")
@Length(message = " Names cannot exceed {max} character ", max = 10)
public String name;
/** Age */
@NotNull(message = " Please enter age ")
@Range(message = " The age range is {min} To {max} Between ", min = 1, max = 100)
public Integer age;

Abnormal information :
Confused query plus foreach The batch operation :
<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>
边栏推荐
- MySQL——JDBC
- Global and Chinese market of recycled yarn 2022-2028: Research Report on technology, participants, trends, market size and share
- Sort out several network request methods of JS -- get rid of callback hell
- treevalue——Master Nested Data Like Tensor
- Let me ask you a question. Have you ever used the asynchronous io of Flink SQL to associate dimension tables in MySQL? I set various settings according to the official website
- Kubernetes 通信异常网络故障 解决思路
- Gauss elimination solves linear equations (floating-point Gauss elimination template)
- Advanced technology management - how to examine candidates in the interview and increase the entry probability
- 抓包整理外篇——————autoResponder、composer 、statistics [ 三]
- Haven't expressed the artifact yet? Valentine's Day is coming. Please send her a special gift~
猜你喜欢

Pengcheng cup Web_ WP

TLS environment construction and plaintext analysis

2022 safety officer-c certificate examination and safety officer-c certificate registration examination

Après 90 ans, j'ai démissionné pour démarrer une entreprise et j'ai dit que j'allais détruire la base de données Cloud.
![抓包整理外篇——————autoResponder、composer 、statistics [ 三]](/img/bf/ac3ba04c48e80b2d4f9c13894a4984.png)
抓包整理外篇——————autoResponder、composer 、statistics [ 三]

APEC industry +: father of the king of the ox mill, industrial Internet "king of the ox mill anti-wear faction" Valentine's Day greetings | Asia Pacific Economic media | ChinaBrand

Design e-commerce seckill system

"Designer universe" APEC safety and health +: environmental protection Panda "xiaobaobao" Happy Valentine's Day 2022 | ChinaBrand | Asia Pacific Economic media

treevalue——Master Nested Data Like Tensor

2022 high voltage electrician examination and high voltage electrician reexamination examination
随机推荐
[secretly kill little buddy pytorch20 days -day02- example of image data modeling process]
TLS environment construction and plaintext analysis
Measurement fitting based on Halcon learning -- Practice [1]
APEC industry +: father of the king of the ox mill, industrial Internet "king of the ox mill anti-wear faction" Valentine's Day greetings | Asia Pacific Economic media | ChinaBrand
QFileDialog
全网都在疯传的《老板管理手册》(转)
Advanced collaboration: coroutinecontext
《ActBERT》百度&悉尼科技大学提出ActBERT,学习全局局部视频文本表示,在五个视频-文本任务中有效!...
Hcie security Day12: supplement the concept of packet filtering and security policy
Preliminary understanding of C program design
Volley source code analysis
Design e-commerce seckill system
Inventory 2021 | yunyuansheng embracing the road
For in, foreach, for of
Let me ask you a question. Have you ever used the asynchronous io of Flink SQL to associate dimension tables in MySQL? I set various settings according to the official website
MySQL——规范数据库设计
MySQL - database backup
17 websites for practicing automated testing. I'm sure you'll like them
@Transactional注解失效的场景
Nmap and masscan have their own advantages and disadvantages. The basic commands are often mixed to increase output