OrdersGiftCardMapper.xml 1.03 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.OrdersGiftCardMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.OrdersGiftCard" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="order_code" property="orderCode" jdbcType="BIGINT" />
    <result column="code" property="code" jdbcType="VARCHAR" />
    <result column="pay_amount" property="payAmount" jdbcType="DECIMAL" />
    <result column="pay_shipping_amount" property="payShippingAmount" jdbcType="DECIMAL" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, order_code, code, pay_amount, pay_shipping_amount, create_time
  </sql>

  <select id="selectPayShippingAmount" resultType="java.math.BigDecimal">
    select IFNULL(sum(pay_shipping_amount), 0) from orders_gift_card where order_code = #{orderCode}
  </select>
</mapper>