<?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.MerchantRegisterMapper">

    <select id="pageInfo" resultType="com.czg.account.vo.MerchantRegisterVO">
        select a.*, b.shop_name, b.phone, b.register_type, b.expire_time
        from tb_merchant_register as a
                 left join tb_shop_info as b on a.shop_id = b.id
        <where>
            <if test="state != null">
                a.status=#{state}
            </if>
            <if test="startTime != null and startTime != ''">
                a.create_time >= #{startTime}
            </if>

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