张涛 2 yıl önce
ebeveyn
işleme
8e339a2849

+ 18
- 0
src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java Dosyayı Görüntüle

@@ -235,6 +235,24 @@ public class TaOrgIssueController extends BaseController {
235 235
         taOrgIssueService.updateData(taOrgIssue);
236 236
         return ResponseBean.success(taOrgIssue);
237 237
     }
238
+
239
+
240
+
241
+    /**
242
+     * 通过主键删除数据
243
+     *
244
+     * @param orgIssueId
245
+     * @return 是否成功
246
+     *
247
+     */
248
+
249
+    @ApiOperation(value="通过主键删除数据",httpMethod="DELETE")
250
+    @DeleteMapping("/taOrgIssue/{issueId}")
251
+    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String issueId){
252
+        taOrgIssueService.removeByIssueId(issueId);
253
+        return ResponseBean.success("success成功删除");
254
+    }
255
+
238 256
 //
239 257
 //    /**
240 258
 //     * 通过主键删除数据

+ 4
- 0
src/main/java/com/example/civilizedcity/controller/TdIssueTypeController.java Dosyayı Görüntüle

@@ -99,4 +99,8 @@ public class TdIssueTypeController extends BaseController {
99 99
         tdIssueTypeService.removeLogicById(id);
100 100
         return ResponseBean.success("success");
101 101
     }
102
+
103
+
104
+
105
+
102 106
 }

+ 5
- 5
src/main/java/com/example/civilizedcity/controller/TdLocTypeController.java Dosyayı Görüntüle

@@ -56,11 +56,11 @@ public class TdLocTypeController extends BaseController {
56 56
                              @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
57 57
 
58 58
         IPage<TdLocType> pg = new Page<>(pageNum, pageSize);
59
-        QueryWrapper<TdLocType> queryWrapper = new QueryWrapper<>();
60
-        queryWrapper.gt("status", Constants.STATUS_DELETE);
61
-        queryWrapper.orderByDesc("create_date");
62
-        IPage<TdLocType> result = tdLocTypeService.page(pg, queryWrapper);
63
-
59
+//        QueryWrapper<TdLocType> queryWrapper = new QueryWrapper<>();
60
+//        queryWrapper.gt("status", Constants.STATUS_DELETE);
61
+//        queryWrapper.orderByDesc("create_date");
62
+//        IPage<TdLocType> result = tdLocTypeService.page(pg, queryWrapper);
63
+        IPage<TdLocType> result = tdLocTypeService.pageAsc(pg);
64 64
         return ResponseBean.success(result);
65 65
     }
66 66
 

+ 4
- 0
src/main/java/com/example/civilizedcity/mapper/TaIssueMapper.java Dosyayı Görüntüle

@@ -40,4 +40,8 @@ public interface TaIssueMapper  extends BaseMapper<TaIssue>{
40 40
                       @Param("processStatus") String processStatus);
41 41
 
42 42
     List<StatVo> statIssueLoc();
43
+
44
+
45
+    int removeByIssueId(@Param("issueId") String issueId);
46
+
43 47
 }

+ 1
- 0
src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java Dosyayı Görüntüle

@@ -27,4 +27,5 @@ public interface TaOrgIssueMapper  extends BaseMapper<TaOrgIssue>{
27 27
     int updateProcess(@Param("issueId") Integer issueId,@Param("orgId") String orgId,@Param("processStatus") String processStatus);
28 28
 
29 29
     List<TaIssue> getIssueListBy(@Param("params") Map<String, Object> params);
30
+    int removeByIssueId(@Param("issueId") String issueId);
30 31
 }

+ 4
- 2
src/main/java/com/example/civilizedcity/mapper/TdLocTypeMapper.java Dosyayı Görüntüle

@@ -1,6 +1,7 @@
1 1
 package com.example.civilizedcity.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import org.apache.ibatis.annotations.Mapper;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 import com.example.civilizedcity.entity.TdLocType;
@@ -12,5 +13,6 @@ import com.example.civilizedcity.entity.TdLocType;
12 13
  */
13 14
 @Mapper
14 15
 public interface TdLocTypeMapper  extends BaseMapper<TdLocType>{
15
-    
16
-}
16
+  IPage<TdLocType> sortAsc(IPage<TdLocType> pg);
17
+
18
+ }

+ 3
- 1
src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java Dosyayı Görüntüle

@@ -25,4 +25,6 @@ public interface TaOrgIssueService extends IBaseService<TaOrgIssue> {
25 25
      void updateData(TaOrgIssue taOrgIssue) throws Exception;
26 26
 
27 27
      List<TaIssue> getIssueListBy(Map<String, Object> params);
28
- }
28
+
29
+     void removeByIssueId(String issueId);
30
+}

+ 3
- 2
src/main/java/com/example/civilizedcity/service/TdLocTypeService.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
1 1
 package com.example.civilizedcity.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.baomidou.mybatisplus.extension.service.IService;
4 5
 import com.example.civilizedcity.entity.TdLocType;
5 6
 
@@ -9,5 +10,5 @@ import com.example.civilizedcity.entity.TdLocType;
9 10
  * @date : 2022-12-12
10 11
  */
11 12
 public interface TdLocTypeService extends IBaseService<TdLocType> {
12
-    
13
-}
13
+  IPage<TdLocType> pageAsc(IPage<TdLocType> pg);
14
+ }

+ 8
- 0
src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java Dosyayı Görüntüle

@@ -36,6 +36,7 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
36 36
     @Autowired
37 37
     TaAttachMapper taAttachMapper;
38 38
 
39
+
39 40
     private void transParams(Map<String, Object> params) {
40 41
         params.put("processNode", null);
41 42
         params.put("isExpire", false);
@@ -140,4 +141,11 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
140 141
         transParams(params);
141 142
         return baseMapper.getIssueListBy(params);
142 143
     }
144
+
145
+    @Override
146
+    public void removeByIssueId(String issueId){
147
+        baseMapper.removeByIssueId(issueId);
148
+        taIssueMapper.removeByIssueId(issueId);
149
+    }
150
+
143 151
 }

+ 6
- 1
src/main/java/com/example/civilizedcity/service/impl/TdLocTypeServiceImpl.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
1 1
 package com.example.civilizedcity.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import org.springframework.beans.factory.annotation.Autowired;
4 5
 import org.springframework.stereotype.Service;
5 6
 import com.example.civilizedcity.entity.TdLocType;
@@ -12,5 +13,9 @@ import com.example.civilizedcity.service.TdLocTypeService;
12 13
  */
13 14
 @Service
14 15
 public class TdLocTypeServiceImpl extends BaseServiceImpl<TdLocTypeMapper, TdLocType> implements TdLocTypeService {
15
-    
16
+  @Override
17
+  public IPage<TdLocType> pageAsc(IPage<TdLocType> pg) {
18
+   IPage<TdLocType> result = (IPage<TdLocType>) baseMapper.sortAsc(pg);
19
+   return result;
20
+  }
16 21
 }

+ 7
- 0
src/main/resources/mapper/TaIssueMapper.xml Dosyayı Görüntüle

@@ -25,6 +25,13 @@
25 25
             t.issue_id = #{issueId}
26 26
     </update>
27 27
 
28
+    <update id="removeByIssueId">
29
+        UPDATE ta_issue t
30
+        SET t.status =-1
31
+        WHERE
32
+        t.issue_id = #{issueId};
33
+    </update>
34
+
28 35
     <select id="getPageBy" resultType="com.example.civilizedcity.entity.TaIssue">
29 36
         SELECT
30 37
             *

+ 6
- 0
src/main/resources/mapper/TaOrgIssueMapper.xml Dosyayı Görüntüle

@@ -9,6 +9,12 @@
9 9
             t.org_id = #{orgId}
10 10
           AND t.issue_id = #{issueId}
11 11
     </update>
12
+    <update id="removeByIssueId">
13
+        UPDATE ta_org_issue t
14
+        SET t.status =-1
15
+        WHERE
16
+        t.issue_id = #{issueId};
17
+    </update>
12 18
 
13 19
     <sql id="getOrgIssueList">
14 20
         SELECT

+ 8
- 1
src/main/resources/mapper/TdLocTypeMapper.xml Dosyayı Görüntüle

@@ -2,5 +2,12 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4 4
 <mapper namespace="com.example.civilizedcity.mapper.TdLocTypeMapper">
5
-    
5
+    <select id="sortAsc" resultType="com.example.civilizedcity.entity.TdLocType">
6
+        SELECT
7
+        * FROM td_loc_type t
8
+        WHERE
9
+        t.STATUS !=- 1
10
+        order by t.sort_no ASC
11
+    </select>
12
+
6 13
 </mapper>