|
@@ -2,17 +2,17 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.caimei.modules.order.dao.NewOrderDao">
|
|
<mapper namespace="com.caimei.modules.order.dao.NewOrderDao">
|
|
<resultMap id="cmOrderPaymentVoucherVoResult" type="com.caimei.modules.order.entity.CmOrderPaymentVoucherVo">
|
|
<resultMap id="cmOrderPaymentVoucherVoResult" type="com.caimei.modules.order.entity.CmOrderPaymentVoucherVo">
|
|
- <id property="id" column="id" />
|
|
|
|
- <result property="orderId" column="orderId" />
|
|
|
|
- <result property="remarks" column="remarks" />
|
|
|
|
- <result property="addTime" column="addTime" />
|
|
|
|
- <collection property="images" javaType="java.util.List" resultMap="cmVoucherImageResult" />
|
|
|
|
|
|
+ <id property="id" column="id"/>
|
|
|
|
+ <result property="orderId" column="orderId"/>
|
|
|
|
+ <result property="remarks" column="remarks"/>
|
|
|
|
+ <result property="addTime" column="addTime"/>
|
|
|
|
+ <collection property="images" javaType="java.util.List" resultMap="cmVoucherImageResult"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="cmVoucherImageResult" type="com.caimei.modules.order.entity.CmVoucherImage">
|
|
<resultMap id="cmVoucherImageResult" type="com.caimei.modules.order.entity.CmVoucherImage">
|
|
- <id property="id" column="i.id" />
|
|
|
|
- <result property="voucherId" column="v.id"/>
|
|
|
|
- <result property="image" column="image" />
|
|
|
|
|
|
+ <id property="id" column="i.id"/>
|
|
|
|
+ <result property="voucherId" column="v.id"/>
|
|
|
|
+ <result property="image" column="image"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="columns">
|
|
<sql id="columns">
|
|
@@ -647,8 +647,8 @@
|
|
|
|
|
|
<update id="updateStatus" parameterType="NewOrder">
|
|
<update id="updateStatus" parameterType="NewOrder">
|
|
UPDATE cm_order
|
|
UPDATE cm_order
|
|
- SET status = #{status},
|
|
|
|
- closeTime = NOW(),
|
|
|
|
|
|
+ SET status = #{status},
|
|
|
|
+ closeTime = NOW(),
|
|
closeReason = #{closeReason}
|
|
closeReason = #{closeReason}
|
|
WHERE orderID = #{orderID}
|
|
WHERE orderID = #{orderID}
|
|
</update>
|
|
</update>
|
|
@@ -1297,12 +1297,13 @@
|
|
cop.productType,
|
|
cop.productType,
|
|
p.productCategory as productCategory,
|
|
p.productCategory as productCategory,
|
|
p.splitCode,
|
|
p.splitCode,
|
|
- cop.shopPercent,
|
|
|
|
- cop.cmPercent,
|
|
|
|
- cop.organizePercent
|
|
|
|
|
|
+ cs.shopPercent,
|
|
|
|
+ cs.cmPercent,
|
|
|
|
+ cs.organizePercent
|
|
FROM cm_order_product cop
|
|
FROM cm_order_product cop
|
|
LEFT JOIN product p ON cop.productID = p.productID
|
|
LEFT JOIN product p ON cop.productID = p.productID
|
|
left join cm_order co on co.orderID = cop.orderID
|
|
left join cm_order co on co.orderID = cop.orderID
|
|
|
|
+ left join cm_sku cs on cop.skuId = cs.skuId
|
|
WHERE cop.shopOrderID = #{shopOrderId}
|
|
WHERE cop.shopOrderID = #{shopOrderId}
|
|
AND IF(co.userBeans = 0, 1 = 1, cop.shopid != 998)
|
|
AND IF(co.userBeans = 0, 1 = 1, cop.shopid != 998)
|
|
group by p.productID
|
|
group by p.productID
|
|
@@ -1436,17 +1437,21 @@
|
|
where orderId = #{orderId}
|
|
where orderId = #{orderId}
|
|
</select>
|
|
</select>
|
|
<select id="getSplitTime" resultType="java.lang.Integer">
|
|
<select id="getSplitTime" resultType="java.lang.Integer">
|
|
- SELECT COUNT(*) FROM cm_split_account WHERE shopOrderId=#{shopOrderId}
|
|
|
|
- AND DATE_ADD(splitTime,INTERVAL 1 DAY) <![CDATA[ < ]]> now()
|
|
|
|
|
|
+ SELECT COUNT(*)
|
|
|
|
+ FROM cm_split_account
|
|
|
|
+ WHERE shopOrderId = #{shopOrderId}
|
|
|
|
+ AND DATE_ADD(splitTime, INTERVAL 1 DAY) <![CDATA[ < ]]> now()
|
|
</select>
|
|
</select>
|
|
<select id="findVoucherVoOrderID" resultMap="cmOrderPaymentVoucherVoResult">
|
|
<select id="findVoucherVoOrderID" resultMap="cmOrderPaymentVoucherVoResult">
|
|
--- SELECT * from cm_order_payment_voucher v
|
|
|
|
- SELECT v.*,i.* from cm_order_payment_voucher v
|
|
|
|
- LEFT JOIN cm_voucher_image i on i.voucherId=v.id
|
|
|
|
|
|
+ -- SELECT * from cm_order_payment_voucher v
|
|
|
|
+ SELECT v.*, i.*
|
|
|
|
+ from cm_order_payment_voucher v
|
|
|
|
+ LEFT JOIN cm_voucher_image i on i.voucherId = v.id
|
|
where shopOrderId = #{shopOrderId}
|
|
where shopOrderId = #{shopOrderId}
|
|
</select>
|
|
</select>
|
|
<select id="findCmVoucherImageoOrderID" resultType="com.caimei.modules.order.entity.CmVoucherImage">
|
|
<select id="findCmVoucherImageoOrderID" resultType="com.caimei.modules.order.entity.CmVoucherImage">
|
|
- SELECT * from cm_voucher_image
|
|
|
|
|
|
+ SELECT *
|
|
|
|
+ from cm_voucher_image
|
|
where voucherId = #{id}
|
|
where voucherId = #{id}
|
|
</select>
|
|
</select>
|
|
<insert id="insertSplitAccount">
|
|
<insert id="insertSplitAccount">
|