|
@@ -199,6 +199,104 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER BY o.order_id DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectDangAnOrderList" parameterType="com.zhongzheng.modules.order.bo.OrderQueryBo" resultMap="OrderResultVo">
|
|
|
+ SELECT
|
|
|
+ o.*,
|
|
|
+ g.goods_id,
|
|
|
+ g.goods_name,
|
|
|
+ g.year,
|
|
|
+ g.cover_url,
|
|
|
+ g.code,
|
|
|
+ g.goods_type,
|
|
|
+ og.goods_price,
|
|
|
+ og.rebuy_order_goods_id,
|
|
|
+ og.order_goods_id,
|
|
|
+ og.goods_real_price,
|
|
|
+ u.telphone,
|
|
|
+ u.realname,
|
|
|
+ u.id_card,
|
|
|
+ cet.education_name,
|
|
|
+ cpt.project_name,
|
|
|
+ cb.business_name,
|
|
|
+ og.goods_received,
|
|
|
+ og.refund_status,
|
|
|
+ og.pay_status as goods_pay_status
|
|
|
+ FROM
|
|
|
+ `order` o
|
|
|
+ LEFT JOIN order_goods og ON o.order_sn = og.order_sn
|
|
|
+ LEFT JOIN goods g ON og.goods_id = g.goods_id
|
|
|
+ LEFT JOIN `user` u ON o.user_id = u.user_id
|
|
|
+ LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON g.business_id = cb.id
|
|
|
+ WHERE 1=1
|
|
|
+
|
|
|
+ <if test="educationTypeId != null and educationTypeId != ''">
|
|
|
+ AND g.education_type_id = #{educationTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSn != null and orderSn != ''">
|
|
|
+ AND o.order_sn = #{orderSn}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null ">
|
|
|
+ AND o.order_status in
|
|
|
+ <foreach collection="orderStatus" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="status != null ">
|
|
|
+ AND o.status in
|
|
|
+ <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderGoodsStatus == 1">
|
|
|
+ AND og.pay_status in (2,3,4) AND og.refund_status != 2
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ AND o.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null">
|
|
|
+ AND #{endTime} >= o.create_time
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null">
|
|
|
+ AND o.pay_status = #{payStatus}
|
|
|
+ </if>
|
|
|
+ <if test="goodsPayStatus != null">
|
|
|
+ AND og.pay_status = #{goodsPayStatus}
|
|
|
+ </if>
|
|
|
+ <if test="refundStatus != null">
|
|
|
+ AND og.refund_status = #{refundStatus}
|
|
|
+ </if>
|
|
|
+ <if test="goodsType != null">
|
|
|
+ AND g.goods_type = #{goodsType}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ AND u.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="inputOrderSn != null">
|
|
|
+ AND o.input_order_sn = #{inputOrderSn}
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and searchKey != ''">
|
|
|
+ AND (u.realname like concat('%', #{searchKey}, '%') or o.order_sn = #{searchKey} or u.id_card = #{searchKey} or g.goods_name like concat('%', #{searchKey}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="orderGoodsIds != null ">
|
|
|
+ AND og.order_goods_id in
|
|
|
+ <foreach collection="orderGoodsIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderFroms != null ">
|
|
|
+ AND o.order_from in
|
|
|
+ <foreach collection="orderFroms" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ORDER BY o.order_id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectRebuyList" parameterType="com.zhongzheng.modules.order.bo.OrderQueryBo" resultMap="OrderResultVo">
|
|
|
SELECT
|
|
|
o.*,
|