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搜索函数相比,功能方面会有些限制,比如写判定式.还有 ...
随机推荐
- redis集群管理--sentinel
什么是sentinel? Sentinel(哨兵)是用于监控redis集群中Master状态的工具,是Redis 的高可用性解决方案,sentinel哨兵模式已经被集成在redis2.4之后的版本中. ...
- 2017 Mid Central Regional F.Orderly Class(大水题)
这两天刷了两道过去的原题,看看思维还是8太行. 这道题问给出两个字符串,要求只翻转一次,问有几种不同的方法使得a串变成b串 我一开始没看到只翻转一次,还以为是个计数 + 字符串dp大难题,心想当年的学 ...
- OpenCV击中击不中HMTxingt变换最容易理解的解释
OpenCV击中击不中变换是几个形态变换中相对比较拗口.不容易理解的,给初学者理解带来了很多困难,虽然网上也有许多的公开资料,原理和算法基本上介绍比较清晰,但是是要OpenCV进行形态变换大多还是说得 ...
- 第14.9节 Python中使用urllib.request+BeautifulSoup获取url访问的基本信息
利用urllib.request读取url文档的内容并使用BeautifulSoup解析后,可以通过一些基本的BeautifulSoup对象输出html文档的基本信息.以博文<第14.6节 使用 ...
- Python基础知识学习随笔
Python学习随笔:PyCharm的错误检测使用及调整配置减少错误数量 Python学习随笔:获取当前主机名和用户名的方法 博客地址:https://blog.csdn.net/LaoYuanPyt ...
- 乌云wooyun网站硬盘复活
AWD比赛防止没有网络,在移动硬盘里面准备一个乌云漏洞库. 之前也想过弄一个乌云的镜像网站,无奈学生机性能太低下了,部署到公网上服务器存储空间都不够,只能部署在本地硬盘了. 乌云镜像的开源地址:htt ...
- Libp2p 简介
这是一个翻译的系列文章,原文参考:Introduction :: libp2p Documentation 欢迎来阅读libp2p相关文档,不论你是刚开始学习如何用libp2p来搭建P2P系统, 还是 ...
- SQL实现_同时在线人数
原始数据表结构如下: user_id login_time logout_time 12 2020-12-10 20:45:18 2020-12-10 21:45:18 只说下实现思路,SQL不太难, ...
- 使用tkinter打造一个小说下载器,想看什么小说,就下什么
前言 今天教大家用户Python GUI编程--tkinter 打造一个小说下载器,想看什么小说,就下载什么小说 先看下效果图 Tkinter 是使用 python 进行窗口视窗设计的模块.Tkint ...
- 七牛云上传视频(后端获取tolen)
参照网址 https://developer.qiniu.com/kodo/sdk/1242/python #pip install qiniufrom qiniu import Auth #需要填写 ...