<?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.fzm.mall.server.admin.shop.mapper.ShopMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.shop.model.Shop">
        <id column="id" property="id" />
        <result column="merchant_id" property="merchantId" />
        <result column="shop_id" property="shopId" />
        <result column="shop_name" property="shopName" />
        <result column="introduction" property="introduction" />
        <result column="contact" property="contact" />
        <result column="contact_phone" property="contactPhone" />
        <result column="shop_address" property="shopAddress" />
        <result column="shop_image" property="shopImage" />
        <result column="status" property="status" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <select id="page" resultType="com.fzm.mall.server.admin.shop.entity.dto.ShopDTO">
        select id, merchant_id, shop_id, shop_name, introduction, contact, contact_phone, shop_address, shop_image,
                status, create_time, update_time
        from shop
        where status = '1' and merchant_id = #{merchantId}
        order by create_time desc
    </select>
</mapper>
