<?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="cn.roadm.admin.mapper.SmsInterfaceQueryMapper">

    <select id="getInterfaceQueryPageList" resultType="cn.roadm.admin.dto.SmsInterfaceQueryDTO">
        SELECT * from  sms_interface_query
        <where>
            1=1
            <if test="mdns!= '' and mdns != null">
                and mdns like CONCAT(#{mdns},'%')
            </if>
            <if test="spId!= '' and spId != null">
                and spId =#{spId}
            </if>
            <if test="content != null and content != ''">
                and content like CONCAT('%',#{content},'%')
            </if>
            <if test="beginTime!=null and beginTime!=''">
                and create_time&gt;=str_to_date(#{beginTime},'%Y-%m-%d')
            </if>
            <if test="endTime!=null and endTime!=''">
                and create_time&lt;DATE_ADD(str_to_date(#{endTime},'%Y-%m-%d'),INTERVAL 1 DAY)
            </if>
        </where>
        order by create_time desc
    </select>

</mapper>
