张涛 2 years ago
parent
commit
8e339a2849

+ 18
- 0
src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java View File

235
         taOrgIssueService.updateData(taOrgIssue);
235
         taOrgIssueService.updateData(taOrgIssue);
236
         return ResponseBean.success(taOrgIssue);
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 View File

99
         tdIssueTypeService.removeLogicById(id);
99
         tdIssueTypeService.removeLogicById(id);
100
         return ResponseBean.success("success");
100
         return ResponseBean.success("success");
101
     }
101
     }
102
+
103
+
104
+
105
+
102
 }
106
 }

+ 5
- 5
src/main/java/com/example/civilizedcity/controller/TdLocTypeController.java View File

56
                              @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
56
                              @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
57
 
57
 
58
         IPage<TdLocType> pg = new Page<>(pageNum, pageSize);
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
         return ResponseBean.success(result);
64
         return ResponseBean.success(result);
65
     }
65
     }
66
 
66
 

+ 4
- 0
src/main/java/com/example/civilizedcity/mapper/TaIssueMapper.java View File

40
                       @Param("processStatus") String processStatus);
40
                       @Param("processStatus") String processStatus);
41
 
41
 
42
     List<StatVo> statIssueLoc();
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 View File

27
     int updateProcess(@Param("issueId") Integer issueId,@Param("orgId") String orgId,@Param("processStatus") String processStatus);
27
     int updateProcess(@Param("issueId") Integer issueId,@Param("orgId") String orgId,@Param("processStatus") String processStatus);
28
 
28
 
29
     List<TaIssue> getIssueListBy(@Param("params") Map<String, Object> params);
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 View File

1
 package com.example.civilizedcity.mapper;
1
 package com.example.civilizedcity.mapper;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
6
 import com.example.civilizedcity.entity.TdLocType;
7
 import com.example.civilizedcity.entity.TdLocType;
12
  */
13
  */
13
 @Mapper
14
 @Mapper
14
 public interface TdLocTypeMapper  extends BaseMapper<TdLocType>{
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 View File

25
      void updateData(TaOrgIssue taOrgIssue) throws Exception;
25
      void updateData(TaOrgIssue taOrgIssue) throws Exception;
26
 
26
 
27
      List<TaIssue> getIssueListBy(Map<String, Object> params);
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 View File

1
 package com.example.civilizedcity.service;
1
 package com.example.civilizedcity.service;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.example.civilizedcity.entity.TdLocType;
5
 import com.example.civilizedcity.entity.TdLocType;
5
 
6
 
9
  * @date : 2022-12-12
10
  * @date : 2022-12-12
10
  */
11
  */
11
 public interface TdLocTypeService extends IBaseService<TdLocType> {
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 View File

36
     @Autowired
36
     @Autowired
37
     TaAttachMapper taAttachMapper;
37
     TaAttachMapper taAttachMapper;
38
 
38
 
39
+
39
     private void transParams(Map<String, Object> params) {
40
     private void transParams(Map<String, Object> params) {
40
         params.put("processNode", null);
41
         params.put("processNode", null);
41
         params.put("isExpire", false);
42
         params.put("isExpire", false);
140
         transParams(params);
141
         transParams(params);
141
         return baseMapper.getIssueListBy(params);
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 View File

1
 package com.example.civilizedcity.service.impl;
1
 package com.example.civilizedcity.service.impl;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import org.springframework.beans.factory.annotation.Autowired;
4
 import org.springframework.beans.factory.annotation.Autowired;
4
 import org.springframework.stereotype.Service;
5
 import org.springframework.stereotype.Service;
5
 import com.example.civilizedcity.entity.TdLocType;
6
 import com.example.civilizedcity.entity.TdLocType;
12
  */
13
  */
13
 @Service
14
 @Service
14
 public class TdLocTypeServiceImpl extends BaseServiceImpl<TdLocTypeMapper, TdLocType> implements TdLocTypeService {
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 View File

25
             t.issue_id = #{issueId}
25
             t.issue_id = #{issueId}
26
     </update>
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
     <select id="getPageBy" resultType="com.example.civilizedcity.entity.TaIssue">
35
     <select id="getPageBy" resultType="com.example.civilizedcity.entity.TaIssue">
29
         SELECT
36
         SELECT
30
             *
37
             *

+ 6
- 0
src/main/resources/mapper/TaOrgIssueMapper.xml View File

9
             t.org_id = #{orgId}
9
             t.org_id = #{orgId}
10
           AND t.issue_id = #{issueId}
10
           AND t.issue_id = #{issueId}
11
     </update>
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
     <sql id="getOrgIssueList">
19
     <sql id="getOrgIssueList">
14
         SELECT
20
         SELECT

+ 8
- 1
src/main/resources/mapper/TdLocTypeMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 
3
 
4
 <mapper namespace="com.example.civilizedcity.mapper.TdLocTypeMapper">
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
 </mapper>
13
 </mapper>