Browse Source

审批填报接口报500

mengy 3 years ago
parent
commit
f213424874

+ 3 - 3
src/main/java/com/chinaitop/depot/business/controller/AuditRecordsController.java

@@ -39,11 +39,11 @@ public class AuditRecordsController {
39 39
 	@ApiOperation(value="根据bid和btype查询对应报表审批", notes = "获取ById")
40 40
 	@ApiImplicitParams({
41 41
 			@ApiImplicitParam(name = "id", value = "id", paramType = "query"),
42
-			@ApiImplicitParam(name = "btype", value = "btype", paramType = "query")
42
+			@ApiImplicitParam(name = "reportType", value = "reportType", paramType = "query")
43 43
 			//报表类型 0:周报表 、1:月报表
44 44
 	})
45
-	public AuditRecords getAuditRecordsById(Integer id,Integer btype){
46
-		return auditRecordsService.findById(id,btype);
45
+	public  List<AuditRecords> getAuditRecordsById(Integer id,Integer reportType){
46
+		return auditRecordsService.findById(id,reportType);
47 47
 	}
48 48
 
49 49
 

+ 4 - 1
src/main/java/com/chinaitop/depot/business/mapper/AuditRecordsMapper.java

@@ -3,6 +3,8 @@ package com.chinaitop.depot.business.mapper;
3 3
 import com.chinaitop.depot.business.model.AuditRecords;
4 4
 import com.chinaitop.depot.business.model.AuditRecordsExample;
5 5
 import java.util.List;
6
+import java.util.Map;
7
+
6 8
 import org.apache.ibatis.annotations.Param;
7 9
 
8 10
 public interface AuditRecordsMapper {
@@ -28,5 +30,6 @@ public interface AuditRecordsMapper {
28 30
 
29 31
     int updateByPrimaryKey(AuditRecords record);
30 32
 
31
-    AuditRecords selectByType(Integer id, Integer btype);
33
+
34
+    List<AuditRecords> selectByType(Map<String,Object> map);
32 35
 }

+ 2 - 2
src/main/java/com/chinaitop/depot/business/mapper/AuditRecordsMapper.xml

@@ -93,11 +93,11 @@
93 93
     where id = #{id,jdbcType=INTEGER}
94 94
   </select>
95 95
 
96
-  <select id="selectByType" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
96
+  <select id="selectByType" resultMap="BaseResultMap" parameterType="java.util.Map" >
97 97
     select
98 98
     <include refid="Base_Column_List" />
99 99
     from audit_records
100
-    where bid = #{id,jdbcType=INTEGER} and b_type = #{bType,jdbcType=INTEGER}
100
+    where bid = #{id,jdbcType=INTEGER} and b_type = #{reportType,jdbcType=INTEGER}
101 101
   </select>
102 102
 
103 103
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >

+ 1 - 1
src/main/java/com/chinaitop/depot/business/service/AuditRecordsService.java

@@ -44,5 +44,5 @@ public interface AuditRecordsService {
44 44
 
45 45
 	Integer save(AuditRecords audit);
46 46
 
47
-	AuditRecords findById(Integer id, Integer btype);
47
+	List<AuditRecords> findById(Integer id, Integer reportType);
48 48
 }

+ 5 - 2
src/main/java/com/chinaitop/depot/business/service/impl/AuditRecordsServiceImpl.java

@@ -66,9 +66,12 @@ public class AuditRecordsServiceImpl implements AuditRecordsService {
66 66
 	}
67 67
 
68 68
 	@Override
69
-	public AuditRecords findById(Integer Id, Integer btype){
69
+	public  List<AuditRecords> findById(Integer id, Integer reportType){
70 70
 		// TODO Auto-generated method stub
71
-		return auditRecordsMapper.selectByType(Id,btype);
71
+		Map<String,Object> map = new HashMap<>();
72
+		map.put("id",id);
73
+		map.put("reportType",reportType);
74
+		return auditRecordsMapper.selectByType(map);
72 75
 	}
73 76
 
74 77
 }