<?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.bonus.canteen.core.supermarket.mapper.SupermarketConfigMapper">

    <select id="listConfig" resultType="com.bonus.canteen.core.supermarket.vo.SupermarketConfigPageVO">
        SELECT
            week_id,
            supermarket_id,
            week_name,
            week_type,
            opening_time,
            closing_time,
            if_business,
            if_reserve_fetch
        FROM
            supermarket_config
        WHERE
            supermarket_id = #{supermarketId}
    </select>
    <select id="listReserveWeek" resultType="java.lang.Integer">
        SELECT
            week_type
        FROM
            supermarket_config
        WHERE
            supermarket_id = #{supermarketId}
            AND if_business = #{trueConfig}
            AND if_reserve_fetch = #{trueConfig}
        ORDER BY
            week_type
    </select>
    <select id="getBusinessInfo" resultType="com.bonus.canteen.core.supermarket.po.BusinessConfigModel">
        SELECT
            if_business,
            opening_time,
            closing_time
        FROM
            supermarket_config
        WHERE
            supermarket_id = #{supermarketId}
            AND week_type = #{weekDay}
    </select>
</mapper>
