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搜索函数相比,功能方面会有些限制,比如写判定式.还有 ...
随机推荐
- Error:Execution failed for task ':app:mergeDebugResources'. > Error: Some file crunching failed, see logs for details
android studio中的资源文件命名是不能带有数字的,因为会与R类的资源ID起冲突,所以编译就发生了错误.
- 【2020.11.28提高组模拟】T2 序列(array)
序列(array) 题目描述 给定一个长为 \(m\) 的序列 \(a\). 有一个长为 \(m\) 的序列 \(b\),需满足 \(0\leq b_i \leq n\),\(\sum_{i=1}^ ...
- EF Core 执行SQL语句和存储过程
无论ORM有多么强大,总会出现一些特殊的情况,它无法满足我们的要求.在这篇文章中,我们介绍几种执行SQL的方法. 表结构 在具体内容开始之前,我们先简单说明一下要使用的表结构. public clas ...
- Python之【模块】
双层装饰器 一个函数可以被多个装饰器装饰: 多层装饰器的本质是:嵌套: 执行规则是:解释自下而上,执行自上而下 •简单的用户权限验证程序: USE_INFO = {} # 初始化一个字典,用户存放用户 ...
- charles功能(四) 模拟 接口404/403返回值(blacklist方法)
1.tools-->blacklist 2.允许启用黑名单选择接口返回错误的形式 (404或者403),添加接口地址并保存 3.再次请求效果如下
- 转:Python2字符编码问题汇总
这篇文章的部分问题在Python3以后不再存在,老猿只是觉得文章的部分内容还是有参考价值,因此在此原文转发连接: Python2字符编码问题汇总
- sql black list 绕过
Black list is so weak for you,isn't it 姿势: return preg_match("/set|prepare|alter|rename|select| ...
- [SQL Server]多次为 '派生表' 指定了列 'id'
问题: 原因: 因为派生表oo中出现了两个同样的'ID'属性,所以会报[多次为 'o' 指定了列 'ID']的错误. 只需要把第二个星号替换成所需要的列名并把重复字段重命名就好了 解决方案:
- 2020武汉dotNET俱乐部分享交流圆满结束
经过长达2个多月的准备,终于在12月5日圆满的举行了武汉首届dotNET俱乐部线下分享交流活动.我们一共精心准备了3个目前比较热门的主题,分别如下: Jason分享的<ABP开发框架的扩展应用& ...
- Scrum 冲刺第一天
一.团队信息 1.团队名称 挑战极限队 2.团队成员 张博愉(3118005074) 张润柏(3118005075) 郑堉涵(3118005077) 周伟建(3118005079) 林梓琦(31180 ...