<?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.ruoyi.xq.mapper.UserWithdrawMapper">

    <select id="pageApp" resultType="com.ruoyi.xq.dto.app.withdraw.WithdrawListAppVo">
        select
            t1.id, t1.user_id, t1.usercode, t1.order_no,
            t1.withdraw_money,t1.real_withdraw_money, t1.withdraw_fees,t1.withdraw_fees_cate,
            t1.pay, t1.audit_status, t1.audit_remark, t1.audit_time, t1.create_time
        from xq_user_withdraw t1
        where t1.user_id = #{query.userId}
        <if test="query.auditStatus != null">
            and t1.audit_status = #{query.auditStatus}
        </if>
    </select>
    <select id="pageAdmin" resultType="com.ruoyi.xq.dto.admin.withdraw.UserWithdrawAdminVo">
        select t1.*, t2.nickname, t2.mobile,t2.avatar
        from xq_user_withdraw t1
        left join xq_user t2 on t1.user_id = t2.id
        <where>
            <if test="bo.usercode != null and bo.usercode != ''">
                and t1.usercode = #{bo.usercode}
            </if>
            <if test="bo.nickname != null and bo.nickname != ''">
                and t2.nickname like concat('%',#{bo.nickname},'%')
            </if>
            <if test="bo.mobile != null and bo.mobile != ''">
                and t2.mobile = #{bo.mobile}
            </if>
        </where>
        order by create_time desc
    </select>


</mapper>
