<?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.cai.mapper.ForbidFilterMapper">

    <select id="pageAdmin" resultType="com.ruoyi.cai.dto.admin.vo.ForbidFilterAdminVo">
        select t1.*,
               t2.usercode as user_usercode,t2.mobile as user_mobile,
               t3.nickname as member_nickname, t3.avatar as member_avatar
        from cai_forbid_filter t1
        left join cai_user t2 on t1.user_id = t2.id
        left join cai_user t3 on t1.member = t3.usercode and t1.type = 1
        <where>
            <if test="bo.userMobile != null and bo.userMobile != ''">
                and t2.mobile = #{bo.userMobile}
            </if>
            <if test="bo.userUsercode != null and bo.userUsercode != ''">
                and t2.usercode = #{bo.userUsercode}
            </if>
            <if test="bo.traceNo != null and bo.traceNo != ''">
                and t1.trace_no = #{bo.traceNo}
            </if>
            <if test="bo.type != null">
                and t1.type = #{bo.type}
            </if>
            <if test="bo.member != null and bo.member != ''">
                and t1.member = #{bo.member}
            </if>
        </where>
        order by t1.create_time desc
    </select>


</mapper>
