当前位置:网站首页>常用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>
边栏推荐
- Etcd raft Based Consistency assurance
- Volley source code analysis
- JVM JNI and PVM pybind11 mass data transmission and optimization
- 鹏城杯 WEB_WP
- treevalue——Master Nested Data Like Tensor
- Single page application architecture
- UI automation test: selenium+po mode +pytest+allure integration
- MySQL——数据库备份
- Operate BOM objects (key)
- Link aggregation based on team mechanism
猜你喜欢

不同业务场景该如何选择缓存的读写策略?
![[Yugong series] go teaching course 002 go language environment installation in July 2022](/img/47/35b4fb0354122e233977b261ef405b.png)
[Yugong series] go teaching course 002 go language environment installation in July 2022

Day 9 HomeWrok-ClassHierarchyAnalysis

treevalue——Master Nested Data Like Tensor

Do you really know how old you are?
![Measurement fitting based on Halcon learning -- Practice [1]](/img/71/9f6c27aa89035b2550bdb0ac902045.jpg)
Measurement fitting based on Halcon learning -- Practice [1]

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

The post-90s resigned and started a business, saying they would kill cloud database

Discussion Net legacy application transformation
![Capture de paquets et tri du contenu externe - - autoresponder, composer, statistiques [3]](/img/bf/ac3ba04c48e80b2d4f9c13894a4984.png)
Capture de paquets et tri du contenu externe - - autoresponder, composer, statistiques [3]
随机推荐
The 12th Blue Bridge Cup
Basic preprocessing and data enhancement of image data
What is the maximum number of concurrent TCP connections for a server? 65535?
Pengcheng cup Web_ WP
@Scenario of transactional annotation invalidation
Getting started with postman -- built-in dynamic parameters, custom parameters and assertions
Is flush account opening and registration safe and reliable? Is there any risk?
Is it OK for fresh students to change careers to do software testing? The senior answered with his own experience
Advanced technology management - how to examine candidates in the interview and increase the entry probability
Refer to some books for the distinction between blocking, non blocking and synchronous asynchronous
XAI+网络安全?布兰登大学等最新《可解释人工智能在网络安全应用》综述,33页pdf阐述其现状、挑战、开放问题和未来方向
Advanced collaboration: coroutinecontext
Etcd 基于Raft的一致性保证
MySQL - database backup
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
Such as the visual appeal of the live broadcast of NBA Finals, can you still see it like this?
JVM JNI and PVM pybind11 mass data transmission and optimization
内存分析器 (MAT)
Preliminary understanding of C program design
[Tang Laoshi] C -- encapsulation: member variables and access modifiers