package com.prolog.eis.dao.out.shelves.area;

import com.prolog.eis.model.shelves.CategoryAreaNo;
import com.prolog.framework.dao.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CategoryAreaNoMapper extends BaseMapper<CategoryAreaNo> {

    @Select("<script>" +
            "select a.id,a.item_health_category itemHealthCategory,a.item_health_category_name itemHealthCategoryName," +
            " a.area_no areaNo, a.create_time createTime from category_area_no a" +
            "<if test=\"itemHealthCategoryName!=null and itemHealthCategoryName!=''\"> " +
            " and a.item_health_category_name like concat('%', #{itemHealthCategoryName},'%') " +
            "</if> " +
            "</script>")
    List<CategoryAreaNo> query(@Param("itemHealthCategoryName") String itemHealthCategoryName);
    
    @Select("SELECT DISTINCT t.`area_no` FROM category_area_no t")
    List<String> getAllAreaNo();
}
