|
@@ -166,5 +166,119 @@
|
|
and delFlag = 0
|
|
and delFlag = 0
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="findReturnList" resultType="com.caimei365.manager.entity.order.CmReturnedPurchase">
|
|
|
|
+ SELECT
|
|
|
|
+ a.id AS "id",
|
|
|
|
+ a.returnedNo AS "returnedNo",
|
|
|
|
+ a.orderID AS "orderId",
|
|
|
|
+ a.shopOrderId AS "shopOrderId",
|
|
|
|
+ a.userID AS "userId",
|
|
|
|
+ a.status AS "status",
|
|
|
|
+ a.returnedWay AS "returnedWay",
|
|
|
|
+ a.payType AS "payType",
|
|
|
|
+ a.operatingOrderStatus AS "operatingOrderStatus",
|
|
|
|
+ ifnull(a.returnedPurchaseFee,0) AS "returnedPurchaseFee",
|
|
|
|
+ a.refundFee AS "refundFee",
|
|
|
|
+ a.image1 AS "image1",
|
|
|
|
+ a.image2 AS "image2",
|
|
|
|
+ a.image3 AS "image3",
|
|
|
|
+ a.image4 AS "image4",
|
|
|
|
+ a.image5 AS "image5",
|
|
|
|
+ a.remarks AS "remarks",
|
|
|
|
+ a.reviewImage1 AS "reviewImage1",
|
|
|
|
+ a.reviewImage2 AS "reviewImage2",
|
|
|
|
+ a.reviewImage3 AS "reviewImage3",
|
|
|
|
+ a.reviewImage4 AS "reviewImage4",
|
|
|
|
+ a.reviewImage5 AS "reviewImage5",
|
|
|
|
+ a.reviewRemarks AS "reviewRemarks",
|
|
|
|
+ a.returnTime AS "returnTime",
|
|
|
|
+ a.applicationUserID AS "applicationUserId",
|
|
|
|
+ a.reviewUserID AS "reviewUserId",
|
|
|
|
+ ifnull(a.refundBalanceFee,0) AS "refundBalanceFee",
|
|
|
|
+ a.refundOnlineFee AS "refundOnlineFee",
|
|
|
|
+ a.refundOfflineFee AS "refundOfflineFee",
|
|
|
|
+ a.bankAccountName AS "bankAccountName",
|
|
|
|
+ a.bankAccountNo AS "bankAccountNo",
|
|
|
|
+ a.openBank AS "openBank",
|
|
|
|
+ a.bankAccountType AS "bankAccountType",
|
|
|
|
+ a.confirmReturnTime AS "confirmReturnTime",
|
|
|
|
+ b.orderNo as "orderNo",
|
|
|
|
+ b.orderType as "orderType",
|
|
|
|
+ c.userName as "userName",
|
|
|
|
+ c.name as "name",
|
|
|
|
+ c.userOrganizeID as "userOrganizeId",
|
|
|
|
+ ifnull(a.refundType,1) as "refundType",
|
|
|
|
+ s.name AS "applicationUserName",
|
|
|
|
+ s1.name AS "reviewUserName",
|
|
|
|
+ co.organizeID AS "organizeId",
|
|
|
|
+ cso.shopOrderNo AS "shopOrderNo",
|
|
|
|
+ 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_shop_order cso ON a.shopOrderId=cso.shopOrderId
|
|
|
|
+ LEFT JOIN cm_offline_collection f ON a.payType = f.type
|
|
|
|
+ left join cm_order as b on a.orderID = b.orderID
|
|
|
|
+ left join user as c on a.userID = c.userID
|
|
|
|
+ <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="shopOrderId != null and shopOrderId != ''">
|
|
|
|
+ AND a.shopOrderId = #{shopOrderId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">
|
|
|
|
+ AND cso.shopOrderNo = #{shopOrderNo}
|
|
|
|
+ </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 concat('%',#{name},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
|
+ AND b.orderNo = #{orderNo}
|
|
|
|
+ </if>
|
|
|
|
+ and a.delFlag = 0
|
|
|
|
+ </where>
|
|
|
|
+ order by a.returnTime desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|