Quellcode durchsuchen

项目月份修改新增公司

anderx vor 1 Jahr
Ursprung
Commit
520ce8e387

+ 13 - 17
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectTaskAllBo.java

@@ -4,31 +4,27 @@ import java.util.List;
 
 public class ProjectTaskAllBo {
 
-    private Integer id;
-    private String name;
-    private List<String>  months;
 
-    public Integer getId() {
-        return id;
-    }
+    private String companyName;
 
-    public void setId(Integer id) {
-        this.id = id;
-    }
+    private List<ProjectTaskBo> projectList;
 
-    public String getName() {
-        return name;
+    public String getCompanyName() {
+        return companyName;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setCompanyName(String companyName) {
+        this.companyName = companyName;
     }
 
-    public List<String> getMonths() {
-        return months;
+    public List<ProjectTaskBo> getProjectList() {
+        return projectList;
     }
 
-    public void setMonths(List<String> months) {
-        this.months = months;
+    public void setProjectList(List<ProjectTaskBo> projectList) {
+        this.projectList = projectList;
     }
+
+
+
 }

+ 33 - 0
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectTaskBo.java

@@ -0,0 +1,33 @@
+package com.ruoyi.project.bo;
+
+import java.util.List;
+
+public class ProjectTaskBo {
+        private Integer id;
+        private String name;
+        private List<String> months;
+
+        public Integer getId() {
+            return id;
+        }
+
+        public void setId(Integer id) {
+            this.id = id;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public List<String> getMonths() {
+            return months;
+        }
+
+        public void setMonths(List<String> months) {
+            this.months = months;
+        }
+}

+ 13 - 9
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -299,23 +299,27 @@
         where project_status =0
     </select>
     <resultMap id="AllProjectMonthMap" type="com.ruoyi.project.bo.ProjectTaskAllBo">
-    <id property="id" column="id"/>
-        <result property="name" column="name" />
-        <collection property="months" ofType="String">
-            <result column="recordTime" />
+        <result column="company_name" property="companyName" />
+        <collection property="projectList" ofType="com.ruoyi.project.bo.ProjectTaskBo">
+            <id column="id" property="id" />
+            <result column="name" property="name" />
+            <collection property="months" ofType="String">
+                <result column="recordTime" />
+            </collection>
         </collection>
     </resultMap>
 
     <select id="getAllProjectMonth" resultMap="AllProjectMonthMap">
-        select x.id,x.name,x.recordTime
-        from (select a.id,a.name ,date_format(b.record_time,'%Y-%m')recordTime
-              from project_task a left join project_staff_record b on a.id =b.pid
-              left join sys_user c on b.aid=c.user_id left join sys_dept d on c.dept_id=d.dept_id
+        select x.id,x.name,x.recordTime,x.company_name companyName
+        from (select a.id,a.name ,date_format(b.record_time,'%Y-%m')recordTime,d.company_name
+        from project_task a left join project_staff_record b on a.id =b.pid
+        left join sys_user c on b.aid=c.user_id left join sys_dept d on c.dept_id=d.dept_id
               where b.process_status=2
               <if test="companyId !=null">
                   and  d.company_id= #{companyId}
               </if>
-              )x where x.recordTime is not null group by x.id,x.name,x.recordTime
+              )x where x.recordTime is not null
+        group by x.id,x.name,x.recordTime,x.company_name
     </select>