<?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.zbkj.service.dao.HomeDao">

    <select id="selectPageSetMealType" resultType="com.zbkj.common.response.SetMealResponse">
        select t.id cid, t.name from (
           select c.id, c.name, c.sort from eb_home h
           inner join eb_home_item hp on h.id = hp.home_id
           inner join eb_category c on h.business = c.id
           where h.del_flag = 1 and hp.del_flag = 1 and FIND_IN_SET(2, h.channel)
           group by h.business
        ) t order by t.sort
    </select>

    <select id="selectPageFloor" resultType="com.zbkj.common.vo.HomeVo">
        select h.id, h.name, h.title, h.img_url imgUrl, h.jump_type jumpType, h.jump_url jumpUrl, h.jump_ids jumpIds
        from eb_home h
        where FIND_IN_SET(${entity.channel}, h.channel)
        <if test="entity.channel == 2 and entity.cid != null"> and h.business = #{entity.cid} </if>
        order by order_no
    </select>

</mapper>
