|
@@ -474,5 +474,203 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE status = 0
|
|
|
AND create_time < DATE_SUB(NOW(), INTERVAL 1800 MINUTE);
|
|
|
</select>
|
|
|
+ <select id="selectFsStoreOrderListVO" resultType="com.fs.store.vo.FsStoreOrderVO">
|
|
|
+ select o.`id`,
|
|
|
+ o.`order_code`,
|
|
|
+ o.`extend_order_id`,
|
|
|
+ o.`pay_order_id`,
|
|
|
+ o.`bank_order_id`,
|
|
|
+ o.`user_id`,
|
|
|
+ o.`real_name`,
|
|
|
+ o.`user_phone`,
|
|
|
+ o.`user_address`,
|
|
|
+ o.`cart_id`,
|
|
|
+ o.`freight_price`,
|
|
|
+ o.`total_num`,
|
|
|
+ o.`total_price`,
|
|
|
+ o.`total_postage`,
|
|
|
+ o.`pay_price`,
|
|
|
+ o.`pay_postage`,
|
|
|
+ o.`pay_delivery`,
|
|
|
+ o.`pay_money`,
|
|
|
+ o.`deduction_price`,
|
|
|
+ o.`coupon_id`,
|
|
|
+ o.`coupon_price`,
|
|
|
+ o.`paid`,
|
|
|
+ o.`pay_time`,
|
|
|
+ o.`pay_type`,
|
|
|
+ o.`create_time`,
|
|
|
+ o.`update_time`,
|
|
|
+ o.`status`,
|
|
|
+ o.`refund_status`,
|
|
|
+ o.`refund_reason_wap_img`,
|
|
|
+ o.`refund_reason_wap_explain`,
|
|
|
+ o.`refund_reason_time`,
|
|
|
+ o.`refund_reason_wap`,
|
|
|
+ o.`refund_reason`,
|
|
|
+ o.`refund_price`,
|
|
|
+ deliver.deliver_sn as `delivery_sn`,
|
|
|
+ deliver.deliver_name as `delivery_name`,
|
|
|
+
|
|
|
+ o.`delivery_type`,
|
|
|
+ deliver.deliver_id as `delivery_id`,
|
|
|
+ o.`gain_integral`,
|
|
|
+ o.`use_integral`,
|
|
|
+ o.`pay_integral`,
|
|
|
+ o.`back_integral`,
|
|
|
+ o.`mark`,
|
|
|
+ o.`is_del`,
|
|
|
+ o.`remark`,
|
|
|
+ o.`cost`,
|
|
|
+ o.`verify_code`,
|
|
|
+ o.`store_id`,
|
|
|
+ o.`shipping_type`,
|
|
|
+ o.`is_channel`,
|
|
|
+ o.`is_remind`,
|
|
|
+ o.`is_sys_del`,
|
|
|
+ o.`is_prescribe`,
|
|
|
+ o.`prescribe_id`,
|
|
|
+ o.`company_id`,
|
|
|
+ o.`company_user_id`,
|
|
|
+ o.`is_package`,
|
|
|
+ o.`package_json`,
|
|
|
+ o.`order_type`,
|
|
|
+ o.`package_id`,
|
|
|
+ o.`finish_time`,
|
|
|
+ o.`delivery_status`,
|
|
|
+ o.`delivery_pay_status`,
|
|
|
+ o.`delivery_time`,
|
|
|
+ o.`delivery_pay_time`,
|
|
|
+ o.`delivery_pay_money`,
|
|
|
+ o.`tui_money`,
|
|
|
+ o.`tui_money_status`,
|
|
|
+ o.`delivery_import_time`,
|
|
|
+ o.`tui_user_id`,
|
|
|
+ o.`tui_user_money_status`,
|
|
|
+ o.`order_create_type`,
|
|
|
+ o.`store_house_code`,
|
|
|
+ o.`dept_id`,
|
|
|
+ o.`is_edit_money`,
|
|
|
+ o.`customer_id`,
|
|
|
+ o.`is_pay_remain`,
|
|
|
+ o.`delivery_send_time`,
|
|
|
+ o.`certificates`,
|
|
|
+ o.`upload_time`,
|
|
|
+ o.`schedule_id`,
|
|
|
+ o.`item_json`,
|
|
|
+ o.`order_visit`,
|
|
|
+ o.`service_fee`
|
|
|
+ ,u.phone,u.register_code,u.register_date,
|
|
|
+ u.source, c.company_name ,
|
|
|
+ cu.nick_name as company_user_nick_name ,
|
|
|
+ cu.phonenumber as company_usere_phonenumber
|
|
|
+ from fs_store_order o
|
|
|
+ left join fs_user u
|
|
|
+ on o.user_id=u.user_id
|
|
|
+ left join company c
|
|
|
+ on c.company_id=o.company_id
|
|
|
+ left join company_user cu
|
|
|
+ on cu.user_id=o.company_user_id
|
|
|
+ left join fs_store_delivers deliver
|
|
|
+ on o.order_code=deliver.order_code
|
|
|
+ <if test = 'maps.productName != null and maps.productName != "" '>
|
|
|
+ left join fs_store_order_item oi on o.id = oi.order_id
|
|
|
+ left join fs_store_product fsp on fsp.product_id = oi.product_id
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ <if test = 'maps.orderCode != null and maps.orderCode !="" '>
|
|
|
+ and o.order_code like CONCAT(#{maps.orderCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.isPayRemain != null '>
|
|
|
+ and o.is_pay_remain =#{maps.isPayRemain}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.userId != null '>
|
|
|
+ and o.user_id =#{maps.userId}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.deliveryId != null and maps.deliveryId !="" '>
|
|
|
+ and deliver.deliver_id =#{maps.deliveryId}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.nickname != null and maps.nickname !="" '>
|
|
|
+ and u.nickname like CONCAT(#{maps.nickname},'%')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.realName != null and maps.realName !="" '>
|
|
|
+ and o.real_name like CONCAT(#{maps.realName},'%')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.phone != null and maps.phone !="" '>
|
|
|
+ and u.phone like CONCAT(#{maps.phone},'%')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.userPhone != null and maps.userPhone !="" '>
|
|
|
+ and o.user_phone like CONCAT(#{maps.userPhone},'%')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.status != null '>
|
|
|
+ and o.status =#{maps.status}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.isUpload != null and maps.isUpload == 0 '>
|
|
|
+ and o.certificates is null
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.isUpload != null and maps.isUpload == 1 '>
|
|
|
+ and o.certificates is not null
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.deliveryStatus != null '>
|
|
|
+ and deliver.status =#{maps.deliveryStatus}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.deliveryPayStatus != null '>
|
|
|
+ and o.delivery_pay_status =#{maps.deliveryPayStatus}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.companyId != null '>
|
|
|
+ and o.company_id =#{maps.companyId}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.isHealth != null and maps.isHealth != "" '>
|
|
|
+ and o.company_id is null
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.notHealth != null '>
|
|
|
+ and o.company_id is not null
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.companyUserId != null '>
|
|
|
+ and o.company_user_id =#{maps.companyUserId}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.companyUserNickName != null and maps.companyUserNickName != "" '>
|
|
|
+ and cu.nick_name like concat(#{maps.companyUserNickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.productName != null and maps.productName != "" '>
|
|
|
+ and fsp.product_name like concat(#{maps.productName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.orderType != null '>
|
|
|
+ and o.order_type =#{maps.orderType}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.payType != null '>
|
|
|
+ and o.pay_type =#{maps.payType}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.scheduleId != null '>
|
|
|
+ and o.schedule_id =#{maps.scheduleId}
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.createTimeList != null '>
|
|
|
+ AND date_format(o.create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d')
|
|
|
+ AND date_format(o.create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test = 'maps.deliverySendTimeList != null '>
|
|
|
+ AND date_format(o.delivery_send_time,'%y%m%d') >= date_format(#{maps.deliverySendTimeList[0]},'%y%m%d')
|
|
|
+ AND date_format(o.delivery_send_time,'%y%m%d') <= date_format(#{maps.deliverySendTimeList[1]},'%y%m%d')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test = 'maps.payTimeList != null '>
|
|
|
+ AND date_format(o.pay_time,'%y%m%d') >= date_format(#{maps.payTimeList[0]},'%y%m%d')
|
|
|
+ AND date_format(o.pay_time,'%y%m%d') <= date_format(#{maps.payTimeList[1]},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.deliveryImportTimeList != null '>
|
|
|
+ AND date_format(o.delivery_import_time,'%y%m%d') >= date_format(#{maps.deliveryImportTimeList[0]},'%y%m%d')
|
|
|
+ AND date_format(o.delivery_import_time,'%y%m%d') <= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test = 'maps.deptId != null '>
|
|
|
+ AND (o.dept_id = #{maps.deptId} OR o.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
|
|
|
+ </if>
|
|
|
+ ${maps.params.dataScope}
|
|
|
+ </where>
|
|
|
+ <if test = 'maps.productName != null and maps.productName != "" '>
|
|
|
+ group by o.id
|
|
|
+ </if>
|
|
|
+ order by o.id desc
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|