<?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.tempdb.OrderBaoZhuItemDao">

    <resultMap id="JuiceOrderMap" type="com.zm.order.tool.server.model.OrderBaoZhuItem">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="store_name" jdbcType="VARCHAR" property="storeName"/>
        <result column="item_sign" jdbcType="VARCHAR" property="itemSign"/>
        <result column="order_status_txt" jdbcType="VARCHAR" property="orderStatusTxt"/>
        <result column="pay_type_txt" jdbcType="VARCHAR" property="payTypeTxt"/>
        <result column="item_type_txt" jdbcType="VARCHAR" property="itemTypeTxt"/>
        <result column="item_name" jdbcType="VARCHAR" property="itemName"/>
        <result column="spec" jdbcType="VARCHAR" property="spec"/>
        <result column="method" jdbcType="VARCHAR" property="method"/>
        <result column="item_price" jdbcType="DECIMAL" property="itemPrice"/>
        <result column="num" jdbcType="INTEGER" property="num"/>
        <result column="unit" jdbcType="VARCHAR" property="unit"/>
        <result column="item_amount" jdbcType="DECIMAL" property="itemAmount"/>
        <result column="method_price" jdbcType="DECIMAL" property="methodPrice"/>
        <result column="total_amount" jdbcType="DECIMAL" property="totalAmount"/>
        <result column="cate" jdbcType="VARCHAR" property="cate"/>
        <result column="accept_name" jdbcType="VARCHAR" property="acceptName"/>
        <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
    </resultMap>

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

    <sql id="cols_all">
        id,
        order_no,
        store_name,
        item_sign,
        order_status_txt,
        pay_type_txt,
        item_type_txt,
        item_name,
        spec,
        method,
        item_price,
        num,
        unit,
        item_amount,
        method_price,
        total_amount,
        cate,
        accept_name,
        mobile
    </sql>

    <select id="selectByOrderNo" parameterType="map" resultMap="JuiceOrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        where
        order_no = #{orderNo} and pay_type_txt = #{payTypeTxt}
    </select>
</mapper>