<?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.caimei.www.mapper.SupplierDao">
    <select id="getSupplierById" resultType="com.caimei.www.pojo.content.SupplierDetail">
        select
            s.shopID as id,
            s.userID as userId,
            s.name,
            s.sname as abbr,
            s.logo,
            s.address,
            s.businessScope,
            s.businessLicenseImage as businessLicense,
            s.taxCertificateImage as taxCertificate,
            s.authorizationCertificateImage as certificate,
            s.info,
            s.productDesc,
            s.site
        from shop s
        where shopID = #{supplierId}
    </select>
    <select id="getSupplierDetailImages" resultType="java.lang.String">
        select image
        from shopbanner
        where shopID = #{supplierId}
    </select>
    <select id="getSupplierMainProducts" resultType="com.caimei.www.pojo.content.ProductList">
		select
			p.productID as pid,
			p.`name` as `name`,
			p.mainImage as image,
			p.price1 as price,
			p.unit as unit,
			p.price1TextFlag as priceflag
		from product p
        where p.shopID = #{supplierId}
        and p.validFlag = 2 and p.featuredFlag=1
        order by p.productID desc limit 4
    </select>
</mapper>
