<?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.cyksj.mapper.WebInfoMapper">

    <select id="getWebInfo" resultType="com.cyksj.model.views.WebInfoView">
        select w.id,w.show_id,u.id as userId,u.nickname,w.prefix,w.shop_name,w.status,w.update_time from web_info w left join user u on w.show_id = u.show_id
        <where>
            <if test="prefix != null">
                and w.prefix = #{prefix}
            </if>
            <if test="wholesaleId != null">
                and w.id = #{wholesaleId}
            </if>
            <if test="shopName != null">
                and w.shop_name like '%${shopName}'
            </if>
            <if test="userId != null">
                and u.id = #{userId}
            </if>
            <if test="nickName != null">
                and u.nickname like '%${nickName}%'
            </if>
            <if test="status != null">
                and w.status = #{status}
            </if>
        </where>
        order by w.id desc
    </select>
</mapper>