| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.zhongzheng.modules.order.mapper.OrderGoodsRefundMapper">
- <resultMap type="com.zhongzheng.modules.order.domain.OrderGoodsRefund" id="OrderGoodsRefundResult">
- <result property="refundId" column="refund_id"/>
- <result property="refundSn" column="refund_sn"/>
- <result property="userId" column="user_id"/>
- <result property="orderSn" column="order_sn"/>
- <result property="goodsId" column="goods_id"/>
- <result property="refundFee" column="refund_fee"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="status" column="status"/>
- <result property="wxpayRefundId" column="wxpay_refund_id"/>
- <result property="applyReason" column="apply_reason"/>
- <result property="applyImgs" column="apply_imgs"/>
- <result property="type" column="type"/>
- <result property="orderGoodsId" column="order_goods_id"/>
- <result property="periodStatus" column="period_status"/>
- <result property="periodReason" column="period_reason"/>
- <result property="periodReviewReason" column="period_review_reason"/>
- <result property="periodUsername" column="period_username"/>
- <result property="periodReviewUsername" column="period_review_username"/>
- <result property="periodTime" column="period_time"/>
- <result property="periodReviewTime" column="period_review_time"/>
- <result property="refundTime" column="refund_time"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.order.vo.OrderGoodsRefundVo" id="OrderGoodsRefundVoResult">
- <result property="refundId" column="refund_id"/>
- <result property="refundSn" column="refund_sn"/>
- <result property="userId" column="user_id"/>
- <result property="orderSn" column="order_sn"/>
- <result property="goodsId" column="goods_id"/>
- <result property="refundFee" column="refund_fee"/>
- <result property="createTime" column="create_time"/>
- <result property="status" column="status"/>
- <result property="wxpayRefundId" column="wxpay_refund_id"/>
- <result property="goodsName" column="goods_name"/>
- <result property="coverUrl" column="cover_url"/>
- <result property="applyReason" column="apply_reason"/>
- <result property="applyImgs" column="apply_imgs"/>
- <result property="type" column="type"/>
- <result property="orderGoodsId" column="order_goods_id"/>
- <result property="periodStatus" column="period_status"/>
- <result property="periodReason" column="period_reason"/>
- <result property="periodReviewReason" column="period_review_reason"/>
- <result property="periodUsername" column="period_username"/>
- <result property="periodReviewUsername" column="period_review_username"/>
- <result property="periodTime" column="period_time"/>
- <result property="periodReviewTime" column="period_review_time"/>
- <result property="realname" column="realname"/>
- <result property="educationName" column="education_name"/>
- <result property="projectName" column="project_name"/>
- <result property="businessName" column="business_name"/>
- <result property="goodsPrice" column="goods_price"/>
- <result property="goodsRealPrice" column="goods_real_price"/>
- <result property="goodsReceived" column="goods_received"/>
- <result property="payStatus" column="pay_status"/>
- <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="telphone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="year" column="year"/>
- <result property="refundTime" column="refund_time"/>
- </resultMap>
- <select id="selectListByBo" 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 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 og.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>
- -- ORDER BY gr.refund_id DESC
- ORDER BY gr.order_sn ASC , gr.create_time ASC
- </select>
- <select id="selectCountConfirmPeriod" parameterType="map" resultType="Long">
- SELECT
- COUNT(1)
- FROM
- order_goods_refund gr JOIN goods g on gr.goods_id = g.goods_id JOIN course_business b on g.business_id = b.id
- WHERE
- 1 = 1
- AND gr.refund_id = #{refundId}
- and FIND_IN_SET(#{userId},b.refund_confirm_user_ids)
- </select>
- <select id="selectCountFirstPeriod" parameterType="map" resultType="Long">
- SELECT
- COUNT(1)
- FROM
- order_goods_refund gr JOIN goods g on gr.goods_id = g.goods_id JOIN course_business b on g.business_id = b.id
- WHERE
- 1 = 1
- AND gr.refund_id = #{refundId}
- and FIND_IN_SET(#{userId},b.refund_user_ids)
- </select>
- </mapper>
|