<?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.HsOrderProcessMapper">

    <resultMap type="HsOrderProcess" id="HsOrderProcessResult">
        <result property="id" column="id"/>
        <result property="orderNo" column="order_no"/>
        <result property="processNum" column="process_num"/>
        <result property="processStatus" column="process_status"/>
        <result property="processDesc" column="process_desc"/>
        <result property="processDate" column="process_date"/>
        <result property="userCode" column="user_code"/>
        <result property="isDelete" column="is_delete"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
    </resultMap>

    <sql id="selectHsOrderProcessVo">
        select id,
               order_no,
               process_num,
               process_status,
               process_desc,
               process_date,
               user_code,
               is_delete,
               create_by,
               create_time,
               update_by,
               update_time,
               remark
        from hs_order_process
    </sql>

    <select id="selectHsOrderProcessList" parameterType="HsOrderProcess" resultMap="HsOrderProcessResult">
        <include refid="selectHsOrderProcessVo"/>
        <where>
            is_delete = 0 and order_no = #{orderNo}
            <if test="orderNo != null  and orderNo != ''"></if>
            <if test="processNum != null ">and process_num = #{processNum}</if>
            <if test="processDesc != null  and processDesc != ''">and process_desc = #{processDesc}</if>
            <if test="processDate != null ">and process_date like concat('%', #{processDate}, '%')</if>
            <if test="userCode != null  and userCode != ''">and user_code like concat('%', #{userCode}, '%')</if>
        </where>
    </select>

</mapper>
