<?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.allocation.canteen.mapper.AllocKindMapper">

    <!-- 分页查询品类列表 -->
    <select id="pageKind" resultType="com.bonus.canteen.core.allocation.canteen.vo.AllocKindVO">
        SELECT
            kind_name
        FROM
            alloc_kind
        <where>
            <if test="kindName != null and kindName != ''">
                kind_name LIKE #{kindName}
            </if>
        </where>
        GROUP BY kind_name
        ORDER BY kind_name DESC
    </select>

    <!-- 查询品类列表 -->
    <select id="listKindByNameList" resultType="com.bonus.canteen.core.allocation.canteen.model.AllocKind">
        SELECT
            *
        FROM
            alloc_kind
        WHERE
            kind_name IN
            <foreach collection="kindNameList" item="kindName" separator="," open="(" close=")">
                #{kindName}
            </foreach>
    </select>

</mapper>