OrdersFreightCouponsMapper.xml
1.54 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.OrdersFreightCouponsMapper" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.OrdersFreightCoupons" >
<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_type" property="couponType" jdbcType="TINYINT" />
<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="fee_sharing_type" property="feeSharingType" jdbcType="TINYINT" />
<result column="fee_sharing_ratio" property="feeSharingRatio" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, order_code, coupon_id, coupon_type, coupon_code, coupon_amount, coupon_adjust_amount,
coupon_title, fee_sharing_type, fee_sharing_ratio, create_time
</sql>
<select id="selectCouponAmount" resultType="java.math.BigDecimal">
select IFNULL(sum(coupon_amount),0) from orders_freight_coupons where order_code = #{orderCode}
</select>
</mapper>