sql中筛选条件为空值
<select id="getEmployeeBasicInformationList" resultType="org.springblade.entity.AllEmployeeBasicInformation">
select a.*,b.* from blade_employee_basic_information a left join blade_user b on a.id=b.id where a.tenant_id=#{tenantId} and a.is_deleted=0
<if test="department !=null and department !='' ">
and a.department like '%%${department}%%'
</if>
<if test="realName !=null and realName !='' ">
and b.real_name like '%%${realName}%%'
</if>
<if test="entryDate !=null and entryDate !='' ">
and a.entry_date=#{entryDate}
</if>
<if test="dimissionType !=null and dimissionType !='' ">
and a.dimission_type=#{dimissionType}
</if>
<if test="lastWorkingDay !=null and lastWorkingDay !='' ">
and a.last_working_day=#{lastWorkingDay}
</if>
<if test="workingState !=null and workingState !='' ">
and a.working_state=#{workingState}
</if> <if test="isSing =='1'">
and (a.contract_start_date is not null) or a.contract_start_date!=''
</if>
<if test="isSing =='0'">
and a.contract_start_date is not null or ifnull(a.contract_start_date,'')=''
</if>
<if test="dateStartTime !=null and dateStartTime !='' ">
and a.contract_start_date >= {dateStartTime}
</if>
<if test="dateEndTime !=null and dateEndTime !='' ">
and a.contract_start_date <= {dateEndTime}
</if>
<if test="endDateStart !=null and endDateStart !='' ">
and a.contract_end_date >= {endDateStart}
</if>
<if test="endDateEnd !=null and endDateEnd !='' ">
and a.contract_end_date <= {endDateEnd}
</if>
order by a.id desc
process_instance_id is null or ifnull(process_instance_id,'')=''
select * from blade_process_should_pay_invoice
where is_deleted = 0
and process_instance_id is null or ifnull(process_instance_id,'')=''
and create_user = '1273086723649093633'
order by create_time desc
sql中筛选条件为空值的更多相关文章
- jqgrid 表格中筛选条件的多选下拉,树形下拉 ;文本框清除插件;高级查询多条件动态筛选插件[自主开发]
/** * @@desc 文本框清除按钮,如果isAutoWrap为false当前文本框父级必须是relative定位,boostrap参考input-group * @@author Bear.Ti ...
- 【SQL】SQL中on条件与where条件的区别
#前言 数据库在通过连接两张或多张表来返回记录时,都会生成一张中间的临时表,然后再将这张临时表返回给用户. 在使用left jion时,on和where条件的区别如下: 1.on条件是在生成临时表时 ...
- SQL中on条件与where条件的区别(转载)
数据库在通过连接两张或多张表来返回记录时,都会生成一张中间的临时表,然后再将这张临时表返回给用户. 在使用left jion时,on和where条件的区别如下: 1. on条件是在生成临时表时使用的条 ...
- SQL中多条件查询括号的用途
界面: 代码 0 posted @ 2009-12-15 13:28 唔愛吃蘋果 阅读(8640) 评论(0) 编辑 收藏
- SQL中on条件与where条件的区别
数据库在通过连接两张或多张表来返回记录时,都会生成一张中间的临时表,然后再将这张临时表返回给用户. 在使用left jion时,on和where条件的区别如下: 1.on条件是在生成临时表时使用 ...
- mybatis sql中的条件语句
1.mybatis判断是否为空或null <if test="type!=null and type!=''"> AND type = #{type} </if& ...
- sql通配符+sql中查询条件包含下划线等通配符的写法
一.SQL 通配符 在搜索数据库中的数据时,SQL 通配符可以替代一个或多个字符. SQL 通配符必须与 LIKE 运算符一起使用. 在 SQL 中,可使用以下通配符: 通配符 描述 % 替代一个或多 ...
- 二十五、sql中where条件在数据库中提取与应用浅析
问题描述 一条SQL,在数据库中是如何执行的呢?相信很多人都会对这个问题比较感兴趣.当然,要完整描述一条SQL在数据库中的生命周期,这是一个非常巨大的问题,涵盖了SQL的词法解析.语法解析.权限检查. ...
- SQL中的条件判断语句(case when zhen if,ifnull)用法
简介: case具有两种格式.简单case函数和case搜索函数.这两种方式,可以实现相同的功能.简单case函数的写法相对比较简洁,但是和case搜索函数相比,功能方面会有些限制,比如写判定式.还有 ...
随机推荐
- day8(使用celery异步发送短信)
1.1在celery_task/mian.py中添加发送短信函数 # celery项目中的所有导包地址, 都是以CELERY_BASE_DIR为基准设定. # 执行celery命令时, 也需要进入CE ...
- day4(JWT介绍)
1.JWT介绍 1.1jwt原理 最简单理解:jwt本质就是, 把用户信息通过加密后生成的一个字符串 JWT的原则是在服务器身份验证之后,将生成一个JSON对象并将其发送回用户 { "Use ...
- Kafak探究之路- 内部结构小结
1.框架与工作流 2 内部结构 kafka的每个主题分区的数据在 first-0(主题名-分区号)文件夹下,保存 n组xxx.log文件与xxx.index文件.log文件存发送消息的元数据,每个大小 ...
- Python正则表达式处理的组是什么?
在学习正则表达式处理开始阶段,对于匹配对象的group数据没有理解,查了资料进行验证测试,终于理解了. 组其实与组匹配模式相关,就是在匹配的正则表达式中使用小括号"()"括起来的任 ...
- secret_key伪造session来进行越权
从swpuctf里面的一道ctf题目来讲解secret_key伪造session来进行越权. 以前没有遇到过这种题目,这次遇到了之后查了一些资料把它做了出来,记录一下知识点. 参考资料 http:// ...
- Python3安装且环境配置(三)
1.在Window 平台安装 Python3 以下为在 Window 平台上安装 Python3 的简单步骤: 打开WEB浏览器访问http://www.python.org/download/ 在下 ...
- python-字典dict、去除重复set
dict Python内置了字典:dict的支持,dict全称dictionary,在其他语言中也称为map,使用键-值(key-value)存储,具有极快的查找速度. 举个例子,假设要根据同学的名字 ...
- bootstrap table 嵌入百分比进度条
- BJOI2016 IP地址
题目链接 Description 给定 \(n\) 个 \(01\) 模式串.\(q\) 次询问: 每次询问给定一个 \(01\) 串: 设给这个串匹配的串是在模式串中存在的他的最长前缀 问 \([a ...
- .net5+nacos+ocelot 配置中心和服务发现实现
最近一段时间 因公司业务需要,需要使用.net5做一套微服务的接口,使用nacos 做注册中心和配置中心,ocelot做网关. 因为ocelot 支持的是consol和eureka,如果使用nacos ...