<?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.willalp.canteen.mapper.HsCanteenEvaluateMapper">

    <resultMap type="HsCanteenEvaluate" id="HsCanteenEvaluateResult">
        <result property="evaluateId"    column="evaluate_id"    />
        <result property="evaluateNumber"    column="evaluate_number"    />
        <result property="menuNumber"    column="menu_number"    />
        <result property="cuisineNumber"    column="cuisine_number"    />
        <result property="cuisineName"    column="cuisine_name"    />
        <result property="cuisineScore"    column="cuisine_score"    />
        <result property="evaluateReason"    column="evaluate_reason"    />
        <result property="submitTime"    column="submit_time"    />
        <result property="isDelete"    column="is_delete"    />
    </resultMap>

    <sql id="selectHsCanteenEvaluateVo">
        select evaluate_id, evaluate_number, menu_number, cuisine_number, cuisine_name, cuisine_score, evaluate_reason, submit_time, is_delete from hs_canteen_evaluate
    </sql>

    <select id="selectHsCanteenEvaluateList" parameterType="HsCanteenEvaluate" resultMap="HsCanteenEvaluateResult">
        <include refid="selectHsCanteenEvaluateVo"/>
        <where>
            is_delete = 0
            <if test="evaluateNumber != null  and evaluateNumber != ''"> and evaluate_number = #{evaluateNumber}</if>
            <if test="menuNumber != null  and menuNumber != ''"> and menu_number = #{menuNumber}</if>
            <if test="cuisineNumber != null  and cuisineNumber != ''"> and cuisine_number = #{cuisineNumber}</if>
            <if test="cuisineName != null  and cuisineName != ''"> and cuisine_name like concat('%', #{cuisineName}, '%')</if>
<!--            <if test="params.beginSubmitTime != null and params.beginSubmitTime != '' and params.endSubmitTime != null and params.endSubmitTime != ''"> and submit_time between #{params.beginSubmitTime} and #{params.endSubmitTime}</if>-->
        </where>
    </select>
</mapper>
