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

    <resultMap id="JuiceOrderMap" type="com.zm.order.tool.server.model.OrderBaoZhuDiscount">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="discount_type" jdbcType="VARCHAR" property="discountType"/>
        <result column="discount_detail" jdbcType="VARCHAR" property="discountDetail"/>
        <result column="discount_name" jdbcType="VARCHAR" property="discountName"/>
        <result column="amount" jdbcType="DECIMAL" property="amount"/>
    </resultMap>

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

    <sql id="cols_all">
        id,
        order_no,
        discount_type,
        discount_detail,
        discount_name,
        amount
    </sql>

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