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

<!--    &lt;!&ndash; 获取菜品列表 &ndash;&gt;-->
<!--    <select id="selectAllList" parameterType="object" resultType="net.xnzn.core.menu.vo.MenuDishesPageVO">-->
<!--        select distinct-->
<!--        md.dishes_id dishesId,-->
<!--        md.dishes_num dishesNum,-->
<!--        md.custom_id customId,-->
<!--        md.dishes_name dishesName,-->
<!--        md.alias_name,-->
<!--        md.pinyin_initials pinyinInitials,-->
<!--        md.pinyin_full pinyinFull,-->
<!--        md.intro,-->
<!--        md.cook_id cookId,-->
<!--        mdc.cook_name cookName,-->
<!--        md.type_id typeId,-->
<!--        mdt.type_name typeName,-->
<!--        md.classify_id classifyId,-->
<!--        mdcf.classify_name classifyName,-->
<!--        md.effect_id effectId,-->
<!--        mde.effect_name effectName,-->
<!--        md.style_id styleId,-->
<!--        mds.style_name styleName,-->
<!--        md.if_local_feature ifLocalFeature,-->
<!--        md.dishes_depart dishesDepart,-->
<!--        md.sequence,-->
<!--        md.pungency_degree pungencyDegree,-->
<!--        md.sales_mode salesMode,-->
<!--        md.weight_deviation weightDeviation,-->
<!--        md.price,-->
<!--        md.unit_price unitPrice,-->
<!--        md.image_url imageUrl,-->
<!--        md.particulars,-->
<!--        md.recommend,-->
<!--        md.calories,-->
<!--        md.protein,-->
<!--        md.fat,-->
<!--        md.carbohydrate,-->
<!--        md.dietary_fiber dietaryFiber,-->
<!--        md.cholesterol,-->
<!--        md.calcium,-->
<!--        md.sodium,-->
<!--        md.canteen_id canteenId,-->
<!--        md.shopstall_id shopstallId,-->
<!--        md.crby,-->
<!--        md.crtime,-->
<!--        md.upby,-->
<!--        md.uptime-->
<!--        from-->
<!--        menu_dishes md-->
<!--        left join menu_dishes_cook mdc on mdc.cook_id = md.cook_id-->
<!--        left join menu_dishes_type mdt on mdt.type_id = md.type_id-->
<!--        left join menu_label_dishes mld on mld.dishes_id = md.dishes_id-->
<!--        left join menu_dishes_label mdl on mdl.label_id = mld.label_id-->
<!--        left join menu_taste_dishes mtd on mtd.dishes_id = md.dishes_id-->
<!--        left join menu_dishes_taste mdtt on mdtt.taste_id = mtd.taste_id-->
<!--        left join menu_suit_dishes msd on msd.dishes_id = md.dishes_id-->
<!--        left join menu_dishes_suit mdst on mdst.suit_id = msd.suit_id-->
<!--        left join menu_material_dishes mmd on mmd.dishes_id = md.dishes_id-->
<!--        left join menu_material mm on mm.material_id = mmd.material_id-->
<!--        left join menu_dishes_classify mdcf on mdcf.classify_id = md.classify_id-->
<!--        left join menu_dishes_effect mde on mde.effect_id = md.effect_id-->
<!--        left join menu_dishes_style mds on mds.style_id = md.style_id-->
<!--        where-->
<!--        md.del_flag = #{menuDishesPageDTO.delFlag}-->
<!--        <if test="menuDishesPageDTO.dishesId != null">-->
<!--            and md.dishes_id = #{menuDishesPageDTO.dishesId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.dishesName != null and menuDishesPageDTO.dishesName != ''">-->
<!--            and md.dishes_name like concat(concat('%', #{menuDishesPageDTO.dishesName}), '%')-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.canteenId != null">-->
<!--            and md.canteen_id = #{menuDishesPageDTO.canteenId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.shopstallId != null">-->
<!--            and md.shopstall_id = #{menuDishesPageDTO.shopstallId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.cookId != null">-->
<!--            and md.cook_id = #{menuDishesPageDTO.cookId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.typeId != null">-->
<!--            and md.type_id = #{menuDishesPageDTO.typeId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.tasteId != null">-->
<!--            and mdtt.taste_id = #{menuDishesPageDTO.tasteId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.labelId != null">-->
<!--            and mdl.label_id = #{menuDishesPageDTO.labelId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.suitId != null">-->
<!--            and mdst.suit_id = #{menuDishesPageDTO.suitId}-->
<!--        </if>-->
<!--        <if test="menuDishesPageDTO.materialId != null">-->
<!--            and mm.material_id = #{menuDishesPageDTO.materialId}-->
<!--        </if>-->
<!--        <if test="canteenList != null and canteenList.size > 0">-->
<!--            and md.canteen_id in-->
<!--            <foreach close=")" collection="canteenList" item="canteenList" open="(" separator=",">-->
<!--                #{canteenList.canteenId}-->
<!--            </foreach>-->
<!--            and md.shopstall_id in-->
<!--            <foreach close=")" collection="canteenList" item="canteenList" open="(" separator=",">-->
<!--                #{canteenList.shopstallId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        order by-->
<!--        md.crtime desc-->
<!--    </select>-->

<!--    &lt;!&ndash; 开放接口获取所有菜品基础信息 &ndash;&gt;-->
<!--    <resultMap id="menuOpenDishesVO" type="net.xnzn.core.menu.vo.DishVO">-->
<!--        <result column="dishes_id" property="dishesId"/>-->
<!--        <result column="inventory_id" property="inventoryId"/>-->
<!--        <result column="dishes_num" property="dishesNum"/>-->
<!--        <result column="dishes_name" property="dishesName"/>-->
<!--        <result column="type_id" property="typeId"/>-->
<!--        <result column="type_name" property="typeName"/>-->
<!--        <result column="sales_mode" property="salesMode"/>-->
<!--        <result column="weight" property="weight"/>-->
<!--        <result column="price" property="price"/>-->
<!--        <result column="unit_price" property="unitPrice"/>-->
<!--        <result column="image_url" property="imageUrl"/>-->
<!--        <result column="pungency_degree" property="pungencyDegree"/>-->
<!--        <result column="style_id" property="styleId"/>-->
<!--        <result column="style_name" property="styleName"/>-->
<!--        <result column="intro" property="intro"/>-->
<!--        <result column="effect_id" property="effectId"/>-->
<!--        <result column="effect_name" property="effectName"/>-->
<!--        <result column="particulars" property="particulars"/>-->
<!--        <result column="calories" property="calories"/>-->
<!--        <result column="protein" property="protein"/>-->
<!--        <result column="fat" property="fat"/>-->
<!--        <result column="carbohydrate" property="carbohydrate"/>-->
<!--        <result column="dietary_fiber" property="dietaryFiber"/>-->
<!--        <result column="cholesterol" property="cholesterol"/>-->
<!--        <result column="calcium" property="calcium"/>-->
<!--        <result column="sodium" property="sodium"/>-->
<!--        <result column="shopstall_id" property="shopstallId"/>-->
<!--        <result column="shopstall_name" property="shopstallName"/>-->
<!--        <result column="canteen_id" property="canteenId"/>-->
<!--        <result column="canteen_name" property="canteenName"/>-->
<!--        <result column="third_canteen_id" property="thirdCanteenId"/>-->
<!--        <result column="third_shopstall_id" property="thirdShopstallId"/>-->
<!--        <result column="crtime" property="crtime" />-->
<!--        <result column="uptime" property="uptime" />-->
<!--        <result column="del_flag" property="delFlag" />-->
<!--        <collection property="suitList"-->
<!--                    ofType="net.xnzn.core.open.modules.catering.entity.vo.MenuOpenDishesSuitVO">-->
<!--            <result column="suit_id" property="suitId"/>-->
<!--            <result column="suit_name" property="suitName"/>-->
<!--        </collection>-->
<!--        <collection property="tasteList"-->
<!--                    ofType="net.xnzn.core.open.modules.catering.entity.vo.MenuOpenDishesTasteVO">-->
<!--            <result column="taste_id" property="tasteId"/>-->
<!--            <result column="taste_name" property="tasteName"/>-->
<!--        </collection>-->
<!--        <collection property="materialList"-->
<!--                    ofType="net.xnzn.core.open.modules.catering.entity.vo.MenuOpenDishesMaterialVO">-->
<!--            <result column="material_id" property="materialId"/>-->
<!--            <result column="material_name" property="materialName"/>-->
<!--            <result column="material_type" property="materialType"/>-->
<!--        </collection>-->
<!--        <collection property="labelList"-->
<!--                    ofType="net.xnzn.core.open.modules.catering.entity.vo.MenuOpenDishesLabelVO">-->
<!--            <result column="label_id" property="labelId"/>-->
<!--            <result column="label_name" property="labelName"/>-->
<!--        </collection>-->
<!--    </resultMap>-->

<!--    &lt;!&ndash; 分页获取菜品基础信息 &ndash;&gt;-->
<!--    <select id="selectAllListV2" resultType="net.xnzn.core.menu.vo.MenuDishesPageVO">-->
<!--        select-->
<!--        md.dishes_id,-->
<!--        md.dishes_num,-->
<!--        md.custom_id,-->
<!--        md.dishes_name,-->
<!--        md.alias_name,-->
<!--        md.pinyin_initials,-->
<!--        md.pinyin_full,-->
<!--        md.intro,-->
<!--        mdc.cook_id,-->
<!--        mdc.cook_name,-->
<!--        mdt.type_id,-->
<!--        mdt.type_name,-->
<!--        mdcf.classify_id,-->
<!--        mdcf.classify_name,-->
<!--        mde.effect_id,-->
<!--        mde.effect_name,-->
<!--        mds.style_id,-->
<!--        mds.style_name,-->
<!--        md.if_local_feature,-->
<!--        md.dishes_depart,-->
<!--        md.sequence,-->
<!--        md.pungency_degree,-->
<!--        md.sales_mode,-->
<!--        md.weight_deviation,-->
<!--        md.price,-->
<!--        md.unit_price,-->
<!--        md.image_url,-->
<!--        md.particulars,-->
<!--        md.recommend,-->
<!--        md.calories,-->
<!--        md.protein,-->
<!--        md.fat,-->
<!--        md.carbohydrate,-->
<!--        md.dietary_fiber,-->
<!--        md.cholesterol,-->
<!--        md.calcium,-->
<!--        md.sodium,-->
<!--        md.canteen_id,-->
<!--        md.shopstall_id,-->
<!--        md.crby,-->
<!--        md.crtime,-->
<!--        md.upby,-->
<!--        md.uptime-->
<!--        from-->
<!--        menu_dishes md-->
<!--        left join menu_dishes_cook mdc on mdc.cook_id = md.cook_id-->
<!--        left join menu_dishes_type mdt on mdt.type_id = md.type_id-->
<!--        left join menu_dishes_classify mdcf on mdcf.classify_id = md.classify_id-->
<!--        left join menu_dishes_effect mde on mde.effect_id = md.effect_id-->
<!--        left join menu_dishes_style mds on mds.style_id = md.style_id-->
<!--        where-->
<!--        md.del_flag = #{delFlag}-->
<!--        <if test="dishesName != null and dishesName != ''">-->
<!--            and md.dishes_name like concat(concat('%', #{dishesName}), '%')-->
<!--        </if>-->
<!--        <if test="typeIdList != null and typeIdList.size > 0">-->
<!--            and md.type_id in-->
<!--            <foreach close=")" collection="typeIdList" item="typeId" open="(" separator=",">-->
<!--                #{typeId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="canteenList != null and canteenList.size > 0">-->
<!--            and md.canteen_id in-->
<!--            <foreach close=")" collection="canteenList" item="canteenList" open="(" separator=",">-->
<!--                #{canteenList.canteenId}-->
<!--            </foreach>-->
<!--            and md.shopstall_id in-->
<!--            <foreach close=")" collection="canteenList" item="canteenList" open="(" separator=",">-->
<!--                #{canteenList.shopstallId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        order by-->
<!--        md.id desc-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取菜品营养信息列表 &ndash;&gt;-->
<!--    <select id="selectNutritionWeightList" resultType="net.xnzn.core.menu.utils.NutritionEntity">-->
<!--        select-->
<!--            md.calories,-->
<!--            md.protein,-->
<!--            md.fat,-->
<!--            md.carbohydrate,-->
<!--            md.dietary_fiber,-->
<!--            md.cholesterol,-->
<!--            md.calcium,-->
<!--            md.sodium,-->
<!--            md.purine,-->
<!--            md.iron,-->
<!--            md.iodine,-->
<!--            md.kalium,-->
<!--            md.vitamin_a,-->
<!--            md.vitamin_c,-->
<!--            md.vitamin_e,-->
<!--            md.magnesium,-->
<!--            md.zinc,-->
<!--            md.glycemic_index,-->
<!--            mpd.proportion as weight,-->
<!--            if(md.sales_mode = 2, md.unit_price, md.weight) as base_weight-->
<!--        from-->
<!--            menu_package_dishes mpd-->
<!--                left join menu_dishes md on mpd.dishes_id = md.dishes_id-->
<!--        where-->
<!--            mpd.package_id = #{dishesId}-->
<!--    </select>-->

<!--    &lt;!&ndash; 根据套餐id获取菜品详情 &ndash;&gt;-->
<!--    <select id="selectListByPackageId" resultType="net.xnzn.core.menu.vo.MenuPackageDishesPageVO">-->
<!--        select-->
<!--            md.dishes_id,-->
<!--            md.dishes_name,-->
<!--            md.intro,-->
<!--            mpd.proportion-->
<!--        from-->
<!--            menu_dishes md-->
<!--                left join menu_package_dishes mpd on md.dishes_id = mpd.dishes_id-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--            and mpd.package_id = #{packageId}-->
<!--    </select>-->

    <resultMap id="appletDishesDetailVO" type="com.bonus.canteen.core.menu.vo.AppletDishesDetailVO">
        <result property="baseDishesId" column="base_dishes_id"/>
        <result property="mealType" column="meal_type"/>
        <result property="customId" column="custom_d"/>
        <result property="dishesName" column="dishes_name"/>
        <result property="aliasName" column="alias_name"/>
        <result property="imageUrl" column="image_url"/>
        <result property="intro" column="intro"/>
        <result property="particulars" column="particulars"/>
        <collection property="dishesDetailList" ofType="com.bonus.canteen.core.menu.vo.AppletDishesSizeV2VO">
            <result property="dishesId" column="dishes_id"/>
            <result property="dishesName" column="real_dishes_name"/>
            <result property="surplusNum" column="surplus_num"/>
            <result property="restrictNum" column="restrict_num"/>
            <result property="dishesPrice" column="dishes_price"/>
            <result property="prefPrice" column="pref_price"/>
            <result property="sizeType" column="size_type"/>
            <result property="sizeJson" column="size_json"/>
            <result property="calories" column="calories"/>
            <result property="protein" column="protein"/>
            <result property="fat" column="fat"/>
            <result property="carbohydrate" column="carbohydrate"/>
            <result property="dietaryFiber" column="dietary_fiber"/>
            <result property="cholesterol" column="cholesterol"/>
            <result property="calcium" column="calcium"/>
            <result property="sodium" column="sodium"/>
        </collection>
    </resultMap>

    <!-- 根据菜品id获取菜品详情 -->
    <select id="selectDishesDetailByDishesId" resultMap="appletDishesDetailVO">
        select
            mdb.base_dishes_id,
            md.dishes_id,
            md.meal_type,
            md.custom_id,
            mdb.dishes_name,
            md.dishes_name as real_dishes_name,
            md.alias_name,
            md.image_url,
            md.intro,
            md.particulars,
            mrd.size_type,
            md.size_json,
            mrd.price as dishes_price,
            mrd.sale_price as pref_price,
            mrd.supply_num - mrd.surplus_num as sales_num,
            mrd.surplus_num,
            mrd.restrict_num,
            md.calories,
            md.protein,
            md.fat,
            md.carbohydrate,
            md.dietary_fiber,
            md.cholesterol,
            md.calcium,
            md.sodium
        from
            menu_dishes_base mdb
                left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id
                left join menu_recipe_dishes mrd on md.dishes_id = mrd.dishes_id
        where
            mdb.base_dishes_id = #{baseDishesId}
            and mrd.detail_id = #{detailId}
            and md.del_flag = #{delFlag}
    </select>

<!--    &lt;!&ndash; 获取指定食堂首页推荐菜品列表 &ndash;&gt;-->
<!--    <select id="selectIndexRecommendDishesList"-->
<!--            resultType="net.xnzn.core.menu.vo.IndexDishesListVO">-->
<!--        select dishes_id                          dishesId,-->
<!--               dishes_name                        dishesName,-->
<!--               substring_index(image_url, ',', 1) imageUrl-->
<!--        from menu_dishes-->
<!--        where canteen_id = #{canteenId}-->
<!--          and del_flag = #{delFlag}-->
<!--          and index_recommend = #{indexRecommend}-->
<!--    </select>-->

<!--    &lt;!&ndash; 根据菜品id获取标签 &ndash;&gt;-->
<!--    <select id="selectDishesLabelByDishesId" resultType="java.lang.String">-->
<!--        select mdl.label_name-->
<!--        from menu_dishes_label mdl-->
<!--                 left join menu_label_dishes mld on mdl.label_id = mld.label_id-->
<!--        where mld.dishes_id = #{dishesId}-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取指定类型原料 &ndash;&gt;-->
<!--    <select id="selectMaterialByType" resultType="java.lang.String">-->
<!--        select material_name-->
<!--        from menu_material mm-->
<!--                 left join menu_material_dishes mmd on mm.material_id = mmd.material_id-->
<!--        where mmd.dishes_id = #{dishesId}-->
<!--          and mmd.material_type = #{materialType}-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取所有菜品信息 &ndash;&gt;-->
<!--    <select id="selectAllDishesByType"-->
<!--            resultType="net.xnzn.core.menu.vo.AndroidRecipeTypeDetailVO">-->
<!--        select if(md.meal_type = 1, md.dishes_id, null) as dishes_id,-->
<!--               if(md.meal_type = 2, md.dishes_id, null) as package_id,-->
<!--               null                                     as product_id,-->
<!--               md.custom_id,-->
<!--               md.dishes_name                           as product_name,-->
<!--               md.image_url,-->
<!--               md.price                                 as sale_price,-->
<!--               md.price                                 as pref_price,-->
<!--               md.price                                 as original_price,-->
<!--               md.calories,-->
<!--               md.protein,-->
<!--               md.weight,-->
<!--               md.fat,-->
<!--               md.carbohydrate,-->
<!--               md.dietary_fiber,-->
<!--               md.cholesterol,-->
<!--               md.calcium,-->
<!--               md.sodium,-->
<!--               md.meal_type                             as meal_type,-->
<!--               mdt.type_name,-->
<!--               mdt.type_id-->
<!--        from menu_dishes md-->
<!--                 left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--        where md.del_flag = 2-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取所有菜品基础信息 &ndash;&gt;-->
<!--    <select id="selectAllDishesBasicsInfo" resultType="net.xnzn.core.menu.vo.MenuBasicsDishesVO">-->
<!--        select-->
<!--            md.dishes_id,-->
<!--            md.dishes_name,-->
<!--            md.price,-->
<!--            mdt.type_name,-->
<!--            md.sales_mode-->
<!--        from-->
<!--            menu_dishes md-->
<!--                left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--        where-->
<!--            md.del_flag = #{delFlag}-->
<!--            and hide_flag = 2-->
<!--        <if test="canteenList != null and canteenList.size > 0">-->
<!--            and md.canteen_id in-->
<!--            <foreach collection="canteenList" item="canteen" open="(" close=")" separator=",">-->
<!--                #{canteen.canteenId}-->
<!--            </foreach>-->
<!--            and md.shopstall_id in-->
<!--            <foreach collection="canteenList" item="canteen" open="(" close=")" separator=",">-->
<!--                #{canteen.shopstallId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取推荐分值计算的菜品数据 &ndash;&gt;-->
<!--    <select id="selectDishesCustHealth" resultType="net.xnzn.core.menu.vo.MenuDishesCustHealthVO">-->
<!--        select-->
<!--        md.dishes_id,-->
<!--        md.fat,-->
<!--        mdc.classify_name,-->
<!--        md.purine,-->
<!--        md.calories,-->
<!--        md.sodium,-->
<!--        md.iodine-->
<!--        from-->
<!--        menu_dishes md-->
<!--        left join menu_dishes_classify mdc on md.classify_id = mdc.classify_id-->
<!--        where-->
<!--        md.del_flag = #{delFlag}-->
<!--        <if test="dishesIdSet != null and dishesIdSet.size() > 0">-->
<!--            and md.dishes_id in-->
<!--            <foreach collection="dishesIdSet" item="dishesId" open="(" separator="," close=")">-->
<!--                #{dishesId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取基础菜品列表 &ndash;&gt;-->
<!--    <select id="selectMenuDishesDataList" resultType="net.xnzn.core.menu.entity.MenuDishes">-->
<!--        select mdd.dishes_id,-->
<!--               mdd.dishes_name,-->
<!--               mdd.pinyin_initials,-->
<!--               mdd.pinyin_full,-->
<!--               mdd.bar_code,-->
<!--               mdt.type_id,-->
<!--               mdd.weight,-->
<!--               100 as price,-->
<!--               mdd.initial_score,-->
<!--               mdd.calories,-->
<!--               mdd.protein,-->
<!--               mdd.fat,-->
<!--               mdd.carbohydrate,-->
<!--               mdd.dietary_fiber,-->
<!--               mdd.cholesterol,-->
<!--               mdd.calcium,-->
<!--               mdd.sodium,-->
<!--               mdd.purine,-->
<!--               mdd.iodine-->
<!--        from menu_dishes_data mdd-->
<!--                 left join menu_dishes_type mdt on mdd.type_name = mdt.type_name-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取原料菜品基础库列表 &ndash;&gt;-->
<!--    <select id="selectMenuMaterialDishesDataList"-->
<!--            resultType="net.xnzn.core.menu.entity.MenuMaterialDishes">-->
<!--        select-->
<!--        mmdd.dishes_id,-->
<!--        mm.material_id,-->
<!--        mmdd.weight,-->
<!--        mmdd.material_type-->
<!--        from-->
<!--        menu_material_dishes_data mmdd-->
<!--        left join menu_material mm on mmdd.material_name = mm.material_name-->
<!--        where-->
<!--        mmdd.dishes_id in-->
<!--        <foreach close=")" collection="dishesIdList" item="dishesId" open="(" separator=",">-->
<!--            #{dishesId}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    &lt;!&ndash; 新版分页菜品 &ndash;&gt;-->
<!--    <select id="selectAllV2List" resultType="net.xnzn.core.menu.vo.MenuDishesV2PageVO">-->
<!--        select-->
<!--            mdb.base_dishes_id as dishes_id,-->
<!--            md.dishes_num,-->
<!--            md.custom_id,-->
<!--            mdb.dishes_name,-->
<!--            md.image_url,-->
<!--            md.price,-->
<!--            md.sales_mode,-->
<!--            md.size_type,-->
<!--            md.unit_price,-->
<!--            md.meal_type,-->
<!--            mdt.type_name,-->
<!--            ac.canteen_name,-->
<!--            md.material_cost,-->
<!--            md.gross_profit,-->
<!--            md.gross_profit_rate,-->
<!--            md.canteen_id,-->
<!--            md.area_id,-->
<!--            aa.area_name,-->
<!--            md.shopstall_id,-->
<!--            ast.stall_name-->
<!--        from-->
<!--            menu_dishes_base mdb-->
<!--                left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id-->
<!--                    and md.size_json != '{"sizeType":"小份"}'-->
<!--                left join menu_dishes_type mdt on mdt.type_id = md.type_id-->
<!--                left join alloc_area aa on md.area_id = aa.area_id-->
<!--                left join alloc_canteen ac on md.canteen_id = ac.canteen_id-->
<!--                left join alloc_stall ast on md.shopstall_id = ast.stall_id-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--            and hide_flag = 2-->
<!--        <if test="content.salesMode != null ">-->
<!--            and md.sales_mode = #{content.salesMode}-->
<!--        </if>-->
<!--        <if test="content.dishesName != null and content.dishesName != ''">-->
<!--            and (-->
<!--            md.dishes_name like #{content.dishesName}-->
<!--            or md.pinyin_initials like #{content.dishesName}-->
<!--            or md.pinyin_full like #{content.dishesName}-->
<!--            )-->
<!--        </if>-->
<!--        <if test="content.areaIds != null and content.areaIds.size >0">-->
<!--            and  md.area_id in-->
<!--          <foreach collection="content.areaIds" item="areaId" open="(" separator="," close=")">-->
<!--             #{areaId}-->
<!--          </foreach>-->
<!--        </if>-->
<!--        <if test="content.canteenIds != null and content.canteenIds.size >0">-->
<!--            and  md.canteen_id in-->
<!--            <foreach collection="content.canteenIds" item="canteenId" open="(" separator="," close=")">-->
<!--                #{canteenId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.stallIds != null and content.stallIds.size >0">-->
<!--            and md.shopstall_id in-->
<!--            <foreach collection="content.stallIds" item="stallId" open="(" separator="," close=")">-->
<!--                #{stallId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.typeIdList != null and content.typeIdList.size > 0">-->
<!--            and md.type_id in-->
<!--            <foreach collection="content.typeIdList" item="typeId" open="(" separator="," close=")">-->
<!--                #{typeId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.materialId != null">-->
<!--           and exists(-->
<!--            select-->
<!--                null-->
<!--            from-->
<!--                menu_material_dishes mmd-->
<!--            where-->
<!--                mmd.dishes_id = md.dishes_id-->
<!--                and mmd.del_flag = 2-->
<!--                and mmd.material_id = #{content.materialId}-->
<!--            )-->
<!--        </if>-->
<!--        <if test="'3'.toString() == authPO.roleType.toString()">-->
<!--            and exists(-->
<!--                select-->
<!--                    null-->
<!--                from mgr_role_canteen it1-->
<!--                    left join mgr_role it2 on it2.role_id = it1.role_id-->
<!--                    left join mgr_user_role it3 on it1.role_id = it3.role_id-->
<!--            where-->
<!--                it2.del_flag = 2-->
<!--                and it2.role_code = #{authPO.roleCode}-->
<!--                and it3.user_id = #{authPO.userId}-->
<!--                and (md.canteen_id = it1.data_id or md.canteen_id = -1)-->
<!--            )-->
<!--            AND EXISTS(-->
<!--            select-->
<!--            null-->
<!--            from mgr_role_canteen it1-->
<!--            left join mgr_role it2 on it2.role_id = it1.role_id-->
<!--            left join mgr_user_role it3 on it1.role_id = it3.role_id-->
<!--            where-->
<!--            it2.del_flag = 2-->
<!--            and it2.role_code = #{authPO.roleCode}-->
<!--            and it3.user_id = #{authPO.userId}-->
<!--            and (md.shopstall_id = it1.data_id or md.shopstall_id = -1)-->
<!--            )-->
<!--            and EXISTS (-->
<!--            SELECT null-->
<!--            FROM mgr_role_area it1-->
<!--            LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
<!--            LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
<!--            WHERE it2.del_flag = 2-->
<!--            AND it2.role_code = #{authPO.roleCode}-->
<!--            AND it1.half_select = 1-->
<!--            AND it3.user_id = #{authPO.userId}-->
<!--            AND (md.area_id = it1.data_id or md.area_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        <if test="'2'.toString() == authPO.roleType.toString() or '1'.toString() == authPO.roleType.toString()">-->
<!--            and EXISTS (-->
<!--            SELECT null-->
<!--            FROM mgr_role_area it1-->
<!--            LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
<!--            LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
<!--            WHERE it2.del_flag = 2-->
<!--            AND it2.role_code = #{authPO.roleCode}-->
<!--            AND it1.half_select = 1-->
<!--            AND it3.user_id = #{authPO.userId}-->
<!--            AND (md.area_id = it1.data_id or md.area_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        order by-->
<!--            md.id desc-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取菜品详情 &ndash;&gt;-->
<!--    <select id="selectDishesDetailById" resultType="net.xnzn.core.menu.vo.MenuDishesDetailVO">-->
<!--        select-->
<!--            mdb.base_dishes_id as dishes_id,-->
<!--            md.meal_type,-->
<!--            ac.canteen_id,-->
<!--            ac.canteen_name,-->
<!--            md.dishes_num,-->
<!--            mdb.dishes_name,-->
<!--            md.sales_mode,-->
<!--            md.size_type,-->
<!--            md.unit_price,-->
<!--            md.price,-->
<!--            md.large_price,-->
<!--            md.little_price,-->
<!--            md.weight,-->
<!--            md.large_weight,-->
<!--            md.little_weight,-->
<!--            md.public_dishes,-->
<!--            mdc.cook_id,-->
<!--            mdc.cook_name,-->
<!--            md.pungency_degree,-->
<!--            mds.style_id,-->
<!--            mds.style_name,-->
<!--            mde.effect_id,-->
<!--            mde.effect_name,-->
<!--            md.intro,-->
<!--            mdt.type_id,-->
<!--            mdt.type_name,-->
<!--            md.image_url,-->
<!--            md.weight_deviation,-->
<!--            md.material_cost,-->
<!--            md.canteen_id,-->
<!--            md.area_id,-->
<!--            aa.area_name,-->
<!--            md.shopstall_id,-->
<!--            ast.stall_name-->
<!--        from-->
<!--            menu_dishes_base mdb-->
<!--                left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id-->
<!--                    and md.size_json != '{"sizeType":"小份"}'-->
<!--                left join menu_dishes_cook mdc on mdc.cook_id = md.cook_id-->
<!--                left join menu_dishes_type mdt on mdt.type_id = md.type_id-->
<!--                left join menu_dishes_effect mde on mde.effect_id = md.effect_id-->
<!--                left join menu_dishes_style mds on mds.style_id = md.style_id-->
<!--                left join alloc_area aa on md.area_id = aa.area_id-->
<!--                left join alloc_canteen ac on md.canteen_id = ac.canteen_id-->
<!--                left join alloc_stall ast on md.shopstall_id = ast.stall_id-->
<!--        where-->
<!--            mdb.base_dishes_id = #{dishesId}-->
<!--    </select>-->

<!--    <select id="selectTypeDishesList" resultType="net.xnzn.core.menu.vo.MenuAllTypeDishesVO">-->
<!--        select-->
<!--            mdb.base_dishes_id as dishes_id,-->
<!--            mdb.dishes_name,-->
<!--            md.price,-->
<!--            ac.canteen_name,-->
<!--            ass.stall_name,-->
<!--            aa.area_name,-->
<!--            md.sales_mode,-->
<!--            md.size_type,-->
<!--            md.public_dishes,-->
<!--            md.unit_price,-->
<!--            md.little_price,-->
<!--            md.large_price,-->
<!--            md.material_cost,-->
<!--            md.meal_type,-->
<!--            md.type_id,-->
<!--            mdt.type_name,-->
<!--            md.dishes_num-->
<!--        from-->
<!--            menu_dishes_base mdb-->
<!--                left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id-->
<!--                    and md.size_json != '{"sizeType":"小份"}'-->
<!--                left join alloc_area aa on  aa.area_id = md.area_id-->
<!--                left join alloc_canteen ac on md.canteen_id = ac.canteen_id-->
<!--                left join alloc_stall ass on ass.stall_id = md.shopstall_id-->
<!--                left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--        <if test="content.typeId != null">-->
<!--            and md.type_id = #{content.typeId}-->
<!--        </if>-->
<!--        <if test="content.canteenId != null and content.stallId != null and content.areaId != null">-->
<!--            and(-->
<!--            (md.canteen_id = #{content.canteenId} and md.shopstall_id = #{content.stallId})-->
<!--            or (md.canteen_id = #{content.canteenId} and md.shopstall_id = -1)-->
<!--            or (md.canteen_id = -1 and md.shopstall_id = -1 and md.area_id = #{content.areaId})-->
<!--            or (md.canteen_id = -1 and md.shopstall_id = -1 and md.area_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        <if test="content.areaIds != null and content.areaIds.size >0">-->
<!--            and  md.area_id in-->
<!--            <foreach collection="content.areaIds" item="areaId" open="(" separator="," close=")">-->
<!--                #{areaId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.canteenIds != null and content.canteenIds.size >0">-->
<!--            and  md.canteen_id in-->
<!--            <foreach collection="content.canteenIds" item="canteenId" open="(" separator="," close=")">-->
<!--                #{canteenId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.stallIds != null and content.stallIds.size >0">-->
<!--            and md.shopstall_id in-->
<!--            <foreach collection="content.stallIds" item="stallId" open="(" separator="," close=")">-->
<!--                #{stallId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.dishesName != null and content.dishesName != ''">-->
<!--            and (md.dishes_name like #{content.dishesName}-->
<!--                or md.pinyin_full like #{content.dishesName}-->
<!--                or md.pinyin_initials like #{content.dishesName})-->
<!--        </if>-->
<!--        <if test="content.salesMode != null">-->
<!--            and md.sales_mode = #{content.salesMode}-->
<!--        </if>-->
<!--        <if test="'3'.toString() == authPO.roleType.toString()">-->
<!--            and exists(-->
<!--                select-->
<!--                    null-->
<!--                from mgr_role_canteen it1-->
<!--                    left join mgr_role it2 on it2.role_id = it1.role_id-->
<!--                    left join mgr_user_role it3 on it1.role_id = it3.role_id-->
<!--                where-->
<!--                    it2.del_flag = 2-->
<!--                    and it2.role_code = #{authPO.roleCode}-->
<!--                    and it3.user_id = #{authPO.userId}-->
<!--                    and (md.canteen_id = it1.data_id or md.canteen_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        <if test="'-1'.toString() != authPO.roleType.toString() ">-->
<!--            and EXISTS (-->
<!--            SELECT null-->
<!--            FROM mgr_role_area it1-->
<!--            LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
<!--            LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
<!--            WHERE it2.del_flag = 2-->
<!--            AND it2.role_code = #{authPO.roleCode}-->
<!--            AND it1.half_select = 1-->
<!--            AND it3.user_id = #{authPO.userId}-->
<!--            AND (md.area_id = it1.data_id or md.area_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取指定人员指定日期的饮食详情 &ndash;&gt;-->
<!--    <select id="selectDishesDetailByCustId"-->
<!--            resultType="net.xnzn.core.menu.vo.AndroidDishesDetailByDateVO">-->
<!--        select distinct-->
<!--            oi.order_id as ord_id,-->
<!--            od.goods_dishes_id as goods_id,-->
<!--            od.goods_dishes_name as goods_name,-->
<!--            od.price,-->
<!--            md.image_url,-->
<!--            od.goods_dishes_name as mealName,-->
<!--            od.detail_type,-->
<!--            med.star_level-->
<!--        from-->
<!--            order_detail od-->
<!--                left join menu_dishes md on od.goods_dishes_id = md.dishes_id-->
<!--                left join order_info oi on od.order_id = oi.order_id-->
<!--                left join menu_evalua_order meo on oi.order_id = meo.ord_id-->
<!--                left join menu_evalua_detail med on meo.evalua_id = med.evalua_id-->
<!--                                                        and med.meal_id = od.goods_dishes_id-->
<!--        where-->
<!--            oi.cust_id = #{custId}-->
<!--            and oi.order_date = #{queryDate}-->
<!--            and oi.order_state = 2-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取特定时间段是否存在此菜品 &ndash;&gt;-->
<!--    <select id="menuRecipeCount" resultType="java.lang.Integer">-->
<!--	SELECT-->
<!--		count(1)-->
<!--	FROM-->
<!--		menu_recipe_detail d-->
<!--		    LEFT JOIN menu_recipe_dishes m ON d.detail_id = m.detail_id-->
<!--	WHERE-->
<!--		d.detail_type = 2-->
<!--		AND d.mealtime_type = #{mealtimeType}-->
<!--		AND apply_date = #{nowDate}-->
<!--		AND m.dishes_id = #{dishesId};-->
<!--	</select>-->


<!--    &lt;!&ndash; 开放接口获取所有菜品基础信息 &ndash;&gt;-->
<!--    <select id="selectOpenMenuDishesList" resultMap="menuOpenDishesVO">-->
<!--        select-->
<!--            md.dishes_id,-->
<!--            md.inventory_id,-->
<!--            md.dishes_num,-->
<!--            mdb.dishes_name,-->
<!--            mdt.type_id,-->
<!--            mdt.type_name,-->
<!--            md.sales_mode,-->
<!--            md.weight,-->
<!--            md.price,-->
<!--            md.unit_price,-->
<!--            md.image_url,-->
<!--            md.pungency_degree,-->
<!--            mds.style_id,-->
<!--            mds.style_name,-->
<!--            md.intro,-->
<!--            mde.effect_id,-->
<!--            mde.effect_name,-->
<!--            md.particulars,-->
<!--            md.calories,-->
<!--            md.protein,-->
<!--            md.fat,-->
<!--            md.carbohydrate,-->
<!--            md.dietary_fiber,-->
<!--            md.cholesterol,-->
<!--            md.calcium,-->
<!--            md.sodium,-->
<!--            md.canteen_id,-->
<!--            md.shopstall_id,-->
<!--            md.crtime,-->
<!--            md.uptime,-->
<!--            md.del_flag,-->
<!--            ac.third_canteen_id,-->
<!--            ac.canteen_name,-->
<!--            ast.stall_id,-->
<!--            ast.stall_name,-->
<!--            mdss.suit_id,-->
<!--            mdss.suit_name,-->
<!--            mdtt.taste_id,-->
<!--            mdtt.taste_name,-->
<!--            mm.material_id,-->
<!--            mm.material_name,-->
<!--            mmd.material_type,-->
<!--            mdl.label_id,-->
<!--            mdl.label_name-->

<!--        from-->
<!--            menu_dishes_base mdb-->
<!--                left join menu_dishes md on md.base_dishes_id = mdb.base_dishes_id-->
<!--                    and md.size_json != '{"sizeType":"小份"}'-->
<!--                left join alloc_canteen ac on ac.canteen_id = md.canteen_id-->
<!--                left join alloc_stall ast on ast.stall_id = md.shopstall_id-->
<!--                left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--                left join menu_dishes_style mds on md.style_id = mds.style_id-->
<!--                left join menu_dishes_effect mde on md.effect_id = mde.effect_id-->
<!--                left join menu_suit_dishes msd on md.dishes_id = msd.dishes_id-->
<!--                left join menu_dishes_suit mdss on msd.suit_id = mdss.suit_id-->
<!--                left join menu_taste_dishes mtd on md.dishes_id = mtd.dishes_id-->
<!--                left join menu_dishes_taste mdtt on mtd.taste_id = mdtt.taste_id-->
<!--                left join menu_material_dishes mmd on md.dishes_id = mmd.dishes_id-->
<!--                left join menu_material mm on mmd.material_id = mm.material_id-->
<!--                left join menu_label_dishes mld on mld.dishes_id = md.dishes_id-->
<!--                left join menu_dishes_label mdl on mdl.label_id = mld.label_id-->
<!--        <where>-->
<!--            <if test="param.uptime != null">-->
<!--                md.uptime <![CDATA[ >= ]]> #{param.uptime}-->
<!--            </if>-->
<!--            <if test="param.delFlag != null">-->
<!--                md.del_flag = #{param.delFlag}-->
<!--            </if>-->
<!--        </where>-->
<!--        order by-->
<!--            md.uptime desc-->
<!--    </select>-->

<!--    <resultMap id="menuLabelAndNutritionVO" type="net.xnzn.core.menu.vo.MenuLabelAndNutritionVO">-->
<!--        <result property="dishesId" column="dishes_id"/>-->
<!--        <result property="dishesName" column="dishes_name"/>-->
<!--        <result property="imageUrl" column="image_url"/>-->
<!--        <result property="calories" column="calories"/>-->
<!--        <result property="protein" column="protein"/>-->
<!--        <result property="fat" column="fat"/>-->
<!--        <result property="carbohydrate" column="carbohydrate"/>-->
<!--        <collection property="labelNameList" ofType="string">-->
<!--            <result property="labelName" column="label_name"/>-->
<!--        </collection>-->
<!--    </resultMap>-->

<!--    <select id="selectDishesLabelAndNutritionList" resultMap="menuLabelAndNutritionVO">-->
<!--        select-->
<!--            md.dishes_id,-->
<!--            md.dishes_name,-->
<!--            md.image_url,-->
<!--            md.calories,-->
<!--            md.protein,-->
<!--            md.fat,-->
<!--            md.carbohydrate,-->
<!--            mdl.label_name-->
<!--        from-->
<!--            menu_dishes md-->
<!--                left join menu_label_dishes mld on md.dishes_id = mld.dishes_id-->
<!--                left join menu_dishes_label mdl on mld.label_id = mdl.label_id-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--        and md.dishes_id in-->
<!--        <foreach collection="dishesIdList" item="dishesId" separator="," open="(" close=")">-->
<!--            #{dishesId}-->
<!--        </foreach>-->

<!--    </select>-->

<!--    <select id="queryDishesCookLabelList" resultType="net.xnzn.core.menu.vo.DishesCookLabelVO">-->
<!--        SELECT-->
<!--        t1.id,t1.dishes_id,t1.meal_type,t1.dishes_num,t1.custom_id,t1.inventory_id,t1.dishes_name,t1.alias_name,-->
<!--        t1.pinyin_initials,t1.pinyin_full,t1.intro,t1.cook_id,t1.type_id,t1.style_id,t1.if_local_feature,-->
<!--        t1.dishes_depart,t1.sales_mode,t2.cook_name,t4.label_id,t4.label_name-->
<!--        FROM-->
<!--        menu_dishes t1-->
<!--        LEFT JOIN menu_dishes_cook t2 ON t1.cook_id = t2.cook_id-->
<!--        LEFT JOIN menu_label_dishes t3 ON t1.dishes_id = t3.dishes_id-->
<!--        LEFT JOIN menu_dishes_label t4 ON t3.label_id = t4.label_id-->
<!--        WHERE-->
<!--        t1.dishes_id in-->
<!--        <foreach collection="dishesIdList" item="dishesId" separator="," open="(" close=")">-->
<!--            #{dishesId}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    <select id="selectRegisterDishesIdList" resultType="java.lang.Long">-->
<!--        select-->
<!--            md.dishes_id-->
<!--        from-->
<!--            menu_recipe_detail mrd-->
<!--                left join menu_recipe_dishes m on mrd.detail_id = m.detail_id-->
<!--                left join menu_dishes md on m.dishes_id = md.dishes_id-->
<!--                left join menuai_picture mp on md.dishes_id = mp.dishes_id-->
<!--                                                   and mp.picture_type = 2-->
<!--        where-->
<!--            mrd.recipe_id = #{recipeId}-->
<!--            and mrd.mealtime_type = #{mealtimeType}-->
<!--            and mrd.apply_date = curdate()-->
<!--        group by-->
<!--            md.dishes_id-->
<!--        having-->
<!--            count(mp.id) >= 6-->
<!--    </select>-->

<!--    <select id="selectTypeDishesNum" resultType="net.xnzn.core.menuai.model.MenuaiDishesNumModel">-->
<!--        select-->
<!--            md.dishes_id,-->
<!--            md.dishes_name,-->
<!--            md.dishes_num,-->
<!--            mdt.type_num-->
<!--        from-->
<!--            menu_dishes md-->
<!--                left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--        where-->
<!--            md.dishes_id = #{dishesId}-->
<!--    </select>-->

<!--    <select id="selectRegisterDishes" resultType="net.xnzn.core.menuai.model.MenuaiRegisterDishesModel">-->
<!--        select-->
<!--            md.dishes_id,-->
<!--            md.dishes_name,-->
<!--            count(mp.id) as picture_num-->
<!--        from-->
<!--            menu_recipe_detail mrd-->
<!--                left join menu_recipe_dishes m on mrd.detail_id = m.detail_id-->
<!--                left join menu_dishes md on m.dishes_id = md.dishes_id-->
<!--                left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--                left join menuai_picture mp on md.dishes_id = mp.dishes_id-->
<!--                                                   and mp.picture_type = 2-->
<!--                                                   and mp.stall_id in (0,#{stallId})-->
<!--        where-->
<!--            mrd.recipe_id = #{recipeId}-->
<!--            and mrd.mealtime_type = #{mealtimeType}-->
<!--            and mrd.apply_date = curdate()-->
<!--        group by-->
<!--            md.dishes_id,-->
<!--            md.dishes_name-->
<!--        having-->
<!--            count(mp.id) >= 6-->
<!--    </select>-->
<!--    <select id="listDishesMaterial" resultType="net.xnzn.core.menu.po.MenuDishesMaterialModel">-->
<!--        SELECT-->
<!--            a.dishes_id,-->
<!--            a.dishes_name,-->
<!--            b.material_id,-->
<!--            c.material_name,-->
<!--            b.weight,-->
<!--            d.edible,-->
<!--            c.reserve_rate,-->
<!--            a.base_dishes_id-->
<!--        FROM-->
<!--            menu_dishes a-->
<!--            LEFT JOIN menu_material_dishes b ON b.dishes_id = a.dishes_id-->
<!--            LEFT JOIN menu_material c ON c.material_id = b.material_id-->
<!--            LEFT JOIN menu_nutrition d ON d.nutrition_id = c.nutrition_id-->
<!--        WHERE-->
<!--            a.sales_mode = #{salesMode}-->
<!--            AND b.material_id IS NOT NULL-->
<!--            AND a.dishes_id IN-->
<!--            <foreach collection="dishesIdList" item="dishesId" separator="," open="(" close=")">-->
<!--                #{dishesId}-->
<!--            </foreach>-->
<!--    </select>-->

    <select id="selectNutrition" resultType="com.bonus.canteen.core.nutrition.common.po.DishNutritionParam">
        select
            md.dishes_id,
            md.initial_score,
            mdc.classify_name,
            md.calories,
            md.protein,
            md.fat,
            md.carbohydrate,
            md.dietary_fiber,
            md.cholesterol,
            md.calcium,
            md.sodium,
            md.purine,
            md.iron,
            md.iodine,
            md.kalium,
            md.vitamin_a,
            md.vitamin_c,
            md.vitamin_e,
            md.magnesium,
            md.zinc,
            md.glycemic_index
        from
            menu_dishes md
                left join menu_dishes_type mdt on md.type_id = mdt.type_id
                left join menu_dishes_classify mdc on md.classify_id = mdc.classify_id
        where
            md.dishes_id in
        <foreach collection="dishesIdSet" item="dishesId" open="(" separator="," close=")">
            #{dishesId}
        </foreach>
    </select>

<!--    <resultMap id="menuBaseModel" type="net.xnzn.core.menu.model.MenuBaseModel">-->
<!--        <result property="baseDishesId" column="base_dishes_id"/>-->
<!--        <collection property="dishesList" ofType="net.xnzn.core.menu.model.MenuBaseDishesModel">-->
<!--            <result property="dishesId" column="dishes_id"/>-->
<!--            <result property="sizeJson" column="size_json"/>-->
<!--        </collection>-->
<!--    </resultMap>-->

<!--    <select id="selectBaseSizeDishesId" resultMap="menuBaseModel">-->
<!--        select-->
<!--            base_dishes_id,-->
<!--            dishes_id,-->
<!--            size_json-->
<!--        from-->
<!--            menu_dishes-->
<!--        where-->
<!--            base_dishes_id in-->
<!--        <foreach collection="baseDishesIdList" item="baseDishesId" separator="," open="(" close=")">-->
<!--            #{baseDishesId}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    <select id="selectAppDishesPage" resultType="net.xnzn.core.menu.vo.MenuAppDishesPageVO">-->
<!--        select-->
<!--            mdb.base_dishes_id as dishes_id,-->
<!--            md.dishes_id as dishes_select_id,-->
<!--            mdb.dishes_name,-->
<!--            md.price,-->
<!--            md.sales_mode,-->
<!--            md.size_type,-->
<!--            md.large_price,-->
<!--            md.large_weight,-->
<!--            md.little_price,-->
<!--            md.little_weight,-->
<!--            md.unit_price,-->
<!--            md.meal_type,-->
<!--            md.image_url-->
<!--        from-->
<!--            menu_dishes_base mdb-->
<!--                left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id-->
<!--                    and md.size_json != '{"sizeType":"小份"}'-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--        <if test="content.keyword != null and content.keyword != ''">-->
<!--            and md.dishes_name like #{content.keyword}-->
<!--        </if>-->
<!--        <if test="content.mealType != null">-->
<!--            and md.meal_type like #{content.mealType}-->
<!--        </if>-->
<!--        order by-->
<!--            md.crtime desc-->
<!--    </select>-->

<!--    <select id="selectTypeDishesListForApp" resultType="net.xnzn.core.menu.vo.MenuAppDishesListVO">-->
<!--        select-->
<!--            mdb.base_dishes_id as dishes_id,-->
<!--            mdb.dishes_name,-->
<!--            md.price,-->
<!--            md.sales_mode,-->
<!--            md.size_type,-->
<!--            md.large_price,-->
<!--            md.little_price,-->
<!--            md.weight,-->
<!--            md.large_weight,-->
<!--            md.little_weight,-->
<!--            md.unit_price,-->
<!--            ac.canteen_name-->
<!--        from-->
<!--            menu_dishes_base mdb-->
<!--                left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id-->
<!--                    and md.size_json != '{"sizeType":"小份"}'-->
<!--                left join alloc_canteen ac on md.canteen_id = ac.canteen_id-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--        <if test="content.typeId != null">-->
<!--            and md.type_id = #{content.typeId}-->
<!--        </if>-->
<!--        <if test="content.canteenId != null">-->
<!--            and md.canteen_id = #{content.canteenId}-->
<!--        </if>-->
<!--        <if test="content.dishesName != null and content.dishesName != ''">-->
<!--            and (md.dishes_name like #{content.dishesName}-->
<!--            or md.pinyin_initials like #{content.pinyinInitials})-->
<!--        </if>-->
<!--    </select>-->

<!--    &lt;!&ndash; 获取菜品id和菜品基础id列表 &ndash;&gt;-->
<!--    <select id="listBaseDishesId" resultType="net.xnzn.core.menu.dto.MenuBaseDishesIdDTO">-->
<!--        SELECT-->
<!--            dishes_id,-->
<!--            base_dishes_id-->
<!--        FROM-->
<!--            menu_dishes-->
<!--        WHERE-->
<!--            size_json != '{"sizeType":"小份"}'-->
<!--            <if test="param.dishesIdList != null and param.dishesIdList.size() > 0">-->
<!--                AND dishes_id IN-->
<!--                <foreach collection="param.dishesIdList" item="dishesId" separator="," open="(" close=")">-->
<!--                    #{dishesId}-->
<!--                </foreach>-->
<!--            </if>-->
<!--            <if test="param.baseDishesIdList != null and param.baseDishesIdList.size() > 0">-->
<!--                AND base_dishes_id IN-->
<!--                <foreach collection="param.baseDishesIdList" item="baseDishesId" separator="," open="(" close=")">-->
<!--                    #{baseDishesId}-->
<!--                </foreach>-->
<!--            </if>-->
<!--    </select>-->
<!--    <select id="listDishesSizeModel" resultType="net.xnzn.core.menu.model.MenuDishesSizeModel">-->
<!--        SELECT-->
<!--	dishes_id,-->
<!--	base_dishes_id,-->
<!--    CASE-->
<!--            WHEN size_json = '{"sizeType":"大份"}' THEN-->
<!--            2-->
<!--            WHEN size_json = '{"sizeType":"小份"}' THEN-->
<!--            3 ELSE 1-->
<!--        END sizeType-->
<!--    FROM-->
<!--        menu_dishes-->
<!--        WHERE-->
<!--            sales_mode = #{salesMode}-->
<!--            AND del_flag = #{delFlag}-->
<!--    </select>-->

<!--    <select id="selectBaseAndDetailList" resultType="net.xnzn.core.menu.model.MenuBaseAndDishesModel">-->
<!--        select-->
<!--            mdb.base_dishes_id,-->
<!--            md.dishes_id,-->
<!--            mdb.dishes_name as base_dishes_name-->
<!--        from-->
<!--            menu_dishes md-->
<!--                left join menu_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--            and md.base_dishes_id in-->
<!--        <foreach collection="baseIdList" item="baseId" separator="," open="(" close=")">-->
<!--            #{baseId}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    <select id="selectListByBase" resultType="net.xnzn.core.menu.entity.MenuDishes">-->
<!--        select-->
<!--            md.*-->
<!--        from-->
<!--            menu_dishes md-->
<!--                left join menu_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id-->
<!--        where-->
<!--            md.canteen_id = #{canteenId}-->
<!--            and md.del_flag = 2-->
<!--            and md.shopstall_id = -1-->
<!--            and mdb.dishes_name in-->
<!--        <foreach collection="dishesNameList" item="dishesName" separator="," open="(" close=")">-->
<!--            #{dishesName}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    <select id="selectDishesExportList" resultType="net.xnzn.core.menu.vo.MenuDishesExportVO">-->
<!--        select-->
<!--            md.dishes_num,-->
<!--            md.dishes_name,-->
<!--            md.meal_type as meal_type_in,-->
<!--            mdt.type_name,-->
<!--            md.sales_mode as sales_mode_in,-->
<!--            md.size_type as size_type_in,-->
<!--            md.unit_price as unit_price_in,-->
<!--            aa.area_name,-->
<!--            ac.canteen_name,-->
<!--            ass.stall_name,-->
<!--            md.price as price_in,-->
<!--            md.material_cost as material_cost_in,-->
<!--            md.gross_profit as gross_profit_in,-->
<!--            md.gross_profit_rate as gross_profit_rate_in-->
<!--        from-->
<!--            menu_dishes_base mdb-->
<!--                left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id-->
<!--                    and md.size_json != '{"sizeType":"小份"}'-->
<!--                left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--                left join alloc_area aa on aa.area_id = md.area_id-->
<!--                left join alloc_canteen ac on md.canteen_id = ac.canteen_id-->
<!--                left join alloc_stall ass on ass.stall_id = md.shopstall_id-->
<!--        where-->
<!--            md.del_flag = 2-->
<!--            and hide_flag = 2-->
<!--        <if test="content.dishesName != null and content.dishesName != ''">-->
<!--            and (-->
<!--                md.dishes_name like #{content.dishesName}-->
<!--                or md.pinyin_initials like #{content.dishesName}-->
<!--                or md.pinyin_full like #{content.dishesName}-->
<!--            )-->
<!--        </if>-->
<!--        <if test="content.areaIds != null and content.areaIds.size >0">-->
<!--            and  md.area_id in-->
<!--            <foreach collection="content.areaIds" item="areaId" open="(" separator="," close=")">-->
<!--                #{areaId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.canteenIds != null and content.canteenIds.size >0">-->
<!--            and  md.canteen_id in-->
<!--            <foreach collection="content.canteenIds" item="canteenId" open="(" separator="," close=")">-->
<!--                #{canteenId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.stallIds != null and content.stallIds.size >0">-->
<!--            and md.shopstall_id in-->
<!--            <foreach collection="content.stallIds" item="stallId" open="(" separator="," close=")">-->
<!--                #{stallId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.typeIdList != null and content.typeIdList.size > 0">-->
<!--            and md.type_id in-->
<!--            <foreach collection="content.typeIdList" item="typeId" open="(" separator="," close=")">-->
<!--                #{typeId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="'3'.toString() == authPO.roleType.toString()">-->
<!--            and exists(-->
<!--            select-->
<!--            null-->
<!--            from mgr_role_canteen it1-->
<!--            left join mgr_role it2 on it2.role_id = it1.role_id-->
<!--            left join mgr_user_role it3 on it1.role_id = it3.role_id-->
<!--            where-->
<!--            it2.del_flag = 2-->
<!--            and it2.role_code = #{authPO.roleCode}-->
<!--            and it3.user_id = #{authPO.userId}-->
<!--            and (md.canteen_id = it1.data_id or md.canteen_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        <if test="'2'.toString() == authPO.roleType.toString() or '1'.toString() == authPO.roleType.toString()">-->
<!--            and EXISTS (-->
<!--            SELECT null-->
<!--            FROM mgr_role_area it1-->
<!--            LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
<!--            LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
<!--            WHERE it2.del_flag = 2-->
<!--            AND it2.role_code = #{authPO.roleCode}-->
<!--            AND it1.half_select = 1-->
<!--            AND it3.user_id = #{authPO.userId}-->
<!--            AND (md.area_id = it1.data_id or md.area_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        order by-->
<!--            md.id desc-->
<!--    </select>-->

    <select id="selectDishesTypeNameAndIdList" resultType="com.bonus.canteen.core.menu.model.MenuDishesTypeModel">
        select
            md.dishes_id,
            mdt.type_id,
            mdt.type_name
        from
            menu_dishes md
                left join menu_dishes_type mdt on md.type_id = mdt.type_id
        where
            md.del_flag = 2
            and md.dishes_id in
        <foreach collection="dishesIdList" item="dishesId" open="(" close=")" separator=",">
            #{dishesId}
        </foreach>
    </select>
<!--    <select id="getMealListByDishesIds" resultType="net.xnzn.core.menu.vo.IssueRecipeMealCompressVO">-->
<!--        select-->
<!--        md.dishes_id,-->
<!--        md.custom_id,-->
<!--        md.dishes_name    as product_name,-->
<!--        md.price as original_price,-->
<!--        md.sales_mode as salseMode,-->
<!--        md.weight_deviation,-->
<!--        md.pinyin_initials,-->
<!--        md.pinyin_full,-->
<!--        if(md.sales_mode = 1, md.weight, md.unit_price) as weight,-->
<!--        mdt.type_id,-->
<!--        mdt.type_name,-->
<!--        md.purine,-->
<!--        md.iodine,-->
<!--        md.initial_score,-->
<!--        md.calories,-->
<!--        md.protein,-->
<!--        md.fat,-->
<!--        md.carbohydrate,-->
<!--        md.dietary_fiber,-->
<!--        md.cholesterol,-->
<!--        md.calcium,-->
<!--        md.sodium,-->
<!--        md.intro,-->
<!--        md.image_url                                       foodImage-->
<!--        from-->
<!--        menu_dishes md-->
<!--        left join menu_dishes_type mdt on md.type_id = mdt.type_id-->
<!--        where-->
<!--        md.del_flag = 2-->
<!--        and md.dishes_id in-->
<!--        <foreach collection="dishesIds" item="dishesId" open="(" close=")" separator=",">-->
<!--            #{dishesId}-->
<!--        </foreach>-->
<!--    </select>-->


<!--    <select id="selectDishesNameAndCanteenName" resultType="java.lang.String">-->
<!--        SELECT-->
<!--            concat_ws( '-', mdb.dishes_name, IFNULL(aa.area_name,'*'),IFNULL(ac.canteen_name,'*') , IFNULL( ass.stall_name,'*') )-->
<!--        FROM-->
<!--            menu_dishes_base mdb-->
<!--                LEFT JOIN menu_dishes md ON mdb.base_dishes_id = md.base_dishes_id-->
<!--                LEFT JOIN alloc_area aa ON aa.area_id = md.area_id-->
<!--                LEFT JOIN alloc_canteen ac ON md.canteen_id = ac.canteen_id-->
<!--                LEFT JOIN alloc_stall ass ON ass.stall_id = md.shopstall_id-->
<!--        WHERE-->
<!--            del_flag = 2-->
<!--    </select>-->
<!--    <select id="selectDishesLabelByDishesIds" resultType="net.xnzn.core.menu.dto.DishesLabelDto">-->
<!--        SELECT  mdl.label_name as name,mld.dishes_id-->
<!--        FROM-->
<!--        menu_label_dishes mld-->
<!--        LEFT JOIN menu_dishes_label mdl ON mdl.label_id = mld.label_id-->
<!--        where mld.dishes_id in-->
<!--        <foreach collection="dishesIds" item="dishesId" open="(" close=")" separator=",">-->
<!--            #{dishesId}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    <select id="selectMaterialByTypeAndDishesIds" resultType="net.xnzn.core.menu.dto.DishesLabelDto">-->
<!--        select mm.material_name as name,mmd.dishes_id,mmd.material_type-->
<!--        FROM-->
<!--        menu_material_dishes mmd-->
<!--        LEFT JOIN menu_material mm ON mm.material_id = mmd.material_id-->
<!--        where  mmd.dishes_id in-->
<!--        <foreach collection="dishesIds" item="dishesId" open="(" close=")" separator=",">-->
<!--            #{dishesId}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    <select id="nutritionGetDishes" resultType="java.lang.Long">-->
<!--        SELECT DISTINCT(md.dishes_id)-->
<!--        FROM menu_dishes md-->
<!--        LEFT JOIN menu_label_dishes mld ON mld.dishes_id = md.dishes_id AND mld.del_flag = 2-->
<!--        LEFT JOIN menu_material_dishes mmd ON md.dishes_id = mmd.dishes_id AND mmd.del_flag = 2-->
<!--        LEFT JOIN menu_material mm ON mm.material_id = mmd.material_id AND mm.del_flag = 2-->
<!--        WHERE md.del_flag = 2-->
<!--        <if test="content.dishesName !=null and content.dishesName!='' ">-->
<!--            AND (md.dishes_name like concat('%',#{content.dishesName},'%')-->
<!--            or md.pinyin_full like concat('%', #{content.dishesName},'%')-->
<!--            or md.pinyin_initials like concat('%',#{content.dishesName},'%'))-->
<!--        </if>-->
<!--        <if test="content.categoryIds !=null and content.categoryIds.size() > 0 ">-->
<!--            AND mm.category_id IN-->
<!--            <foreach collection="content.categoryIds" separator="," open="(" close=")" item="item">-->
<!--                #{item}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.materialIds !=null and content.materialIds.size() > 0 ">-->
<!--            AND mmd.material_id IN-->
<!--            <foreach collection="content.materialIds" separator="," open="(" close=")" item="item">-->
<!--                #{item}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.labelIds !=null and content.labelIds.size() > 0 ">-->
<!--            AND mld.label_id IN-->
<!--            <foreach collection="content.labelIds" separator="," open="(" close=")" item="item">-->
<!--                #{item}-->
<!--            </foreach>-->
<!--        </if>-->
<!--    </select>-->
<!--    <select id="selectUseTypeDishesList" resultType="java.lang.Long">-->
<!--        select-->
<!--            distinct (md.type_id )-->
<!--        from-->
<!--        menu_dishes_base mdb-->
<!--        left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id and md.size_json != '{"sizeType":"小份"}'-->
<!--        where-->
<!--        md.del_flag = 2-->
<!--        <if test="content.typeId != null">-->
<!--            and md.type_id = #{content.typeId}-->
<!--        </if>-->
<!--        <if test="content.canteenId != null and content.stallId != null and content.areaId != null">-->
<!--            and(-->
<!--            (md.canteen_id = #{content.canteenId} and md.shopstall_id = #{content.stallId})-->
<!--            or (md.canteen_id = #{content.canteenId} and md.shopstall_id = -1)-->
<!--            or (md.canteen_id = -1 and md.shopstall_id = -1 and md.area_id = #{content.areaId})-->
<!--            or (md.canteen_id = -1 and md.shopstall_id = -1 and md.area_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        <if test="content.areaIds != null and content.areaIds.size >0">-->
<!--            and md.area_id in-->
<!--            <foreach collection="content.areaIds" item="areaId" open="(" separator="," close=")">-->
<!--                #{areaId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.canteenIds != null and content.canteenIds.size >0">-->
<!--            and md.canteen_id in-->
<!--            <foreach collection="content.canteenIds" item="canteenId" open="(" separator="," close=")">-->
<!--                #{canteenId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.stallIds != null and content.stallIds.size >0">-->
<!--            and md.shopstall_id in-->
<!--            <foreach collection="content.stallIds" item="stallId" open="(" separator="," close=")">-->
<!--                #{stallId}-->
<!--            </foreach>-->
<!--        </if>-->
<!--        <if test="content.dishesName != null and content.dishesName != ''">-->
<!--            and (md.dishes_name like #{content.dishesName}-->
<!--            or md.pinyin_full like #{content.dishesName}-->
<!--            or md.pinyin_initials like #{content.dishesName})-->
<!--        </if>-->
<!--        <if test="content.salesMode != null">-->
<!--            and md.sales_mode = #{content.salesMode}-->
<!--        </if>-->
<!--        <if test="'3'.toString() == authPO.roleType.toString()">-->
<!--            and exists(-->
<!--            select-->
<!--            null-->
<!--            from mgr_role_canteen it1-->
<!--            left join mgr_role it2 on it2.role_id = it1.role_id-->
<!--            left join mgr_user_role it3 on it1.role_id = it3.role_id-->
<!--            where-->
<!--            it2.del_flag = 2-->
<!--            and it2.role_code = #{authPO.roleCode}-->
<!--            and it3.user_id = #{authPO.userId}-->
<!--            and (md.canteen_id = it1.data_id or md.canteen_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--        <if test="'-1'.toString() != authPO.roleType.toString() ">-->
<!--            and EXISTS (-->
<!--            SELECT null-->
<!--            FROM mgr_role_area it1-->
<!--            LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
<!--            LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
<!--            WHERE it2.del_flag = 2-->
<!--            AND it2.role_code = #{authPO.roleCode}-->
<!--            AND it1.half_select = 1-->
<!--            AND it3.user_id = #{authPO.userId}-->
<!--            AND (md.area_id = it1.data_id or md.area_id = -1)-->
<!--            )-->
<!--        </if>-->
<!--    </select>-->

<!--    <update id="openLimitCustomId">-->
<!--        UPDATE menu_dishes t1 JOIN (SELECT id, ROW_NUMBER() OVER (ORDER BY id) AS rowNumber FROM menu_dishes WHERE del_flag = 2 ) as t2 ON t1.id = t2.id SET t1.custom_id = t2.rowNumber;-->
<!--        UPDATE menu_custom_dict SET if_use = 2;-->
<!--        UPDATE menu_custom_dict SET if_use = 1 WHERE custom_id &lt;= (SELECT max(custom_id) FROM menu_dishes );-->
<!--    </update>-->



<!--    <select id="selectTasteByDishesIds" resultType="net.xnzn.core.menu.dto.DishesLabelDto">-->
<!--        SELECT-->
<!--        t1.dishes_id ,-->
<!--        t2.taste_name as name-->
<!--        FROM-->
<!--        menu_taste_dishes t1-->
<!--        LEFT JOIN menu_dishes_taste t2 ON t2.taste_id  = t1.taste_id-->
<!--        where t1.dishes_id in-->
<!--        <foreach collection="dishesIds" item="item" index="index" open="(" separator="," close=")">-->
<!--            #{item}-->
<!--        </foreach>-->
<!--    </select>-->

<!--    <resultMap id="baseDishesDetaill" type="net.xnzn.core.menu.dto.MenuBaseDishesDetail">-->
<!--        <result property="dishesName" column="dishes_name"/>-->
<!--        <result property="baseDishesId" column="base_dishes_id"/>-->
<!--        <result property="canteenId" column="canteen_id"/>-->
<!--        <result property="shopstallId" column="shopstall_id"/>-->
<!--        <collection property="dishesId" ofType="java.lang.Long">-->
<!--            <result property="dishesId" column="dishes_id"/>-->
<!--        </collection>-->
<!--    </resultMap>-->


<!--    <select id="getBaseDishesDetail" resultType="net.xnzn.core.menu.dto.MenuBaseDishesDetail">-->
<!--        select t1.dishes_name, t2.base_dishes_id, t2.canteen_id, t2.shopstall_id,t2.dishes_id-->
<!--        from menu_dishes t2-->
<!--                 left join menu_dishes_base t1 on t1.base_dishes_id = t2.base_dishes_id-->
<!--        where t2.del_flag = 2 and t2.base_dishes_id in-->
<!--        <foreach collection="baseDishesIdList" item="baseDishesId" separator="," open="(" close=")">-->
<!--            #{baseDishesId}-->
<!--        </foreach>-->
<!--    </select>-->
</mapper>
