<?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.czg.service.account.mapper.ShopUserFlowMapper">

    <select id="pageInfo" resultType="com.czg.account.vo.ShopUserFlowVO">
        select a.*, c.shop_name as shopName, b.phone, b.nick_name as nickName from tb_shop_user_flow as a
        left join tb_shop_user as b on a.user_id=b.user_id and a.shop_id=b.shop_id
        left join tb_shop_info as c on c.id=a.shop_id
        where a.shop_id=#{shopId}
        <if test="bizCode != null and bizCode != ''">
            and a.biz_code=#{bizCode}
        </if>
        <if test="userId != null">
            and a.user_id=#{userId}
        </if>
        <if test="startTime != null and startTime != ''">
            and a.create_time >= #{startTime}
        </if>

        <if test="endTime != null and endTime != ''">
            and a.create_time &lt;= #{endTime}
        </if>
        order by a.create_time desc
    </select>
</mapper>
