<?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.SmsReturnRecordMapper">

    <select id="getReturnRecordPageList" resultType="cn.roadm.admin.dto.SmsReturnRecordDTO">
        select id,
        sp_id,
        allnumber,
        money,
        createtime,
        returntime,
        billing_mode,
        status,realtime
        from sms_sp_return_fee
        <where>
            <if test="query.spId!=null and query.spId>=0">
                and sp_id=#{query.spId}
            </if>
            <if test="query.billingMode!=null and query.billingMode!=''">
                and billing_mode=#{query.billingMode}
            </if>
            <if test="query.status!=null and query.status>-1">
                and status=#{query.status}
            </if>
            <if test="query.startReturnTime!=null and query.startReturnTime!=''">
                and returntime &gt;= #{query.startReturnTime}
            </if>
            <if test="query.endReturnTime!=null and query.endReturnTime!=''">
                and returntime &lt;= #{query.endReturnTime}
            </if>
        </where>
        order by id desc
    </select>

</mapper>
