当前位置:网站首页>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>
边栏推荐
- The "boss management manual" that is wildly spread all over the network (turn)
- Measurement fitting based on Halcon learning -- Practice [1]
- Great gods, I want to send two broadcast streams: 1. Load basic data from MySQL and 2. Load changes in basic data from Kafka
- Leetcode daily question 540 A single element in an ordered array Valentine's Day special article looking for a single dog in a pile of lovers ~ the clown is myself
- Volley source code analysis
- Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
- Yyds dry goods inventory TCP & UDP
- 抓包整理外篇——————autoResponder、composer 、statistics [ 三]
- Basic number theory -- Chinese remainder theorem
- Discussion Net legacy application transformation
猜你喜欢

Interval product of zhinai sauce (prefix product + inverse element)

TiDB 之 TiCDC6.0 初体验

Discussion Net legacy application transformation

(5) Web security | penetration testing | network security operating system database third-party security, with basic use of nmap and masscan

Scientific research document management Zotero

MySQL——索引

Etcd 基于Raft的一致性保证

Tidb's initial experience of ticdc6.0

Operate BOM objects (key)

Xai+ network security? Brandon University and others' latest "interpretable artificial intelligence in network security applications" overview, 33 page PDF describes its current situation, challenges,
随机推荐
MySQL - index
Memory analyzer (MAT)
Notes on MySQL related knowledge points (startup, index)
The post-90s resigned and started a business, saying they would kill cloud database
Analyse de REF nerf
2022-02-15 Daily: 2022 AAAI fellow release
XAI+网络安全?布兰登大学等最新《可解释人工智能在网络安全应用》综述,33页pdf阐述其现状、挑战、开放问题和未来方向
JVM JNI and PVM pybind11 mass data transmission and optimization
仿网易云音乐小程序
Is it OK for fresh students to change careers to do software testing? The senior answered with his own experience
Set, weakset, map, weakmap in ES6
What is the maximum number of concurrent TCP connections for a server? 65535?
淺析 Ref-NeRF
Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
Last week's content review
No more! Technical team members resign collectively
Memory analyzer (MAT)
MySQL -- standardize database design
Use nodejs+express+mongodb to complete the data persistence project (with modified source code)
Inventory 2021 | yunyuansheng embracing the road