<?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="com.cool.store.mapper.WithdrawApplicationMapper">

    <!-- 分页查询 -->
    <select id="pageQuery" resultType="com.cool.store.dto.wallet.WithdrawApplicationDTO">
        SELECT
            id,
            withdraw_no AS withdrawNo,
            account_name AS accountName,
            amount,
            bank_card_no AS bankCardNo,
            bank_name AS bankName,
            status,
            fail_reason AS failReason,
            create_user_id AS createUserId,
            create_time AS createTime,
            update_time AS updateTime
        FROM zxjp_withdraw_application
        WHERE 1=1
        <if test="request.withdrawNo != null and request.withdrawNo != ''">
            AND withdraw_no LIKE CONCAT('%', #{request.withdrawNo}, '%')
        </if>
        <if test="request.accountName != null and request.accountName != ''">
            AND account_name LIKE CONCAT('%', #{request.accountName}, '%')
        </if>
        <if test="request.startTime != null">
            AND create_time &gt;= #{request.startTime}
        </if>
        <if test="request.endTime != null">
            AND create_time &lt;= #{request.endTime}
        </if>
        <if test="request.status != null">
            AND status = #{request.status}
        </if>
        ORDER BY create_time DESC
    </select>

</mapper>
