张涛 hace 11 meses
padre
commit
ebe4d69ff6

+ 53
- 0
src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java Ver fichero

@@ -167,7 +167,60 @@ public class TaOrgIssueController extends BaseController {
167 167
     }
168 168
 
169 169
 
170
+    /**
171
+     * 分页查询
172
+     *
173
+     * @param pageNum 当前页码
174
+     * @param pageSize 每页条数
175
+     * @return 查询结果
176
+     */
177
+    @ApiOperation("分页查询")
178
+    @GetMapping("/taOrgIssue/issue")
179
+    public ResponseBean listIssue(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
180
+                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
181
+                             @ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
182
+                             @ApiParam("status") @RequestParam(value = "status", required = false) String status,
183
+                             @ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
184
+                             @ApiParam("数据来源") @RequestParam(value ="sourceType", required = false) String sourceType,
185
+                             @ApiParam("类型ID") @RequestParam(value = "typeId", required = false) String typeId,
186
+                             @ApiParam("上报人") @RequestParam(value = "userName", required = false) String userName,
187
+                             @ApiParam(value = "创建时间-开始", example = "2023-03-01") @RequestParam(value = "createDateStart", required = false) String createDateStart,
188
+                             @ApiParam(value = "创建时间-结束", example = "2023-03-31") @RequestParam(value = "createDateEnd", required = false) String createDateEnd,
189
+                             @ApiParam(value = "结单时间-开始", example = "2023-03-01") @RequestParam(value = "endDateStart", required = false) String endDateStart,
190
+                             @ApiParam(value = "结单时间-结束", example = "2023-03-31") @RequestParam(value = "endDateEnd", required = false) String endDateEnd,
191
+                             @ApiParam("业务状态") @RequestParam(value ="bizStatus", required = false) String bizStatus) throws Exception {
192
+        SysUser sysUser = currentUser();
193
+
194
+        Map<String, Object> params = new HashMap<>();
195
+        params.put("issueId", issueId);
196
+        params.put("status", status);
197
+        params.put("typeId", typeId);
198
+        params.put("bizStatus", bizStatus);
199
+        params.put("sourceType", sourceType);
200
+        params.put("locId", locId);
201
+        params.put("orgId", sysUser.getOrgId());
202
+        params.put("userName", userName);
203
+        if (StringUtils.isNotEmpty(createDateStart)) {
204
+            params.put("createDateStart", DateUtils.day2LocalDateime(createDateStart));
205
+            params.put("createDateEnd", DateUtils.day2LocalDateime2(createDateEnd));
206
+        } else {
207
+            params.put("createDateStart", null);
208
+            params.put("createDateEnd", null);
209
+        }
170 210
 
211
+        if (StringUtils.isNotEmpty(endDateStart)) {
212
+            params.put("endDateStart", DateUtils.day2LocalDateime(endDateStart));
213
+            params.put("endDateEnd", DateUtils.day2LocalDateime2(endDateEnd));
214
+        } else {
215
+            params.put("endDateStart", null);
216
+            params.put("endDateEnd", null);
217
+        }
218
+
219
+        IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
220
+        IPage<TaIssue> result = taOrgIssueService.getIssuePageIssue(pg, params);
221
+
222
+        return ResponseBean.success(result);
223
+    }
171 224
 
172 225
 
173 226
 

+ 2
- 0
src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java Ver fichero

@@ -31,4 +31,6 @@ public interface TaOrgIssueMapper  extends BaseMapper<TaOrgIssue>{
31 31
     int removeByIssueId(@Param("issueId") String issueId);
32 32
 
33 33
     List<TaOrgIssue> getByListIssueId(@Param("issueId") Integer issueId);
34
+
35
+    IPage<TaIssue> getIssuePageIssue(IPage<TaIssue> pg,@Param("params") Map<String, Object> params);
34 36
 }

+ 2
- 0
src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java Ver fichero

@@ -33,4 +33,6 @@ public interface TaOrgIssueService extends IBaseService<TaOrgIssue> {
33 33
 
34 34
 
35 35
      List<TaOrgIssue> getByListIssueId(Integer issueId);
36
+
37
+     IPage<TaIssue> getIssuePageIssue(IPage<TaIssue> pg, Map<String, Object> params);
36 38
 }

+ 5
- 0
src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java Ver fichero

@@ -205,4 +205,9 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
205 205
         return baseMapper.getByListIssueId(issueId);
206 206
     }
207 207
 
208
+    @Override
209
+    public IPage<TaIssue> getIssuePageIssue(IPage<TaIssue> pg, Map<String, Object> params) {
210
+        return baseMapper.getIssuePageIssue(pg ,params);
211
+    }
212
+
208 213
 }

+ 19
- 4
src/main/resources/mapper/TaOrgIssueMapper.xml Ver fichero

@@ -30,10 +30,7 @@
30 30
         WHERE
31 31
         s.issue_id = t.issue_id
32 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
-
33
+        AND s.`status` &gt; -1
37 34
         )
38 35
         AND t.org_id = #{params.orgId}
39 36
         <if test="params.issueId != null and params.issueId != ''">
@@ -124,6 +121,24 @@
124 121
         INNER JOIN sys_org so on oi.org_id=so.org_id and so.`status`=1
125 122
         WHERE
126 123
         oi.issue_id = #{issueId}
124
+        and oi.`status` = -2
125
+        ORDER BY
126
+        oi.create_date DESC
127
+    </select>
128
+
129
+
127 130
 
131
+    <select id="getIssuePageIssue" resultType="com.example.civilizedcity.entity.TaIssue">
132
+        SELECT DISTINCT t.* from  ta_org_issue io
133
+        INNER JOIN 	ta_issue t on io.issue_id=t.issue_id and t.`status` &gt; 1
134
+        and t.source_type IN ( 'check', 'inspector' )
135
+        WHERE
136
+        io.org_id=#{params.orgId}
137
+        AND io.`status` = -2
138
+        <if test="params.issueId != null and params.issueId != ''">
139
+            AND t.issue_id = #{params.issueId}
140
+        </if>
141
+        ORDER BY
142
+        t.create_date DESC
128 143
     </select>
129 144
 </mapper>