张涛 11 months ago
parent
commit
be2b8c51fb

+ 24
- 2
src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java View File

66
 
66
 
67
         return ResponseBean.success(taOrgIssue);
67
         return ResponseBean.success(taOrgIssue);
68
     }
68
     }
69
+
70
+    /**
71
+     * 通过ID查询单条数据
72
+     *
73
+     * @param id 主键
74
+     * @return 实例对象
75
+     */
76
+    @ApiOperation("通过ID查询单条数据")
77
+    @GetMapping("/taOrgIssueId/{id}")
78
+    public ResponseBean queryByListId(@ApiParam("对象ID") @PathVariable Integer id) throws Exception {
79
+        List<TaOrgIssue> taOrgIssue = taOrgIssueService.getByListIssueId(id);
80
+
81
+
82
+        return ResponseBean.success(taOrgIssue);
83
+    }
84
+
69
      /**
85
      /**
70
       * 通过ISSUE_ID查询单条数据
86
       * 通过ISSUE_ID查询单条数据
71
       *
87
       *
107
     public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
123
     public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
108
                              @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
124
                              @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
109
                              @ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
125
                              @ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
126
+                             @ApiParam("status") @RequestParam(value = "status", required = false) String status,
110
                              @ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
127
                              @ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
111
                              @ApiParam("数据来源") @RequestParam(value ="sourceType", required = false) String sourceType,
128
                              @ApiParam("数据来源") @RequestParam(value ="sourceType", required = false) String sourceType,
112
                              @ApiParam("类型ID") @RequestParam(value = "typeId", required = false) String typeId,
129
                              @ApiParam("类型ID") @RequestParam(value = "typeId", required = false) String typeId,
120
 
137
 
121
         Map<String, Object> params = new HashMap<>();
138
         Map<String, Object> params = new HashMap<>();
122
         params.put("issueId", issueId);
139
         params.put("issueId", issueId);
140
+        params.put("status", status);
123
         params.put("typeId", typeId);
141
         params.put("typeId", typeId);
124
         params.put("bizStatus", bizStatus);
142
         params.put("bizStatus", bizStatus);
125
         params.put("sourceType", sourceType);
143
         params.put("sourceType", sourceType);
149
     }
167
     }
150
 
168
 
151
 
169
 
170
+
171
+
172
+
173
+
152
      /**
174
      /**
153
       * 分页查询
175
       * 分页查询
154
       *
176
       *
155
-      * @param pageNum 当前页码
156
-      * @param pageSize 每页条数
177
+      * @param
178
+      * @param
157
       * @return 查询结果
179
       * @return 查询结果
158
       */
180
       */
159
      @ApiOperation("分页查询")
181
      @ApiOperation("分页查询")

+ 4
- 0
src/main/java/com/example/civilizedcity/entity/TaOrgIssue.java View File

58
     @ApiModelProperty(name = "文件列表",notes = "")
58
     @ApiModelProperty(name = "文件列表",notes = "")
59
     private List<TaAttach> attachList ;
59
     private List<TaAttach> attachList ;
60
 
60
 
61
+     @TableField(exist = false)
62
+     @ApiModelProperty(name = "部门名称",notes = "")
63
+     private String orgName ;
64
+
61
 }
65
 }

+ 4
- 1
src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java View File

18
 @Mapper
18
 @Mapper
19
 public interface TaOrgIssueMapper  extends BaseMapper<TaOrgIssue>{
19
 public interface TaOrgIssueMapper  extends BaseMapper<TaOrgIssue>{
20
 
20
 
21
-     IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, @Param("params") Map<String, Object> params);
21
+    IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, @Param("params") Map<String, Object> params);
22
+
22
 
23
 
23
      TaOrgIssue getByIssueAndOrg(@Param("issueId") Integer issueId, @Param("orgId") String orgId);
24
      TaOrgIssue getByIssueAndOrg(@Param("issueId") Integer issueId, @Param("orgId") String orgId);
24
 
25
 
28
 
29
 
29
     List<TaIssue> getIssueListBy(@Param("params") Map<String, Object> params);
30
     List<TaIssue> getIssueListBy(@Param("params") Map<String, Object> params);
30
     int removeByIssueId(@Param("issueId") String issueId);
31
     int removeByIssueId(@Param("issueId") String issueId);
32
+
33
+    List<TaOrgIssue> getByListIssueId(@Param("issueId") Integer issueId);
31
 }
34
 }

+ 4
- 0
src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java View File

29
      void removeByIssueId(String issueId);
29
      void removeByIssueId(String issueId);
30
 
30
 
31
      void createNewIssue2(TaIssue taIssue, TaOrgIssue originOrgIssue, TaIssueProcess taIssueProcess, SysUser sysUser) throws Exception;
31
      void createNewIssue2(TaIssue taIssue, TaOrgIssue originOrgIssue, TaIssueProcess taIssueProcess, SysUser sysUser) throws Exception;
32
+
33
+
34
+
35
+     List<TaOrgIssue> getByListIssueId(Integer issueId);
32
 }
36
 }

+ 6
- 0
src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java View File

66
         return baseMapper.getIssuePageBy(pg, params);
66
         return baseMapper.getIssuePageBy(pg, params);
67
     }
67
     }
68
 
68
 
69
+
69
     @Transactional(rollbackFor = Exception.class)
70
     @Transactional(rollbackFor = Exception.class)
70
     @Override
71
     @Override
71
     public void createNewIssue(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser sysUser) throws Exception {
72
     public void createNewIssue(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser sysUser) throws Exception {
199
         applicationEventPublisher.publishEvent(new MessagEvent(this, taOrgIssue));
200
         applicationEventPublisher.publishEvent(new MessagEvent(this, taOrgIssue));
200
     }
201
     }
201
 
202
 
203
+    @Override
204
+    public List<TaOrgIssue> getByListIssueId(Integer issueId) {
205
+        return baseMapper.getByListIssueId(issueId);
206
+    }
207
+
202
 }
208
 }

+ 50
- 34
src/main/resources/mapper/TaOrgIssueMapper.xml View File

6
         UPDATE ta_org_issue t
6
         UPDATE ta_org_issue t
7
         SET t.process_status = #{processStatus}
7
         SET t.process_status = #{processStatus}
8
         WHERE
8
         WHERE
9
-            t.org_id = #{orgId}
10
-          AND t.issue_id = #{issueId}
9
+        t.org_id = #{orgId}
10
+        AND t.issue_id = #{issueId}
11
     </update>
11
     </update>
12
     <update id="removeByIssueId">
12
     <update id="removeByIssueId">
13
         UPDATE ta_org_issue t
13
         UPDATE ta_org_issue t
22
         FROM
22
         FROM
23
         ta_issue t
23
         ta_issue t
24
         WHERE
24
         WHERE
25
-            EXISTS (
26
-            SELECT
27
-                *
28
-            FROM
29
-                ta_org_issue s
30
-            WHERE
31
-                s.issue_id = t.issue_id
32
-                AND s.org_id = t.org_id
33
-                AND s.`status` &gt; -1
34
-            )
35
-            AND t.org_id = #{params.orgId}
25
+        EXISTS (
26
+        SELECT
27
+        *
28
+        FROM
29
+        ta_org_issue s
30
+        WHERE
31
+        s.issue_id = t.issue_id
32
+        AND s.org_id = t.org_id
33
+        <if test="params.status != null and params.status != ''">
34
+            AND s.`status` = #{params.status}
35
+        </if>
36
+
37
+        )
38
+        AND t.org_id = #{params.orgId}
36
         <if test="params.issueId != null and params.issueId != ''">
39
         <if test="params.issueId != null and params.issueId != ''">
37
             AND t.issue_id = #{params.issueId}
40
             AND t.issue_id = #{params.issueId}
38
         </if>
41
         </if>
68
         <if test="params.userName != null and params.userName != ''">
71
         <if test="params.userName != null and params.userName != ''">
69
             AND t.user_name LIKE CONCAT('%', #{params.userName}, '%')
72
             AND t.user_name LIKE CONCAT('%', #{params.userName}, '%')
70
         </if>
73
         </if>
71
-            AND t.`status` &gt; -1
74
+        AND t.`status` &gt; -1
72
         ORDER BY
75
         ORDER BY
73
-            t.create_date DESC
76
+        t.create_date DESC
74
     </sql>
77
     </sql>
75
 
78
 
76
     <select id="getIssuePageBy" resultType="com.example.civilizedcity.entity.TaIssue">
79
     <select id="getIssuePageBy" resultType="com.example.civilizedcity.entity.TaIssue">
77
         <include refid="getOrgIssueList"></include>
80
         <include refid="getOrgIssueList"></include>
81
+
78
     </select>
82
     </select>
83
+
84
+
79
     <select id="getByIssueAndOrg" resultType="com.example.civilizedcity.entity.TaOrgIssue">
85
     <select id="getByIssueAndOrg" resultType="com.example.civilizedcity.entity.TaOrgIssue">
80
         SELECT
86
         SELECT
81
-            *
87
+        *
82
         FROM
88
         FROM
83
-            ta_org_issue t
89
+        ta_org_issue t
84
         WHERE
90
         WHERE
85
-            t.issue_id = #{issueId}
86
-          AND t.org_id = #{orgId}
87
-          AND t.`status` = 1
91
+        t.issue_id = #{issueId}
92
+        AND t.org_id = #{orgId}
93
+        AND t.`status` = 1
88
         ORDER BY t.create_date DESC
94
         ORDER BY t.create_date DESC
89
         LIMIT 1
95
         LIMIT 1
90
     </select>
96
     </select>
91
     <select id="statMaIndex" resultType="java.util.Map">
97
     <select id="statMaIndex" resultType="java.util.Map">
92
         select
98
         select
93
-            SUM( IF (TO_DAYS(NOW()) &gt; TO_DAYS( t.expire_date ) AND t.process_node != '03', 1, 0 ) ) AS delay_num,
94
-            SUM( IF (t.process_node = '03', 1, 0 ) ) AS end_num,
95
-            SUM( IF (t.process_node != '03', 1, 0 ) ) AS doing_num
99
+        SUM( IF (TO_DAYS(NOW()) &gt; TO_DAYS( t.expire_date ) AND t.process_node != '03', 1, 0 ) ) AS delay_num,
100
+        SUM( IF (t.process_node = '03', 1, 0 ) ) AS end_num,
101
+        SUM( IF (t.process_node != '03', 1, 0 ) ) AS doing_num
96
         from ta_issue t
102
         from ta_issue t
97
         where EXISTS (
103
         where EXISTS (
98
-                SELECT
99
-                    *
100
-                FROM
101
-                    ta_org_issue s
102
-                WHERE
103
-                    s.issue_id = t.issue_id
104
-                  AND s.org_id = t.org_id
105
-                  AND s.`status` &gt; - 1
106
-            )
107
-            and t.org_id = #{orgId}
108
-          and t.`status` &gt; -1
104
+        SELECT
105
+        *
106
+        FROM
107
+        ta_org_issue s
108
+        WHERE
109
+        s.issue_id = t.issue_id
110
+        AND s.org_id = t.org_id
111
+        AND s.`status` &gt; - 1
112
+        )
113
+        and t.org_id = #{orgId}
114
+        and t.`status` &gt; -1
109
     </select>
115
     </select>
110
     <select id="getIssueListBy" resultType="com.example.civilizedcity.entity.TaIssue">
116
     <select id="getIssueListBy" resultType="com.example.civilizedcity.entity.TaIssue">
111
         <include refid="getOrgIssueList"></include>
117
         <include refid="getOrgIssueList"></include>
112
     </select>
118
     </select>
119
+    <select id="getByListIssueId" resultType="com.example.civilizedcity.entity.TaOrgIssue">
120
+        SELECT
121
+        so.name as orgName,oi.*
122
+        FROM
123
+        ta_org_issue oi
124
+        INNER JOIN sys_org so on oi.org_id=so.org_id and so.`status`=1
125
+        WHERE
126
+        oi.issue_id = #{issueId}
127
+
128
+    </select>
113
 </mapper>
129
 </mapper>