<?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.core.menu.mapper.MenuEvaluaDetailMapper">

<!--    <select id="selectAndroidDishesEvaluatePage" resultType="net.xnzn.core.menu.vo.AndroidDishesEvaluateVO">-->
<!--        select-->
<!--            meo.evalua_id,-->
<!--            ci.cust_name,-->
<!--            med.star_level,-->
<!--            date_format(meo.crtime, '%Y-%m-%d') as evaluate_date,-->
<!--            med.description-->
<!--        from-->
<!--            menu_evalua_detail med-->
<!--                left join menu_evalua_order meo on med.evalua_id = meo.evalua_id-->
<!--                left join order_info oi on meo.ord_id = oi.order_id-->
<!--                left join cust_info ci on oi.cust_id = ci.cust_id-->
<!--                left join (-->
<!--                    select-->
<!--                        meo2.evalua_id,-->
<!--                        if(count(mep.id) > 0, 1, 2) as picture_flag-->
<!--                    from-->
<!--                        menu_evalua_order meo2-->
<!--                            left join menu_evalua_picture mep on meo2.evalua_id = mep.evalua_id-->
<!--                    group by-->
<!--                        meo2.evalua_id-->
<!--                        ) mp on meo.evalua_id = mp.evalua_id-->
<!--        where-->
<!--            meo.shopstall_id = #{content.stallId}-->
<!--            and med.meal_id = #{content.dishesId}-->
<!--        <if test="content.pictureFlag == 2">-->
<!--            and mp.picture_flag = 1-->
<!--        </if>-->
<!--        <if test="content.sortFlag == 2">-->
<!--            order by-->
<!--                meo.crtime desc-->
<!--        </if>-->
<!--    </select>-->
    <select id="selectDishesDetailByEvaluaIds" resultType="com.bonus.core.menu.vo.MenuEvaluateDishesVO">
        select md.dishes_name, med.star_level,med.evalua_id,mm.material_name
        from menu_evalua_detail med
                 left join menu_dishes md on med.meal_id = md.dishes_id
                 left join menu_material mm on mm.material_id=med.meal_id
        where med.evalua_id in
        <foreach collection="evaluaIds" open="(" close=")" separator="," item="item">
            #{item}
        </foreach>
    </select>
</mapper>
