<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.desk.meeting.mapper.MeetingMapper"> <delete id="deleteMeeting">
delete from blade_meeting where meeting_code=#{meetingCode}
</delete>
<select id="getMeetingList" parameterType="org.springblade.desk.meeting.entity.MeetingEntity" resultType="org.springblade.desk.meeting.entity.MeetingEntity">
select * from blade_meeting where tenant_id=#{tenantId}
<if test="meetingDate != null and meetingDate !=''">
and meeting_date=#{meetingDate}
</if>
<if test="startTime != null and startTime !='' or endTime != null and endTime !=''">
and ( (#{startTime} between start_time and end_time) or
(#{endTime} between start_time and end_time)
)
</if>
<if test="months != null and months !='' ">
and (meeting_date like '%%${months}%%')
</if>
<if test="meetingAddress != null and meetingAddress !=''">
and meeting_address =#{meetingAddress}
</if> </select>
<select id="getMyJoinMeetingPage" resultType="org.springblade.desk.meeting.entity.MeetingEntity">
select a.* from blade_meeting a left join blade_meeting_person b on a.meeting_code=b.meeting_code
where b.join_person_code=#{joinPersonCode}
<if test="meetingName != null">
and (meeting_name like '%%${meetingName}%%')
</if>
<if test="meetingDate != null">
and (meeting_date like '%%${meetingDate}%%')
</if>
</select>
</mapper>
  <select id="getMeetingList" parameterType="org.springblade.desk.meeting.entity.MeetingEntity" resultType="org.springblade.desk.meeting.entity.MeetingEntity">
select * from blade_meeting where tenant_id=#{tenantId}
<if test="meetingLaunchPersonCode != null and meetingLaunchPersonCode !='' ">
and meeting_launch_person_code=#{meetingLaunchPersonCode}
</if>
<if test="meetingDate != null and meetingDate !='' ">
and meeting_date=#{meetingDate}
</if>
<if test="startTime != null and startTime !='' ">
and start_time &gt;= #{startTime} &lt;= end_time
</if>
<if test="endTime != null and endTime !='' ">
and start_time &gt;= #{endTime} &lt;= end_time
</if>
<if test="months != null and months !='' ">
and (meeting_date like '%%${months}%%')
</if> </select>
<select id="getMyJoinMeetingPage" resultType="org.springblade.desk.meeting.entity.MeetingEntity">
select a.* from blade_meeting a left join blade_meeting_person b on a.meeting_code=b.meeting_code
where b.join_person_code=#{joinPersonCode}
<if test="meetingName != null">
and (meeting_name like '%%${meetingName}%%')
</if>
<if test="meetingDate != null">
and (meeting_date like '%%${meetingDate}%%')
</if>
</select>

sql中模糊查询和在开始和结束时间之间的更多相关文章

  1. SQL中模糊查询的模式匹配

    SQL模糊查询的语法为: “Select column FROM table Where column LIKE 'pattern'”. SQL提供了四种匹配模式: 1. % 表示任意0个或多个字符. ...

  2. MSSQL 所有表中模糊查询

    --搜索指定数据在那个对象中存在.txt(所有表中模糊查询) CREATE PROC sp_ValueSearch @value sql_variant, --要搜索的数据 @precision bi ...

  3. TP框架中模糊查询实现

    TP框架中模糊查询实现 $where['g.name'] = array('like','%'.$groupname.'%'); 表达式查询 上面的查询条件仅仅是一个简单的相等判断,可以使用查询表达式 ...

  4. mysql中模糊查询的四种用法介绍

    下面介绍mysql中模糊查询的四种用法: 1,%:表示任意0个或多个字符.可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号(%%)表示. 比如 SELECT * FROM [user] ...

  5. SQL中Between查询日期时需要注意的地方

    SQL中Between查询日期时需要注意的地方   某个表某个字段是Datetime型 以"YYYY-MM-DD 00:00:00" 存放 (1).例如数据 2009-01-22 ...

  6. 下面介绍mysql中模糊查询的四种用法:

    下面介绍mysql中模糊查询的四种用法: 1,%:表示任意0个或多个字符.可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号(%%)表示. 比如 SELECT * FROM [user] ...

  7. Sql语句模糊查询字符串的两种写法

    Sql语句模糊查询有两种写法,一种是在jdbcTemplate的查询方法参数里拼接字符串%,一种是在Sql语句里拼接%字符串. public class IsNameDaoImpl implement ...

  8. SQL like 模糊查询

    SQL 模糊查询 在进行数据库查询时,有完整查询和模糊查询之分. 一般模糊查询语句如下: SELECT 字段 FROM 表 WHERE 某字段 Like 条件 其中关于条件,SQL提供了四种匹配模式: ...

  9. sql server 2008有关SQL的模糊查询

    执行 数据库查询时,有完整查询和模糊查询之分. 一般模糊语句如下: SELECT 字段 FROM 表 WHERE 某字段 Like 条件 其中关于条件,SQL提供了四种匹配模式: 1,%:表示任意0个 ...

随机推荐

  1. Kafka作为分布式消息系统的系统解析

    Kafka概述 Apache Kafka由Scala和Java编写,基于生产者和消费者模型作为开源的分布式发布订阅消息系统.它提供了类似于JMS的特性,但设计上又有很大区别,它不是JMS规范的实现,如 ...

  2. 转:HTTP协议简介与在python中的使用详解

    1. 使用谷歌/火狐浏览器分析 在Web应用中,服务器把网页传给浏览器,实际上就是把网页的HTML代码发送给浏览器,让浏览器显示出来.而浏览器和服务器之间的传输协议是HTTP,所以: HTML是一种用 ...

  3. PyQt学习随笔:Qt中Model/View相关的主要类及继承关系

    View相关类类继承关系: Model相关类类继承关系:

  4. DVWA SQL Injection Medium

    Mdeium 基本的步骤及知识点在上节已经提到过这里不再赘述:https://blog.csdn.net/WQ_BCJ/article/details/84554777 1)与low级别不同,本次采用 ...

  5. 【Alpha冲刺阶段】Scrum Meeting Daily3

    [Alpha冲刺阶段]Scrum Meeting Daily3 1.会议简述 会议开展时间 2020/5/24 8:00-8:15 PM 会议基本内容摘要 每日汇报 个人进度.遇到的困难.明日的计划. ...

  6. 转:locality sensitive hashing

    Motivation The task of finding nearest neighbours is very common. You can think of applications like ...

  7. 实战演习:mysqlbinlog恢复bin-log数据

    mysqlbinlog恢复bin-log数据 Binlog日志即binary log,是二进制日志文件,有两个作用,一个是增量备份,另一个是主从复制,即从节点同步主节点数据时获取的即是bin-log, ...

  8. linux 上安装部署python

    一般在linux中使用python 需要安装pyenv 进行版本控制 因为linux6.9自带的Python是2.6的 同时很多命令都是基于2.6开发的 所以系统环境不能改 我们要开发 只能用pyen ...

  9. ado.net使用sqlparameter的方式

    使用sqlparameter的方式,最终执行的sql语句 exec sp_executesql N'select top 1 ID,ZhangHu,MiMa,RID,ShiJian,EndTime,I ...

  10. GitLab的基本了解和使用

    使用前提 GitLab账号 安装好git VSCODE && 配置GitPath 在vscode里配置GitPath file-preferences-setting 在search ...