|
@@ -147,4 +147,37 @@
|
|
|
LEFT JOIN student_payment_order spo ON spo.order_no_ = so.order_no_
|
|
|
WHERE spo.status_ = 'SUCCESS' AND TIMESTAMPDIFF(HOUR,spo.pay_time_,NOW()) >= #{autoAffirmReceiveTime}
|
|
|
</select>
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.dto.StudentPaymentOrderDto" id="StudentPaymentOrderDto" extends="com.ym.mec.biz.dal.dao.StudentPaymentOrderDao.StudentPaymentOrder">
|
|
|
+ <result column="goods_image_" property="image" />
|
|
|
+ <result column="goods_name_" property="goodsName" />
|
|
|
+ <result column="goods_num_" property="goodsNum" />
|
|
|
+ <result column="goods_amount_" property="goodsAmount" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="queryStudentPaymentOrdersSql">
|
|
|
+ <where>
|
|
|
+ <if test="status != null">
|
|
|
+ AND spo.status_ = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="receiveStatus != null and receiveStatus != ''">
|
|
|
+ AND spo.receive_status_ = #{receiveStatus}
|
|
|
+ </if>
|
|
|
+ <if test="studentId != null">
|
|
|
+ AND spo.user_id_ = #{studentId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <select id="queryStudentPaymentOrders" resultMap="StudentPaymentOrderDto">
|
|
|
+ SELECT spo.*,g.image_ goods_image_,g.name_ goods_name_,so.num_ goods_num_,so.expect_amount_ goods_amount_
|
|
|
+ FROM student_payment_order spo
|
|
|
+ LEFT JOIN sell_order so ON so.order_no_ = spo.order_no_
|
|
|
+ LEFT JOIN goods g ON g.id_ = so.goods_id_
|
|
|
+ <include refid="queryStudentPaymentOrdersSql"/>
|
|
|
+ ORDER BY spo.pay_time_ DESC
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+ <select id="countStudentPaymentOrders" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(DISTINCT spo.id_)
|
|
|
+ FROM student_payment_order spo
|
|
|
+ <include refid="queryStudentPaymentOrdersSql"/>
|
|
|
+ </select>
|
|
|
</mapper>
|