OrdersCouponsMapper.xml 1.25 KB
<?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.yoho.unions.dal.OrdersCouponsMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.OrdersCoupons" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="order_code" property="orderCode" jdbcType="BIGINT" />
    <result column="coupon_id" property="couponId" jdbcType="INTEGER" />
    <result column="coupon_code" property="couponCode" jdbcType="VARCHAR" />
    <result column="coupon_amount" property="couponAmount" jdbcType="DECIMAL" />
    <result column="coupon_adjust_amount" property="couponAdjustAmount" jdbcType="DECIMAL" />
    <result column="coupon_title" property="couponTitle" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, order_code, coupon_id, coupon_code, coupon_amount, coupon_adjust_amount, coupon_title, 
    create_time
  </sql>
  <select id="selectByOrderCode" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from orders_coupons
    where order_code = #{orderCode,jdbcType=BIGINT}
  </select>

</mapper>