<?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.ruoyi.predict.mapper.EnumMenuItemMapper">

    <resultMap type="EnumMenuItem" id="EnumMenuItemResult">
        <result property="menuNo" column="menu_no"/>
        <result property="itemNo" column="item_no"/>
        <result property="itemName" column="item_name"/>
        <result property="itemVal" column="item_val"/>
    </resultMap>

    <sql id="selectEnumMenuItemVo">
        select menu_no, item_no, item_name, item_val from enum_menu_item
    </sql>

    <select id="selectEnumMenuItemList" parameterType="EnumMenuItem" resultMap="EnumMenuItemResult">
        <include refid="selectEnumMenuItemVo"/>
        <where>
            <if test="menuNo != null ">and menu_no = #{menuNo}</if>
            <if test="itemNo != null ">and item_no = #{itemNo}</if>
            <if test="itemName != null  and itemName != ''">and item_name like concat(concat('%', #{itemName}), '%')
            </if>
            <if test="itemVal != null ">and item_val = #{itemVal}</if>
        </where>
    </select>

    <select id="selectEnumMenuItemById" parameterType="Long" resultMap="EnumMenuItemResult">
        <include refid="selectEnumMenuItemVo"/>
        where item_no = #{itemNo}
    </select>

    <select id="selectEnumMenuItemByMenuNo" parameterType="Long" resultMap="EnumMenuItemResult">
        <include refid="selectEnumMenuItemVo"/>
        where menu_no = #{menuNo} and item_no = #{itemNo}
    </select>

    <select id="selectEnumMenuItemByMenuNoList" parameterType="Long" resultMap="EnumMenuItemResult">
        <include refid="selectEnumMenuItemVo"/>
        where menu_no = #{menuNo}
    </select>

</mapper>