<?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.reta.RetaOrderExpressesDao">

    <resultMap id="OrderMap" type="com.zm.order.tool.server.model.RetaOrderExpress">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="order_id" jdbcType="BIGINT" property="orderId"/>
        <result column="express_no" jdbcType="VARCHAR" property="expressNo"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
        <result column="user_id" jdbcType="INTEGER" property="userId"/>
        <result column="express_id" jdbcType="INTEGER" property="expressId"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="express_name" jdbcType="VARCHAR" property="expressName"/>
    </resultMap>

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

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

    <sql id="cols_exclude_id">
        order_id,
        express_no,
        remark,
        user_id,
        express_id,
        created_at,
        updated_at,
        order_no,
        express_name
    </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>