|
@@ -224,35 +224,49 @@
|
|
|
|
|
|
|
|
|
<select id="getUserRewardList" resultType="cn.com.ty.lift.ud.userInfo.mapper.entity.UserRewardListVo">
|
|
|
- select * from(
|
|
|
- select
|
|
|
- sv.data_id id,
|
|
|
- sv.user_id userId,
|
|
|
- CONCAT("电梯学堂","-",info.name) targetUserName,
|
|
|
- bill.user_id targetUserId,
|
|
|
- info.avatar_url targetAvatarUrl,
|
|
|
- bill.amount amount,
|
|
|
- sv.create_time createTime
|
|
|
- from school_video_operate sv
|
|
|
- left join user_bill bill on bill.flow_num=sv.third_order_sn and bill.user_id!=#{userId}
|
|
|
- left join user_info info on info.user_id = bill.user_id
|
|
|
- where sv.type = 4 and sv.user_id=#{userId}
|
|
|
+
|
|
|
+ SELECT
|
|
|
+ a.target_user_id targetUserId,
|
|
|
+ a.user_id userId,
|
|
|
+ b.`name` targetUserName,
|
|
|
+ a.amount amount,
|
|
|
+ a.create_time,
|
|
|
+ b.avatar_url targetAvatarUrl
|
|
|
+ FROM
|
|
|
+ user_bill a
|
|
|
+ LEFT JOIN user_info b ON a.user_id = b.user_id
|
|
|
+ WHERE
|
|
|
+ a.business_type = 2
|
|
|
+ AND a.user_id = #{userId}
|
|
|
+<!-- select * from( -->
|
|
|
+<!-- select -->
|
|
|
+<!-- sv.data_id id, -->
|
|
|
+<!-- sv.user_id userId, -->
|
|
|
+<!-- CONCAT("电梯学堂","-",info.name) targetUserName, -->
|
|
|
+<!-- bill.user_id targetUserId, -->
|
|
|
+<!-- info.avatar_url targetAvatarUrl, -->
|
|
|
+<!-- bill.amount amount, -->
|
|
|
+<!-- sv.create_time createTime -->
|
|
|
+<!-- from school_video_operate sv -->
|
|
|
+<!-- left join user_bill bill on bill.flow_num=sv.third_order_sn and bill.user_id!=#{userId} -->
|
|
|
+<!-- left join user_info info on info.user_id = bill.user_id -->
|
|
|
+<!-- where sv.type = 4 and sv.user_id=#{userId} -->
|
|
|
|
|
|
- union
|
|
|
+<!-- union -->
|
|
|
|
|
|
- select
|
|
|
- sv.data_id id,
|
|
|
- sv.user_id userId,
|
|
|
- CONCAT("案例中心","-",info.name) targetUserName,
|
|
|
- bill.user_id targetUserId,
|
|
|
- info.avatar_url targetAvatarUrl,
|
|
|
- bill.amount amount,
|
|
|
- sv.create_time createTime
|
|
|
- from question_operate sv
|
|
|
- left join user_bill bill on bill.flow_num=sv.order_serial_number and bill.user_id!=#{userId}
|
|
|
- left join user_info info on info.user_id = bill.user_id
|
|
|
- where sv.type = 4 and sv.user_id=#{userId}
|
|
|
- ) temp order by createTime;
|
|
|
+<!-- select -->
|
|
|
+<!-- sv.data_id id, -->
|
|
|
+<!-- sv.user_id userId, -->
|
|
|
+<!-- CONCAT("案例中心","-",info.name) targetUserName, -->
|
|
|
+<!-- bill.user_id targetUserId, -->
|
|
|
+<!-- info.avatar_url targetAvatarUrl, -->
|
|
|
+<!-- bill.amount amount, -->
|
|
|
+<!-- sv.create_time createTime -->
|
|
|
+<!-- from question_operate sv -->
|
|
|
+<!-- left join user_bill bill on bill.flow_num=sv.order_serial_number and bill.user_id!=#{userId} -->
|
|
|
+<!-- left join user_info info on info.user_id = bill.user_id -->
|
|
|
+<!-- where sv.type = 4 and sv.user_id=#{userId} -->
|
|
|
+<!-- ) temp order by create_time; -->
|
|
|
|
|
|
</select>
|
|
|
</mapper>
|