|
|
@@ -400,192 +400,77 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 全部查询 -->
|
|
|
- <select id="queryAll" parameterType="java.util.Map"
|
|
|
- resultMap="entityMap">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
+ <select id="queryAll" parameterType="java.util.Map"
|
|
|
+ resultType="com.pine.admin.modules.business.entity.Order">
|
|
|
+ select ls_order.*,
|
|
|
+ ls_customer.username as customerName,
|
|
|
+ ls_customer.mobile,
|
|
|
+ ls_order_attr.receipt_mobile as receiptMobile,
|
|
|
+ ls_order_attr.receipt_name as receiptName,
|
|
|
+ concat(ls_order_attr.receipt_address,ls_order_attr.receipt_detail_address) as address
|
|
|
from ls_order
|
|
|
- <where>
|
|
|
- and del_flag = 'N'
|
|
|
- <if test="id != null and !"".equals(id)">
|
|
|
- and id = #{id}
|
|
|
- </if>
|
|
|
- <if test="orderCode != null and !"".equals(orderCode)">
|
|
|
- and order_code = #{orderCode}
|
|
|
- </if>
|
|
|
- <if test="masterOrderCode != null and !"".equals(masterOrderCode)">
|
|
|
- and master_order_code = #{masterOrderCode}
|
|
|
- </if>
|
|
|
- <if test="customerId != null and !"".equals(customerId)">
|
|
|
- and customer_id = #{customerId}
|
|
|
- </if>
|
|
|
- <if test="price != null and !"".equals(price)">
|
|
|
- and price = #{price}
|
|
|
- </if>
|
|
|
- <if test="presalePrice != null and !"".equals(presalePrice)">
|
|
|
- and presale_price = #{presalePrice}
|
|
|
- </if>
|
|
|
- <if test="originalPrice != null and !"".equals(originalPrice)">
|
|
|
- and original_price = #{originalPrice}
|
|
|
- </if>
|
|
|
- <if test="freightPrice != null and !"".equals(freightPrice)">
|
|
|
- and freight_price = #{freightPrice}
|
|
|
- </if>
|
|
|
- <if test="modifyPrice != null and !"".equals(modifyPrice)">
|
|
|
- and modify_price = #{modifyPrice}
|
|
|
- </if>
|
|
|
- <if test="pointPrice != null and !"".equals(pointPrice)">
|
|
|
- and point_price = #{pointPrice}
|
|
|
- </if>
|
|
|
- <if test="couponPrice != null and !"".equals(couponPrice)">
|
|
|
- and coupon_price = #{couponPrice}
|
|
|
- </if>
|
|
|
- <if test="redEnvelopePrice != null and !"".equals(redEnvelopePrice)">
|
|
|
- and red_envelope_price = #{redEnvelopePrice}
|
|
|
- </if>
|
|
|
- <if test="concessionalRate != null and !"".equals(concessionalRate)">
|
|
|
- and concessional_rate = #{concessionalRate}
|
|
|
- </if>
|
|
|
- <if test="status != null and !"".equals(status)">
|
|
|
- and status = #{status}
|
|
|
- </if>
|
|
|
- <if test="presaleStatus != null and !"".equals(presaleStatus)">
|
|
|
- and presale_status = #{presaleStatus}
|
|
|
- </if>
|
|
|
- <if test="evaluationStatus != null and !"".equals(evaluationStatus)">
|
|
|
- and evaluation_status = #{evaluationStatus}
|
|
|
- </if>
|
|
|
- <if test="redEnvelopeCode != null and !"".equals(redEnvelopeCode)">
|
|
|
- and red_envelope_code = #{redEnvelopeCode}
|
|
|
- </if>
|
|
|
- <if test="couponNo != null and !"".equals(couponNo)">
|
|
|
- and coupon_no = #{couponNo}
|
|
|
- </if>
|
|
|
- <if test="usePoint != null and !"".equals(usePoint)">
|
|
|
- and use_point = #{usePoint}
|
|
|
- </if>
|
|
|
- <if test="payType != null and !"".equals(payType)">
|
|
|
- and pay_type = #{payType}
|
|
|
- </if>
|
|
|
- <if test="storeId != null and !"".equals(storeId)">
|
|
|
- and store_id = #{storeId}
|
|
|
- </if>
|
|
|
- <if test="cancelReson != null and !"".equals(cancelReson)">
|
|
|
- and cancel_reson = #{cancelReson}
|
|
|
- </if>
|
|
|
- <if test="predepositPay != null and !"".equals(predepositPay)">
|
|
|
- and predeposit_pay = #{predepositPay}
|
|
|
- </if>
|
|
|
- <if test="source != null and !"".equals(source)">
|
|
|
- and source = #{source}
|
|
|
- </if>
|
|
|
- <if test="freightTemplateId != null and !"".equals(freightTemplateId)">
|
|
|
- and freight_template_id = #{freightTemplateId}
|
|
|
- </if>
|
|
|
- <if test="waybillCode != null and !"".equals(waybillCode)">
|
|
|
- and waybill_code = #{waybillCode}
|
|
|
- </if>
|
|
|
- <if test="orderType != null and !"".equals(orderType)">
|
|
|
- and order_type = #{orderType}
|
|
|
- </if>
|
|
|
- <if test="createTime != null and !"".equals(createTime)">
|
|
|
- and create_time = #{createTime}
|
|
|
- </if>
|
|
|
- <if test="payTime != null and !"".equals(payTime)">
|
|
|
- and pay_time = #{payTime}
|
|
|
- </if>
|
|
|
- <if test="deliveryTime != null and !"".equals(deliveryTime)">
|
|
|
- and delivery_time = #{deliveryTime}
|
|
|
- </if>
|
|
|
- <if test="receivingTime != null and !"".equals(receivingTime)">
|
|
|
- and receiving_time = #{receivingTime}
|
|
|
- </if>
|
|
|
- <if test="cancelTime != null and !"".equals(cancelTime)">
|
|
|
- and cancel_time = #{cancelTime}
|
|
|
- </if>
|
|
|
- <if test="modifyTime != null and !"".equals(modifyTime)">
|
|
|
- and modify_time = #{modifyTime}
|
|
|
- </if>
|
|
|
- <if test="evaluationTime != null and !"".equals(evaluationTime)">
|
|
|
- and evaluation_time = #{evaluationTime}
|
|
|
- </if>
|
|
|
- <if test="presaleTime != null and !"".equals(presaleTime)">
|
|
|
- and presale_time = #{presaleTime}
|
|
|
- </if>
|
|
|
- <if test="groupHead != null and !"".equals(groupHead)">
|
|
|
- and group_head = #{groupHead}
|
|
|
- </if>
|
|
|
- <if test="groupId != null and !"".equals(groupId)">
|
|
|
- and group_id = #{groupId}
|
|
|
- </if>
|
|
|
- <if test="groupMarketingId != null and !"".equals(groupMarketingId)">
|
|
|
- and group_marketing_id = #{groupMarketingId}
|
|
|
- </if>
|
|
|
- <if test="groupSkuId != null and !"".equals(groupSkuId)">
|
|
|
- and group_sku_id = #{groupSkuId}
|
|
|
- </if>
|
|
|
- <if test="groupStatus != null and !"".equals(groupStatus)">
|
|
|
- and group_status = #{groupStatus}
|
|
|
- </if>
|
|
|
- <if test="groupNum != null and !"".equals(groupNum)">
|
|
|
- and group_num = #{groupNum}
|
|
|
- </if>
|
|
|
- <if test="openGroupTime != null and !"".equals(openGroupTime)">
|
|
|
- and open_group_time = #{openGroupTime}
|
|
|
- </if>
|
|
|
- <if test="autoHandleStatus != null and !"".equals(autoHandleStatus)">
|
|
|
- and auto_handle_status = #{autoHandleStatus}
|
|
|
- </if>
|
|
|
- <if test="recommended != null and !"".equals(recommended)">
|
|
|
- and recommended = #{recommended}
|
|
|
- </if>
|
|
|
- <if test="crowdfundingId != null and !"".equals(crowdfundingId)">
|
|
|
- and crowdfunding_id = #{crowdfundingId}
|
|
|
- </if>
|
|
|
- <if test="lotteryStatus != null and !"".equals(lotteryStatus)">
|
|
|
- and lottery_status = #{lotteryStatus}
|
|
|
- </if>
|
|
|
- <if test="writeOffCode != null and !"".equals(writeOffCode)">
|
|
|
- and write_off_code = #{writeOffCode}
|
|
|
- </if>
|
|
|
- <if test="communityBuyCustomerId != null and !"".equals(communityBuyCustomerId)">
|
|
|
- and community_buy_customer_id = #{communityBuyCustomerId}
|
|
|
- </if>
|
|
|
- <if test="communityBuyId != null and !"".equals(communityBuyId)">
|
|
|
- and community_buy_id = #{communityBuyId}
|
|
|
- </if>
|
|
|
- <if test="profit != null and !"".equals(profit)">
|
|
|
- and profit = #{profit}
|
|
|
- </if>
|
|
|
- <if test="communityName != null and !"".equals(communityName)">
|
|
|
- and community_name = #{communityName}
|
|
|
- </if>
|
|
|
- <if test="communityBuyName != null and !"".equals(communityBuyName)">
|
|
|
- and community_buy_name = #{communityBuyName}
|
|
|
- </if>
|
|
|
- <if test="billNo != null and !"".equals(billNo)">
|
|
|
- and bill_no = #{billNo}
|
|
|
- </if>
|
|
|
- <if test="dealerId != null and !"".equals(dealerId)">
|
|
|
- and dealer_id = #{dealerId}
|
|
|
- </if>
|
|
|
- <if test="dealerInfo != null and !"".equals(dealerInfo)">
|
|
|
- and dealer_info = #{dealerInfo}
|
|
|
- </if>
|
|
|
- <if test="payChannel != null and !"".equals(payChannel)">
|
|
|
- and pay_channel = #{payChannel}
|
|
|
- </if>
|
|
|
- <if test="skuType != null and !"".equals(skuType)">
|
|
|
- and sku_type = #{skuType}
|
|
|
- </if>
|
|
|
- <if test="jetourSendFlag != null and !"".equals(jetourSendFlag)">
|
|
|
- and jetour_send_flag = #{jetourSendFlag}
|
|
|
- </if>
|
|
|
- <if test="incomingUrl != null and !"".equals(incomingUrl)">
|
|
|
- and incoming_url = #{incomingUrl}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- order by id desc
|
|
|
+ join ls_customer on ls_order.customer_id = ls_customer.id
|
|
|
+ join ls_order_attr on ls_order_attr.order_id = ls_order.id
|
|
|
+ where ls_customer.del_flag = '0'
|
|
|
+ and ls_order.store_id = 0
|
|
|
+ and ls_order.status != 1
|
|
|
+ and ls_order.status != 5
|
|
|
+ <!-- 收货人手机号 -->
|
|
|
+ <if test="receiptMobile != null and receiptMobile != '' ">
|
|
|
+ and ls_order_attr.receipt_mobile = #{receiptMobile}
|
|
|
+ </if>
|
|
|
+ <!-- 收货人姓名 -->
|
|
|
+ <if test="receiptName != null and receiptName != '' ">
|
|
|
+ and ls_order_attr.receipt_name like CONCAT(CONCAT('%', #{receiptName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orderCode != null and orderCode != '' ">
|
|
|
+ AND ls_order.order_code = #{orderCode}
|
|
|
+ </if>
|
|
|
+ <if test="customerName != null and customerName != ''">
|
|
|
+ AND ls_customer.username like CONCAT(CONCAT('%', #{customerName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="customerMobile != null and customerMobile != ''">
|
|
|
+ AND ls_customer.mobile = #{customerMobile}
|
|
|
+ </if>
|
|
|
+ <if test="customerId != null and customerId != ''">
|
|
|
+ AND ls_order.id=#{customerId}
|
|
|
+ </if>
|
|
|
+ <if test="dealerId != null and dealerId != ''">
|
|
|
+ AND ls_order.dealer_id=#{dealerId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="payType != null and payType != '' ">
|
|
|
+ AND ls_order.pay_type = #{payType}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test='status != null and status != "" and status!= "5"'>
|
|
|
+ AND ls_order.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test='status=="5"'>
|
|
|
+ AND ls_order.status in ('5','6','7')
|
|
|
+ AND ls_order.order_type in ('0','1','2','3','7')
|
|
|
+ </if>
|
|
|
+ <if test="startTime!=''and startTime!=null">
|
|
|
+ AND ls_order.create_time >=#{startTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="endTime!=''and endTime!=null">
|
|
|
+ AND ls_order.create_time <=#{endTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="orderType!=null and orderType !=''">
|
|
|
+ AND ls_order.order_type=#{orderType}
|
|
|
+ </if>
|
|
|
+ <if test='status !="5"'>
|
|
|
+ AND ls_order.order_type in ('0','1','2','7')
|
|
|
+ </if>
|
|
|
+ <choose>
|
|
|
+ <when test="orderType ==1 ||orderType==2">
|
|
|
+ order by ls_order.pay_time desc
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ order by ls_order.create_time desc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
<!-- 根据条件查询一个 -->
|