首页 > 数据库技术 > 详细

sql中模糊查询和在开始和结束时间之间

时间:2020-09-01 14:15:19      阅读:152      评论:0      收藏:0      [点我收藏+]
  <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中模糊查询和在开始和结束时间之间

原文:https://www.cnblogs.com/xianz666/p/13595759.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!