ソースを参照

项目管理列表查询,设备总数、最新跟进结果字段查询错误bug

renzx 1 ヶ月 前
コミット
1c72ae92f3

+ 13 - 5
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcProjectMapper.xml

@@ -114,11 +114,19 @@
                  left join tc_account ta on p.account_id = ta.account_id
                  left join tb_agent a on a.agent_id = p.owner_agent
                  left join tb_country c on p.country_id = c.country_id
-                 left join (select business_id, follow_desc, follow_time, create_by
-                            from tc_follow
-                            where follow_type = '2'
-                              and del_flag = '0'
-                            order by ifnull(update_time, create_time)) f on f.business_id = p.project_id
+                 left join (
+                    SELECT
+                        business_id,
+                        max(follow_time) as follow_time,
+                        max(create_by) as create_by ,
+                        max(follow_desc) as follow_desc
+                    FROM
+                        tc_follow
+                    WHERE
+                        follow_type = '2'
+                      AND del_flag = '0'
+                    group by business_id
+                 ) f on f.business_id = p.project_id
                  left join sys_user u on u.user_id = p.owner
                  left join sys_user su on su.user_id = f.create_by
                  left join sys_user su2 on su2.user_id = p.create_by