|
@@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND g.goods_type = #{goodsType}
|
|
|
</if>
|
|
|
<if test="searchKey != null and searchKey != '' ">
|
|
|
- and (u.realname like concat('%', #{searchKey}, '%') or u.id_card like concat('%', #{searchKey}, '%') or g.goods_name like concat('%', #{searchKey}, '%') or og.order_sn = #{searchKey})
|
|
|
+ and (u.realname like concat('%', #{searchKey}, '%') or u.id_card like concat('%', #{searchKey}, '%') or g.goods_name like concat('%', #{searchKey}, '%') or gr.order_sn = #{searchKey})
|
|
|
</if>
|
|
|
<if test="searchStartTime != null and searchStartTime !='' ">
|
|
|
AND og.create_time >=#{searchStartTime}
|
|
@@ -121,8 +121,87 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="searchEndTime != null and searchEndTime !='' ">
|
|
|
AND #{searchEndTime} >= og.create_time
|
|
|
</if>
|
|
|
--- ORDER BY gr.refund_id DESC
|
|
|
- ORDER BY gr.order_sn ASC , gr.create_time ASC
|
|
|
+ ORDER BY gr.refund_id DESC
|
|
|
+-- ORDER BY gr.order_sn ASC , gr.create_time ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectListByQuery" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsRefundQueryBo" resultMap="OrderGoodsRefundVoResult">
|
|
|
+ SELECT
|
|
|
+ gr.order_sn,MIN(gr.refund_id) as refund_id ,MIN(gr.create_time) as create_time
|
|
|
+ FROM
|
|
|
+ order_goods_refund gr
|
|
|
+ LEFT JOIN goods g ON gr.goods_id = g.goods_id
|
|
|
+ LEFT JOIN `user` u ON gr.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
|
|
|
+ LEFT JOIN order_goods og ON gr.order_goods_id = og.order_goods_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ AND gr.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="orderGoodsId != null and orderGoodsId != ''">
|
|
|
+ AND gr.order_goods_id = #{orderGoodsId}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ AND gr.type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="periodStatus != null ">
|
|
|
+ AND gr.period_status in
|
|
|
+ <foreach collection="periodStatus" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsType != null and goodsType != ''">
|
|
|
+ AND g.goods_type = #{goodsType}
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and searchKey != '' ">
|
|
|
+ and (u.realname like concat('%', #{searchKey}, '%') or u.id_card like concat('%', #{searchKey}, '%') or g.goods_name like concat('%', #{searchKey}, '%') or gr.order_sn = #{searchKey})
|
|
|
+ </if>
|
|
|
+ <if test="searchStartTime != null and searchStartTime !='' ">
|
|
|
+ AND og.create_time >=#{searchStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="searchEndTime != null and searchEndTime !='' ">
|
|
|
+ AND #{searchEndTime} >= og.create_time
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ gr.order_sn
|
|
|
+ ORDER BY
|
|
|
+ refund_id ASC,
|
|
|
+ create_time ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectListByOrderSn" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsRefundQueryBo" resultMap="OrderGoodsRefundVoResult">
|
|
|
+ SELECT
|
|
|
+ gr.*,
|
|
|
+ g.goods_name,
|
|
|
+ g.cover_url,
|
|
|
+ g.year,
|
|
|
+ u.realname,
|
|
|
+ u.id_card,
|
|
|
+ u.telphone,
|
|
|
+ cet.education_name,
|
|
|
+ cpt.project_name,
|
|
|
+ cb.business_name,
|
|
|
+ og.goods_received,
|
|
|
+ og.goods_real_price,
|
|
|
+ og.pay_status,
|
|
|
+ og.goods_price
|
|
|
+ FROM
|
|
|
+ order_goods_refund gr
|
|
|
+ LEFT JOIN goods g ON gr.goods_id = g.goods_id
|
|
|
+ LEFT JOIN `user` u ON gr.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
|
|
|
+ LEFT JOIN order_goods og ON gr.order_goods_id = og.order_goods_id
|
|
|
+ WHERE
|
|
|
+ gr.order_sn = #{orderSn}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCountConfirmPeriod" parameterType="map" resultType="Long">
|