<?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.zm.order.tool.server.cy.WmKoubeiOrdersDao">

    <resultMap id="OrderMap" type="com.zm.order.tool.server.model.WmKoubeiOrders">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="order_id" jdbcType="BIGINT" property="orderId"/>
        <result column="koubei_order_id" jdbcType="VARCHAR" property="koubeiOrderId"/>
        <result column="source" jdbcType="INTEGER" property="source"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
        <result column="order_print_time" jdbcType="VARCHAR" property="orderPrintTime"/>
        <result column="take_order_time" jdbcType="VARCHAR" property="takeOrderTime"/>
        <result column="is_reserve" jdbcType="INTEGER" property="isReserve"/>
        <result column="last_status" jdbcType="INTEGER" property="lastStatus"/>
        <result column="is_verify" jdbcType="INTEGER" property="isVerify"/>
        <result column="is_to_go" jdbcType="INTEGER" property="isToGo"/>
        <result column="is_dinner" jdbcType="INTEGER" property="isDinner"/>
        <result column="is_send" jdbcType="INTEGER" property="isSend"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
    </resultMap>

    <sql id="tb">
        wm_koubei_orders
    </sql>

    <sql id="cols_all">
        id,
        <include refid="cols_exclude_id"/>
    </sql>

    <sql id="cols_exclude_id">
        order_id,
        koubei_order_id,
        source,
        created_at,
        updated_at,
        order_print_time,
        take_order_time,
        is_reserve,
        last_status,
        is_verify,
        is_to_go,
        is_dinner,
        is_send,
        order_no
    </sql>

    <select id="selectOne" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        where order_no = #{orderNo} limit 1
    </select>

</mapper>