Commit 65b47801553b04ce120a37868f8fed7bc388cb95

Authored by zhangxing
1 parent f4557a82

orderItem 核心xml

src/main/resources/mapping/com/diligrp/xtrade/order/OrderItemDao.xml
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="com.diligrp.xtrade.order.dao.OrderItemDao">
4   -
5   -
6   -
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.diligrp.xtrade.order.dao.OrderItemDao">
  4 +
  5 + <sql id="QUERY_COLUMN_LIST">
  6 + <![CDATA[
  7 + `item_id` AS itemId, `order_id` AS orderId, `product_name` AS productName, `product_id` AS productId, `cate_id` AS cateId, `cate_name` AS cateName, `price`, `amount`, `sale_unit` AS saleUnit, `unit_weight` AS unitWeight, `scommission`, `bcommission`, `rule_id` ruleId, `rule_rate` ruleRate, `weight`, `total_money` AS totalMoney
  8 + ]]>
  9 + </sql>
  10 +
  11 + <select id="selectOrderItemByItemId" parameterType="long" resultType="orderItemDo">
  12 + SELECT
  13 + <include refid="QUERY_COLUMN_LIST"/>
  14 + FROM `xt_order_item`
  15 + WHERE item_id =#{itemId}
  16 + </select>
  17 +
  18 + <select id="selectOrderItemByOrderId" parameterType="long" resultType="orderItemDo">
  19 + SELECT
  20 + <include refid="QUERY_COLUMN_LIST"/>
  21 + FROM `xt_order_item`
  22 + WHERE order_id =#{orderId}
  23 + </select>
  24 +
  25 + <update id="updateSellerCommission">
  26 + UPDATE `xt_order_item` SET `scommission`=#{scommission}, `bcommission`=#{bcommission}, `rule_id`=#{ruleId}, `rule_rate`=#{ruleRate},modified_time = NOW() WHERE item_id = #{itemId}
  27 + </update>
  28 +
7 29 </mapper>
8 30 \ No newline at end of file
... ...