Просмотр исходного кода

2023-3-1 安卓端调用用户信息接口,修改是否违规状态。

chaiyunlong лет назад: 2
Родитель
Сommit
1c80e6c516

+ 8 - 5
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabViolationMapper.xml

@@ -617,12 +617,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                  u.`avatar` as avatar,
                  u.`nick_name` as userName,
                  d.`dept_name` as deptName,
-                 IFNULL(v.`status`,1) as status,
+                 CASE WHEN b.`id` IS NOT NULL THEN 2 ELSE CASE WHEN r.`id` IS NOT NULL THEN 1 ELSE 0 END END AS status,
                  (SELECT COUNT(1) FROM lab_negativelist_history he WHERE he.user_id = u.`user_id`) as violatioNum,
                  IFNULL(v.`negative_list_num`,0) as negativeListCount,
                  IFNULL((SELECT COUNT(1) FROM lab_blackdetail b INNER JOIN lab_blacklist t ON b.black_id = t.id WHERE t.`join_user_id` = u.user_id GROUP BY b.black_id),0) as blackListNum,
-                 r.`credit_score` as totalPoints ,
-                 r.`bonus_points` as bonusPoints,
+                 t.`credit_score` as totalPoints ,
+                 t.`bonus_points` as bonusPoints,
                  (SELECT CONCAT(TRUNCATE(IFNULL(SUM(duration), 0)/3600, 0),'小时',TRUNCATE((IFNULL(SUM(duration), 0)%3600/60), 0),'分钟') FROM el_chapter_learn_record lr WHERE lr.join_user_id = u.`user_id`) studyLen
         FROM
             sys_user u
@@ -630,8 +630,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                            ON v.`join_user_id` = u.`user_id`
                 left JOIN sys_dept d
                            ON u.`dept_id` = d.`dept_id`
-                left JOIN `el_points_record` r
-                           ON u.`user_id`=r.`join_user_id` WHERE u.user_id=#{userid} GROUP BY u.`user_id`
+                left JOIN `el_points_record` t
+                           ON u.`user_id`=t.`join_user_id`
+                LEFT JOIN lab_negative_list_records r ON r.user_id = t.`join_user_id` AND r.is_negative=1
+                LEFT JOIN lab_blacklist b ON b.join_user_id = t.`join_user_id` AND b.blacklist_status = 1
+                        WHERE u.user_id=#{userid} GROUP BY u.`user_id`
     </select>
 
     <update id="updateblackStatus">