|
@@ -2,8 +2,8 @@
|
|
|
<!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.CmReturnedPurchaseDao">
|
|
|
|
|
|
- <sql id="cmReturnedPurchaseColumns">
|
|
|
- a.id AS "id",
|
|
|
+ <sql id="cmReturnedPurchaseColumns">
|
|
|
+ a.id AS "id",
|
|
|
a.returnedNo AS "returnedNo",
|
|
|
a.orderID AS "orderID",
|
|
|
a.userID AS "userID",
|
|
@@ -42,431 +42,449 @@
|
|
|
c.name as "name",
|
|
|
c.userOrganizeID as "userOrganizeId",
|
|
|
ifnull(a.refundType,1) as "refundType"
|
|
|
- </sql>
|
|
|
+ </sql>
|
|
|
|
|
|
- <sql id="cmReturnedPurchaseJoins">
|
|
|
- left join cm_order as b on a.orderID = b.orderID
|
|
|
+ <sql id="cmReturnedPurchaseJoins">
|
|
|
+ left join cm_order as b on a.orderID = b.orderID
|
|
|
left join user as c on a.userID = c.userID
|
|
|
- </sql>
|
|
|
+ </sql>
|
|
|
|
|
|
- <select id="get" resultType="CmReturnedPurchase">
|
|
|
- SELECT
|
|
|
- <include refid="cmReturnedPurchaseColumns"/>
|
|
|
- FROM cm_returned_purchase a
|
|
|
- <include refid="cmReturnedPurchaseJoins"/>
|
|
|
- WHERE a.id = #{id}
|
|
|
+ <select id="get" resultType="CmReturnedPurchase">
|
|
|
+ SELECT
|
|
|
+ <include refid="cmReturnedPurchaseColumns"/>
|
|
|
+ FROM cm_returned_purchase a
|
|
|
+ <include refid="cmReturnedPurchaseJoins"/>
|
|
|
+ WHERE a.id = #{id}
|
|
|
and a.delFlag = 0
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
|
|
|
- <!--查询排除当前撤销的退货退款记录-->
|
|
|
- <select id="findReturnedPurchaseRecord" resultType="CmReturnedPurchase">
|
|
|
- SELECT
|
|
|
- a.*
|
|
|
- FROM cm_returned_purchase a
|
|
|
- <where>
|
|
|
- <if test="id != null and id != ''">
|
|
|
- AND a.id != #{id}
|
|
|
- </if>
|
|
|
- <if test="orderID != null and orderID != ''">
|
|
|
- AND a.orderID = #{orderID}
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND a.status = #{status}
|
|
|
- </if>
|
|
|
- and a.delFlag = 0
|
|
|
- </where>
|
|
|
- </select>
|
|
|
+ <!--查询排除当前撤销的退货退款记录-->
|
|
|
+ <select id="findReturnedPurchaseRecord" resultType="CmReturnedPurchase">
|
|
|
+ SELECT
|
|
|
+ a.*
|
|
|
+ FROM cm_returned_purchase a
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ AND a.id != #{id}
|
|
|
+ </if>
|
|
|
+ <if test="orderID != null and orderID != ''">
|
|
|
+ AND a.orderID = #{orderID}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND a.status = #{status}
|
|
|
+ </if>
|
|
|
+ and a.delFlag = 0
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
- <!--只查询审核通过的数据-->
|
|
|
- <select id="findListBuySuccess" resultType="CmReturnedPurchase">
|
|
|
- SELECT
|
|
|
- a.*
|
|
|
- FROM cm_returned_purchase a
|
|
|
- <where>
|
|
|
- <if test="id != null and id != ''">
|
|
|
- AND a.id = #{id}
|
|
|
- </if>
|
|
|
- <if test="orderID != null and orderID != ''">
|
|
|
- AND a.orderID = #{orderID}
|
|
|
- </if>
|
|
|
- AND a.status = 2
|
|
|
- and a.delFlag = 0
|
|
|
- </where>
|
|
|
- </select>
|
|
|
+ <!--只查询审核通过的数据-->
|
|
|
+ <select id="findListBuySuccess" resultType="CmReturnedPurchase">
|
|
|
+ SELECT
|
|
|
+ a.*
|
|
|
+ FROM cm_returned_purchase a
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ AND a.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="orderID != null and orderID != ''">
|
|
|
+ AND a.orderID = #{orderID}
|
|
|
+ </if>
|
|
|
+ AND a.status = 2
|
|
|
+ and a.delFlag = 0
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
- <select id="findList" resultType="CmReturnedPurchase">
|
|
|
- SELECT
|
|
|
- <include refid="cmReturnedPurchaseColumns"/>
|
|
|
- ,s.name AS "applicationUserName",
|
|
|
- s1.name AS "reviewUserName",
|
|
|
- co.organizeID AS "organizeID",
|
|
|
- f.bankAccount as bankNameType
|
|
|
- FROM cm_returned_purchase a
|
|
|
- LEFT JOIN sys_user s on s.id = a.applicationUserID
|
|
|
- LEFT JOIN sys_user s1 on s1.id = a.reviewUserID
|
|
|
- LEFT JOIN cm_order co ON a.orderID=co.orderID
|
|
|
- LEFT JOIN cm_offline_collection f ON a.payType = f.type
|
|
|
- <include refid="cmReturnedPurchaseJoins"/>
|
|
|
- <where>
|
|
|
- <if test="organizeID != null and organizeID != ''">
|
|
|
- AND co.organizeID = #{organizeID}
|
|
|
- </if>
|
|
|
- <if test="orderType == 2">
|
|
|
- AND co.orderType = 2
|
|
|
- </if>
|
|
|
+ <select id="findList" resultType="CmReturnedPurchase">
|
|
|
+ SELECT
|
|
|
+ <include refid="cmReturnedPurchaseColumns"/>
|
|
|
+ ,s.name AS "applicationUserName",
|
|
|
+ s1.name AS "reviewUserName",
|
|
|
+ co.organizeID AS "organizeID",
|
|
|
+ f.bankAccount as bankNameType
|
|
|
+ FROM cm_returned_purchase a
|
|
|
+ LEFT JOIN sys_user s on s.id = a.applicationUserID
|
|
|
+ LEFT JOIN sys_user s1 on s1.id = a.reviewUserID
|
|
|
+ LEFT JOIN cm_order co ON a.orderID=co.orderID
|
|
|
+ LEFT JOIN cm_offline_collection f ON a.payType = f.type
|
|
|
+ <include refid="cmReturnedPurchaseJoins"/>
|
|
|
+ <where>
|
|
|
+ <if test="organizeID != null and organizeID != ''">
|
|
|
+ AND co.organizeID = #{organizeID}
|
|
|
+ </if>
|
|
|
+ <if test="orderType == 2">
|
|
|
+ AND co.orderType = 2
|
|
|
+ </if>
|
|
|
<if test="id != null and id != ''">
|
|
|
AND a.id = #{id}
|
|
|
</if>
|
|
|
- <if test="returnedNo != null and returnedNo != ''">
|
|
|
- AND a.returnedNo = #{returnedNo}
|
|
|
- </if>
|
|
|
- <if test="orderID != null and orderID != ''">
|
|
|
- AND a.orderID = #{orderID}
|
|
|
- </if>
|
|
|
- <if test="userID != null and userID != ''">
|
|
|
- AND a.userID = #{userID}
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND a.status = #{status}
|
|
|
- </if>
|
|
|
- <if test="returnTime != null and returnTime != ''">
|
|
|
- AND a.returnTime = #{returnTime}
|
|
|
- </if>
|
|
|
- <if test="confirmReturnTime != null and confirmReturnTime != ''">
|
|
|
- AND a.confirmReturnTime = #{confirmReturnTime}
|
|
|
- </if>
|
|
|
- <if test="beginTime != null and beginTime != ''">
|
|
|
- AND returnTime <![CDATA[ >= ]]> #{beginTime}
|
|
|
- </if>
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
- AND returnTime <![CDATA[ <= ]]> #{endTime}
|
|
|
- </if>
|
|
|
- <if test="beginConfirmReturnTime != null and beginConfirmReturnTime != ''">
|
|
|
- AND STR_TO_DATE(confirmReturnTime,'%Y-%m-%d %H:%i') <![CDATA[ > ]]> STR_TO_DATE(#{beginConfirmReturnTime},'%Y-%m-%d %H:%i')
|
|
|
- </if>
|
|
|
- <if test="endConfirmReturnTime != null and endConfirmReturnTime != ''">
|
|
|
- AND STR_TO_DATE(confirmReturnTime,'%Y-%m-%d %H:%i') <![CDATA[ < ]]> STR_TO_DATE(#{endConfirmReturnTime},'%Y-%m-%d %H:%i')
|
|
|
- </if>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- AND c.name like
|
|
|
- <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
|
- <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
|
- <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
|
- </if>
|
|
|
- <if test="orderNo != null and orderNo != ''">
|
|
|
- AND b.orderNo = #{orderNo}
|
|
|
- </if>
|
|
|
+ <if test="returnedNo != null and returnedNo != ''">
|
|
|
+ AND a.returnedNo = #{returnedNo}
|
|
|
+ </if>
|
|
|
+ <if test="orderID != null and orderID != ''">
|
|
|
+ AND a.orderID = #{orderID}
|
|
|
+ </if>
|
|
|
+ <if test="userID != null and userID != ''">
|
|
|
+ AND a.userID = #{userID}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="returnTime != null and returnTime != ''">
|
|
|
+ AND a.returnTime = #{returnTime}
|
|
|
+ </if>
|
|
|
+ <if test="confirmReturnTime != null and confirmReturnTime != ''">
|
|
|
+ AND a.confirmReturnTime = #{confirmReturnTime}
|
|
|
+ </if>
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
+ AND returnTime <![CDATA[ >= ]]> #{beginTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND returnTime <![CDATA[ <= ]]> #{endTime}
|
|
|
+ </if>
|
|
|
+ <if test="beginConfirmReturnTime != null and beginConfirmReturnTime != ''">
|
|
|
+ AND STR_TO_DATE(confirmReturnTime,'%Y-%m-%d %H:%i') <![CDATA[ > ]]>
|
|
|
+ STR_TO_DATE(#{beginConfirmReturnTime},'%Y-%m-%d %H:%i')
|
|
|
+ </if>
|
|
|
+ <if test="endConfirmReturnTime != null and endConfirmReturnTime != ''">
|
|
|
+ AND STR_TO_DATE(confirmReturnTime,'%Y-%m-%d %H:%i') <![CDATA[ < ]]>
|
|
|
+ STR_TO_DATE(#{endConfirmReturnTime},'%Y-%m-%d %H:%i')
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND c.name like
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ AND b.orderNo = #{orderNo}
|
|
|
+ </if>
|
|
|
and a.delFlag = 0
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- order by a.returnTime desc
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ order by a.returnTime desc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findAllList" resultType="CmReturnedPurchase">
|
|
|
- SELECT
|
|
|
- <include refid="cmReturnedPurchaseColumns"/>
|
|
|
- FROM cm_returned_purchase a
|
|
|
- <include refid="cmReturnedPurchaseJoins"/>
|
|
|
- <where>
|
|
|
- a.delFlag = 0
|
|
|
- </where>
|
|
|
- <choose>
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </select>
|
|
|
+ <select id="findAllList" resultType="CmReturnedPurchase">
|
|
|
+ SELECT
|
|
|
+ <include refid="cmReturnedPurchaseColumns"/>
|
|
|
+ FROM cm_returned_purchase a
|
|
|
+ <include refid="cmReturnedPurchaseJoins"/>
|
|
|
+ <where>
|
|
|
+ a.delFlag = 0
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
|
|
|
- <insert id="insert" parameterType="CmReturnedPurchase" keyProperty="id" useGeneratedKeys="true">
|
|
|
- INSERT INTO cm_returned_purchase(
|
|
|
- returnedNo,
|
|
|
- orderID,
|
|
|
- userID,
|
|
|
- status,
|
|
|
- returnedWay,
|
|
|
- payType,
|
|
|
- operatingOrderStatus,
|
|
|
- bankAccountName,
|
|
|
- bankAccountNo,
|
|
|
- openBank,
|
|
|
- bankAccountType,
|
|
|
- returnedPurchaseFee,
|
|
|
- refundFee,
|
|
|
- refundBalanceFee,
|
|
|
- refundOnlineFee,
|
|
|
- refundOfflineFee,
|
|
|
- image1,
|
|
|
- image2,
|
|
|
- image3,
|
|
|
- image4,
|
|
|
- image5,
|
|
|
- remarks,
|
|
|
- reviewRemarks,
|
|
|
- applicationUserID,
|
|
|
- returnTime,
|
|
|
- reviewUserID,
|
|
|
- confirmReturnTime,
|
|
|
- refundType
|
|
|
- ) VALUES (
|
|
|
- #{returnedNo},
|
|
|
- #{orderID},
|
|
|
- #{userID},
|
|
|
- #{status},
|
|
|
- #{returnedWay},
|
|
|
- #{payType},
|
|
|
- #{operatingOrderStatus},
|
|
|
- #{bankAccountName},
|
|
|
- #{bankAccountNo},
|
|
|
- #{openBank},
|
|
|
- #{bankAccountType},
|
|
|
- #{returnedPurchaseFee},
|
|
|
- #{refundFee},
|
|
|
- #{refundBalanceFee},
|
|
|
- #{refundOnlineFee},
|
|
|
- #{refundOfflineFee},
|
|
|
- #{image1},
|
|
|
- #{image2},
|
|
|
- #{image3},
|
|
|
- #{image4},
|
|
|
- #{image5},
|
|
|
- #{remarks},
|
|
|
- #{reviewRemarks},
|
|
|
- #{applicationUserID},
|
|
|
- #{returnTime},
|
|
|
- #{reviewUserID},
|
|
|
- #{confirmReturnTime},
|
|
|
- #{refundType}
|
|
|
- )
|
|
|
- </insert>
|
|
|
- <insert id="insertCmRefundRecord">
|
|
|
- insert into cm_refundmoney_record
|
|
|
- (refundAmount,orderRequestNo,shopOrderId)
|
|
|
- values(#{refundAmount},#{orderRequestNo},#{shopOrderId})
|
|
|
- </insert>
|
|
|
+ <insert id="insert" parameterType="CmReturnedPurchase" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ INSERT INTO cm_returned_purchase(returnedNo,
|
|
|
+ orderID,
|
|
|
+ userID,
|
|
|
+ status,
|
|
|
+ returnedWay,
|
|
|
+ payType,
|
|
|
+ operatingOrderStatus,
|
|
|
+ bankAccountName,
|
|
|
+ bankAccountNo,
|
|
|
+ openBank,
|
|
|
+ bankAccountType,
|
|
|
+ returnedPurchaseFee,
|
|
|
+ refundFee,
|
|
|
+ refundBalanceFee,
|
|
|
+ refundOnlineFee,
|
|
|
+ refundOfflineFee,
|
|
|
+ image1,
|
|
|
+ image2,
|
|
|
+ image3,
|
|
|
+ image4,
|
|
|
+ image5,
|
|
|
+ remarks,
|
|
|
+ reviewRemarks,
|
|
|
+ applicationUserID,
|
|
|
+ returnTime,
|
|
|
+ reviewUserID,
|
|
|
+ confirmReturnTime,
|
|
|
+ refundType)
|
|
|
+ VALUES (#{returnedNo},
|
|
|
+ #{orderID},
|
|
|
+ #{userID},
|
|
|
+ #{status},
|
|
|
+ #{returnedWay},
|
|
|
+ #{payType},
|
|
|
+ #{operatingOrderStatus},
|
|
|
+ #{bankAccountName},
|
|
|
+ #{bankAccountNo},
|
|
|
+ #{openBank},
|
|
|
+ #{bankAccountType},
|
|
|
+ #{returnedPurchaseFee},
|
|
|
+ #{refundFee},
|
|
|
+ #{refundBalanceFee},
|
|
|
+ #{refundOnlineFee},
|
|
|
+ #{refundOfflineFee},
|
|
|
+ #{image1},
|
|
|
+ #{image2},
|
|
|
+ #{image3},
|
|
|
+ #{image4},
|
|
|
+ #{image5},
|
|
|
+ #{remarks},
|
|
|
+ #{reviewRemarks},
|
|
|
+ #{applicationUserID},
|
|
|
+ #{returnTime},
|
|
|
+ #{reviewUserID},
|
|
|
+ #{confirmReturnTime},
|
|
|
+ #{refundType})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertCmRefundRecord">
|
|
|
+ insert into cm_refundmoney_record
|
|
|
+ (refundAmount, orderRequestNo, shopOrderId)
|
|
|
+ values (#{refundAmount}, #{orderRequestNo}, #{shopOrderId})
|
|
|
+ </insert>
|
|
|
|
|
|
- <update id="updateRevokeApply">
|
|
|
- UPDATE cm_returned_purchase
|
|
|
- <set>
|
|
|
- status = #{status},
|
|
|
- reviewImage1 = #{reviewImage1},
|
|
|
- reviewImage1 = #{reviewImage2},
|
|
|
- reviewImage1 = #{reviewImage3},
|
|
|
- reviewImage1 = #{reviewImage4},
|
|
|
- reviewImage1 = #{reviewImage5},
|
|
|
- reviewRemarks = #{reviewRemarks},
|
|
|
- applicationUserID = #{applicationUserID},
|
|
|
- confirmReturnTime = #{confirmReturnTime},
|
|
|
- reviewUserID = #{reviewUserID},
|
|
|
- </set>
|
|
|
- WHERE id = #{id}
|
|
|
- </update>
|
|
|
+ <update id="updateRevokeApply">
|
|
|
+ UPDATE cm_returned_purchase
|
|
|
+ <set>
|
|
|
+ status = #{status},
|
|
|
+ reviewImage1 = #{reviewImage1},
|
|
|
+ reviewImage1 = #{reviewImage2},
|
|
|
+ reviewImage1 = #{reviewImage3},
|
|
|
+ reviewImage1 = #{reviewImage4},
|
|
|
+ reviewImage1 = #{reviewImage5},
|
|
|
+ reviewRemarks = #{reviewRemarks},
|
|
|
+ applicationUserID = #{applicationUserID},
|
|
|
+ confirmReturnTime = #{confirmReturnTime},
|
|
|
+ reviewUserID = #{reviewUserID},
|
|
|
+ </set>
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
|
|
|
|
|
|
- <update id="update">
|
|
|
- UPDATE cm_returned_purchase
|
|
|
+ <update id="update">
|
|
|
+ UPDATE cm_returned_purchase
|
|
|
<set>
|
|
|
- <if test="returnedNo != null and returnedNo != ''" >
|
|
|
+ <if test="returnedNo != null and returnedNo != ''">
|
|
|
returnedNo = #{returnedNo},
|
|
|
</if>
|
|
|
- <if test="orderID != null and orderID != ''" >
|
|
|
+ <if test="orderID != null and orderID != ''">
|
|
|
orderID = #{orderID},
|
|
|
</if>
|
|
|
- <if test="userID != null and userID != ''" >
|
|
|
+ <if test="userID != null and userID != ''">
|
|
|
userID = #{userID},
|
|
|
</if>
|
|
|
- <if test="status != null and status != ''" >
|
|
|
+ <if test="status != null and status != ''">
|
|
|
status = #{status},
|
|
|
</if>
|
|
|
- <if test="returnedWay != null and returnedWay != ''" >
|
|
|
+ <if test="returnedWay != null and returnedWay != ''">
|
|
|
returnedWay = #{returnedWay},
|
|
|
</if>
|
|
|
- <if test="payType != null and payType != ''" >
|
|
|
- payType = #{payType},
|
|
|
- </if>
|
|
|
- <if test="operatingOrderStatus != null and operatingOrderStatus != ''" >
|
|
|
- operatingOrderStatus = #{operatingOrderStatus},
|
|
|
- </if>
|
|
|
- <if test="bankAccountName != null and bankAccountName != ''" >
|
|
|
- bankAccountName = #{bankAccountName},
|
|
|
- </if>
|
|
|
- <if test="bankAccountNo != null and bankAccountNo != ''" >
|
|
|
- bankAccountNo = #{bankAccountNo},
|
|
|
- </if>
|
|
|
- <if test="openBank != null and openBank != ''" >
|
|
|
- openBank = #{openBank},
|
|
|
- </if>
|
|
|
- <if test="bankAccountType != null and bankAccountType != ''" >
|
|
|
- bankAccountType = #{bankAccountType},
|
|
|
- </if>
|
|
|
- <if test="returnedPurchaseFee != null " >
|
|
|
+ <if test="payType != null and payType != ''">
|
|
|
+ payType = #{payType},
|
|
|
+ </if>
|
|
|
+ <if test="operatingOrderStatus != null and operatingOrderStatus != ''">
|
|
|
+ operatingOrderStatus = #{operatingOrderStatus},
|
|
|
+ </if>
|
|
|
+ <if test="bankAccountName != null and bankAccountName != ''">
|
|
|
+ bankAccountName = #{bankAccountName},
|
|
|
+ </if>
|
|
|
+ <if test="bankAccountNo != null and bankAccountNo != ''">
|
|
|
+ bankAccountNo = #{bankAccountNo},
|
|
|
+ </if>
|
|
|
+ <if test="openBank != null and openBank != ''">
|
|
|
+ openBank = #{openBank},
|
|
|
+ </if>
|
|
|
+ <if test="bankAccountType != null and bankAccountType != ''">
|
|
|
+ bankAccountType = #{bankAccountType},
|
|
|
+ </if>
|
|
|
+ <if test="returnedPurchaseFee != null ">
|
|
|
returnedPurchaseFee = #{returnedPurchaseFee},
|
|
|
</if>
|
|
|
- <if test="refundFee != null" >
|
|
|
+ <if test="refundFee != null">
|
|
|
refundFee = #{refundFee},
|
|
|
</if>
|
|
|
- <if test="refundBalanceFee != null" >
|
|
|
- refundBalanceFee = #{refundBalanceFee},
|
|
|
- </if>
|
|
|
- <if test="refundOnlineFee != null" >
|
|
|
- refundOnlineFee = #{refundOnlineFee},
|
|
|
- </if>
|
|
|
- <if test="refundOfflineFee != null" >
|
|
|
- refundOfflineFee = #{refundOfflineFee},
|
|
|
- </if>
|
|
|
- <if test="image1 != null and image1 != ''" >
|
|
|
+ <if test="refundBalanceFee != null">
|
|
|
+ refundBalanceFee = #{refundBalanceFee},
|
|
|
+ </if>
|
|
|
+ <if test="refundOnlineFee != null">
|
|
|
+ refundOnlineFee = #{refundOnlineFee},
|
|
|
+ </if>
|
|
|
+ <if test="refundOfflineFee != null">
|
|
|
+ refundOfflineFee = #{refundOfflineFee},
|
|
|
+ </if>
|
|
|
+ <if test="image1 != null and image1 != ''">
|
|
|
image1 = #{image1},
|
|
|
</if>
|
|
|
- <if test="image2 != null and image2 != ''" >
|
|
|
+ <if test="image2 != null and image2 != ''">
|
|
|
image2 = #{image2},
|
|
|
</if>
|
|
|
- <if test="image3 != null and image3 != ''" >
|
|
|
+ <if test="image3 != null and image3 != ''">
|
|
|
image3 = #{image3},
|
|
|
</if>
|
|
|
- <if test="image4 != null and image4 != ''" >
|
|
|
+ <if test="image4 != null and image4 != ''">
|
|
|
image4 = #{image4},
|
|
|
</if>
|
|
|
- <if test="image5 != null and image5 != ''" >
|
|
|
+ <if test="image5 != null and image5 != ''">
|
|
|
image5 = #{image5},
|
|
|
</if>
|
|
|
- <if test="remarks != null and remarks != ''" >
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
remarks = #{remarks},
|
|
|
</if>
|
|
|
- <if test="reviewRemarks != null and reviewRemarks != ''" >
|
|
|
- reviewRemarks = #{reviewRemarks},
|
|
|
- </if>
|
|
|
- <if test="applicationUserID != null and applicationUserID != ''" >
|
|
|
- applicationUserID = #{applicationUserID},
|
|
|
- </if>
|
|
|
- <if test="reviewUserID != null and reviewUserID != ''" >
|
|
|
- reviewUserID = #{reviewUserID},
|
|
|
- </if>
|
|
|
- <if test="reviewImage1 != null and reviewImage1 != ''" >
|
|
|
+ <if test="reviewRemarks != null and reviewRemarks != ''">
|
|
|
+ reviewRemarks = #{reviewRemarks},
|
|
|
+ </if>
|
|
|
+ <if test="applicationUserID != null and applicationUserID != ''">
|
|
|
+ applicationUserID = #{applicationUserID},
|
|
|
+ </if>
|
|
|
+ <if test="reviewUserID != null and reviewUserID != ''">
|
|
|
+ reviewUserID = #{reviewUserID},
|
|
|
+ </if>
|
|
|
+ <if test="reviewImage1 != null and reviewImage1 != ''">
|
|
|
reviewImage1 = #{reviewImage1},
|
|
|
</if>
|
|
|
- <if test="reviewImage2 != null and reviewImage2 != ''" >
|
|
|
+ <if test="reviewImage2 != null and reviewImage2 != ''">
|
|
|
reviewImage2 = #{reviewImage2},
|
|
|
</if>
|
|
|
- <if test="reviewImage3 != null and reviewImage3 != ''" >
|
|
|
+ <if test="reviewImage3 != null and reviewImage3 != ''">
|
|
|
reviewImage3 = #{reviewImage3},
|
|
|
</if>
|
|
|
- <if test="reviewImage4 != null and reviewImage4 != ''" >
|
|
|
+ <if test="reviewImage4 != null and reviewImage4 != ''">
|
|
|
reviewImage4 = #{reviewImage4},
|
|
|
</if>
|
|
|
- <if test="reviewImage5 != null and reviewImage5 != ''" >
|
|
|
+ <if test="reviewImage5 != null and reviewImage5 != ''">
|
|
|
reviewImage5 = #{reviewImage5},
|
|
|
</if>
|
|
|
- <if test="returnTime != null and returnTime != ''" >
|
|
|
+ <if test="returnTime != null and returnTime != ''">
|
|
|
returnTime = #{returnTime},
|
|
|
</if>
|
|
|
- <if test="confirmReturnTime != null and confirmReturnTime != ''" >
|
|
|
+ <if test="confirmReturnTime != null and confirmReturnTime != ''">
|
|
|
confirmReturnTime = #{confirmReturnTime},
|
|
|
</if>
|
|
|
- <if test="delFlag != null and delFlag != ''" >
|
|
|
- delFlag = #{delFlag},
|
|
|
- </if>
|
|
|
- <if test="refundType != null">
|
|
|
- refundType = #{refundType},
|
|
|
- </if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">
|
|
|
+ delFlag = #{delFlag},
|
|
|
+ </if>
|
|
|
+ <if test="refundType != null">
|
|
|
+ refundType = #{refundType},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
|
|
|
- WHERE id = #{id}
|
|
|
- </update>
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
|
|
|
- <delete id="delete">
|
|
|
- DELETE FROM cm_returned_purchase
|
|
|
- WHERE id = #{id}
|
|
|
- </delete>
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE
|
|
|
+ FROM cm_returned_purchase
|
|
|
+ WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
|
|
|
- <select id="findOrderIDInReturnPurchase" resultType="integer">
|
|
|
- select orderID from cm_returned_purchase where status = '1'
|
|
|
- and orderID in
|
|
|
- <foreach collection="orderIds" open="(" close=")" item="oId" separator=",">
|
|
|
- #{oId}
|
|
|
- </foreach>
|
|
|
- and delFlag = 0
|
|
|
- </select>
|
|
|
+ <select id="findOrderIDInReturnPurchase" resultType="integer">
|
|
|
+ select orderID from cm_returned_purchase where status = '1'
|
|
|
+ and orderID in
|
|
|
+ <foreach collection="orderIds" open="(" close=")" item="oId" separator=",">
|
|
|
+ #{oId}
|
|
|
+ </foreach>
|
|
|
+ and delFlag = 0
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findOrderIDsInApplyReturnFlag" resultType="integer">
|
|
|
- select orderID from cm_returned_purchase where status in (1,3)
|
|
|
- and orderID in
|
|
|
- <foreach collection="orderIds" open="(" close=")" item="oId" separator=",">
|
|
|
- #{oId}
|
|
|
- </foreach>
|
|
|
- and delFlag = 0
|
|
|
- </select>
|
|
|
+ <select id="findOrderIDsInApplyReturnFlag" resultType="integer">
|
|
|
+ select orderID from cm_returned_purchase where status in (1,3)
|
|
|
+ and orderID in
|
|
|
+ <foreach collection="orderIds" open="(" close=")" item="oId" separator=",">
|
|
|
+ #{oId}
|
|
|
+ </foreach>
|
|
|
+ and delFlag = 0
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="refundTotalMoney" resultType="double">
|
|
|
- SELECT SUM(IFNULL(returnedPurchaseFee,0)) FROM cm_returned_purchase
|
|
|
- WHERE orderID=#{orderID} AND delFlag='0' AND status='2'
|
|
|
- </select>
|
|
|
- <select id="findReturnedShopOrder" resultType="java.lang.Integer">
|
|
|
- SELECT shopOrderId FROM cm_returned_purchase_product crpp
|
|
|
- LEFT JOIN cm_returned_purchase crp ON crp.id=crpp.returnedID
|
|
|
- WHERE crp.orderId=#{orderID}
|
|
|
- AND crp.status=2
|
|
|
- AND crp.returnedWay =1
|
|
|
- AND crp.delflag=0
|
|
|
- </select>
|
|
|
+ <select id="refundTotalMoney" resultType="double">
|
|
|
+ SELECT SUM(IFNULL(returnedPurchaseFee, 0))
|
|
|
+ FROM cm_returned_purchase
|
|
|
+ WHERE orderID = #{orderID}
|
|
|
+ AND delFlag = '0'
|
|
|
+ AND status = '2'
|
|
|
+ </select>
|
|
|
+ <select id="findReturnedShopOrder" resultType="java.lang.Integer">
|
|
|
+ SELECT shopOrderId
|
|
|
+ FROM cm_returned_purchase_product crpp
|
|
|
+ LEFT JOIN cm_returned_purchase crp ON crp.id = crpp.returnedID
|
|
|
+ WHERE crp.orderId = #{orderID}
|
|
|
+ AND crp.status = 2
|
|
|
+ AND crp.returnedWay = 1
|
|
|
+ AND crp.delflag = 0
|
|
|
+ </select>
|
|
|
<select id="findSplitCode" resultType="java.lang.String">
|
|
|
- select splitCode from cm_shop_order where shopOrderID = #{shopOrderId}
|
|
|
- </select>
|
|
|
- <select id="getReturnShopOrder" resultType="java.lang.Integer">
|
|
|
- SELECT shopOrderId FROM cm_returned_purchase_product crpp
|
|
|
- LEFT JOIN cm_returned_purchase crp ON crp.id=crpp.returnedID
|
|
|
- WHERE crp.id=#{id}
|
|
|
- AND crp.status=2
|
|
|
- AND crp.returnedWay =1
|
|
|
- AND crp.delflag=0
|
|
|
- </select>
|
|
|
- <select id="findBrokerage" resultType="java.lang.Double">
|
|
|
- SELECT SUM(splitAccount)
|
|
|
- FROM cm_split_account
|
|
|
- WHERE productType = 3
|
|
|
- AND TYPE=5
|
|
|
- AND orderRequestNo= #{orderRequestNo}
|
|
|
- </select>
|
|
|
- <select id="findRefundTransfer" resultType="java.lang.Double">
|
|
|
- SELECT SUM(transferAmount) FROM cm_refund_transfer
|
|
|
- WHERE transferType=2
|
|
|
- AND orderRequestNo=#{orderRequestNo}
|
|
|
- </select>
|
|
|
- <select id="findRefundCharge" resultType="java.lang.Double">
|
|
|
- SELECT SUM(transferAmount) FROM cm_refund_transfer
|
|
|
- WHERE transferType=1
|
|
|
- AND orderRequestNo=#{orderRequestNo}
|
|
|
- </select>
|
|
|
- <select id="findPayAmount" resultType="java.lang.Double">
|
|
|
- select associateAmount from cm_receipt_order_relation
|
|
|
- where orderRequestNo = #{orderRequestNo}
|
|
|
- </select>
|
|
|
- <select id="findOnlinePay" resultType="java.lang.Double">
|
|
|
- SELECT SUM(receiptAmount) FROM
|
|
|
- cm_discern_receipt cdr
|
|
|
- LEFT JOIN cm_receipt_order_relation cror ON cror.receiptID=cdr.Id
|
|
|
- WHERE shopOrderId=#{shopOrderId}
|
|
|
- </select>
|
|
|
- <select id="findShopOrderSettleStatus" resultType="java.lang.String">
|
|
|
- select settleStatus from cm_shop_order where shopOrderID = #{onlineShopOrderId}
|
|
|
- </select>
|
|
|
- <select id="findRefundType" resultType="java.lang.Integer">
|
|
|
- SELECT COUNT(*) FROM cm_returned_purchase
|
|
|
- WHERE orderId=#{orderID}
|
|
|
- AND delflag = 0
|
|
|
- AND refundtype=2
|
|
|
- </select>
|
|
|
- <select id="findShopOrderPaid" resultType="java.lang.Double">
|
|
|
- SELECT SUM(associateAmount)
|
|
|
- FROM cm_receipt_order_relation
|
|
|
- WHERE shopOrderId=#{shopOrderID}
|
|
|
- AND delflag=0
|
|
|
- </select>
|
|
|
+ select splitCode
|
|
|
+ from cm_shop_order
|
|
|
+ where shopOrderID = #{shopOrderId}
|
|
|
+ </select>
|
|
|
+ <select id="getReturnShopOrder" resultType="java.lang.Integer">
|
|
|
+ SELECT shopOrderId
|
|
|
+ FROM cm_returned_purchase_product crpp
|
|
|
+ LEFT JOIN cm_returned_purchase crp ON crp.id = crpp.returnedID
|
|
|
+ WHERE crp.id = #{id}
|
|
|
+ AND crp.status = 2
|
|
|
+ AND crp.returnedWay = 1
|
|
|
+ AND crp.delflag = 0
|
|
|
+ </select>
|
|
|
+ <select id="findBrokerage" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(splitAccount)
|
|
|
+ FROM cm_split_account
|
|
|
+ WHERE productType = 3
|
|
|
+ AND TYPE = 5
|
|
|
+ AND orderRequestNo = #{orderRequestNo}
|
|
|
+ </select>
|
|
|
+ <select id="findRefundTransfer" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(transferAmount)
|
|
|
+ FROM cm_refund_transfer
|
|
|
+ WHERE transferType = 2
|
|
|
+ AND orderRequestNo = #{orderRequestNo}
|
|
|
+ </select>
|
|
|
+ <select id="findRefundCharge" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(transferAmount)
|
|
|
+ FROM cm_refund_transfer
|
|
|
+ WHERE transferType = 1
|
|
|
+ AND orderRequestNo = #{orderRequestNo}
|
|
|
+ </select>
|
|
|
+ <select id="findPayAmount" resultType="java.lang.Double">
|
|
|
+ select associateAmount
|
|
|
+ from cm_receipt_order_relation
|
|
|
+ where orderRequestNo = #{orderRequestNo}
|
|
|
+ </select>
|
|
|
+ <select id="findOnlinePay" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(receiptAmount)
|
|
|
+ FROM cm_discern_receipt cdr
|
|
|
+ LEFT JOIN cm_receipt_order_relation cror ON cror.receiptID = cdr.Id
|
|
|
+ WHERE shopOrderId = #{shopOrderId}
|
|
|
+ </select>
|
|
|
+ <select id="findShopOrderSettleStatus" resultType="java.lang.String">
|
|
|
+ select settleStatus
|
|
|
+ from cm_shop_order
|
|
|
+ where shopOrderID = #{onlineShopOrderId}
|
|
|
+ </select>
|
|
|
+ <select id="findRefundType" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM cm_returned_purchase
|
|
|
+ WHERE orderId = #{orderID}
|
|
|
+ AND delflag = 0
|
|
|
+ AND refundtype = 2
|
|
|
+ </select>
|
|
|
+ <select id="findShopOrderPaid" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(associateAmount)
|
|
|
+ FROM cm_receipt_order_relation
|
|
|
+ WHERE shopOrderId = #{shopOrderID}
|
|
|
+ AND delflag = 0
|
|
|
+ </select>
|
|
|
+ <select id="findSplitCodeEmail" resultType="java.lang.String">
|
|
|
+ select email
|
|
|
+ from cm_shop_email
|
|
|
+ where splitCode = #{splitCode}
|
|
|
+ </select>
|
|
|
</mapper>
|