anderx лет назад: 3
Родитель
Сommit
10d126a272

+ 5 - 17
src/main/java/com/goafanti/ambSystem/controller/AmbInvestApiController.java

@@ -131,32 +131,20 @@ public class AmbInvestApiController extends CertifyApiController {
 
 	/**
 	 * 投资明细列表
-	 * @return
+	 * @param id 阿米巴编号
+	 * @return type 0我投资 1我被投资
 	 */
 	@RequestMapping(value="/AmbInvestDtailsList",method = RequestMethod.GET)
-	public Result AmbInvestDtailsList(Long id){
+	public Result AmbInvestDtailsList(Long id,Integer type ){
 		Result res =new Result();
 		if (id==null){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"当前阿米巴","当前阿米巴"));
 			return res;
 		}
-		res.data(ambInvestService.AmbInvestDtailsList(id));
+		res.data(ambInvestService.AmbInvestDtailsList(id,type));
 		return res;
 	}
 
-	/**
-	 * 投资明细列表
-	 * @return
-	 */
-	@RequestMapping(value="/AmbIncomeDtailsList",method = RequestMethod.GET)
-	public Result AmbIncomeDtailsList(Long id){
-		Result res =new Result();
-		if (id==null){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"当前阿米巴","当前阿米巴"));
-			return res;
-		}
-		res.data(ambInvestService.AmbIncomeDtailsList(id));
-		return res;
-	}
+
 
 }

+ 2 - 2
src/main/java/com/goafanti/ambSystem/service/AmbInvestService.java

@@ -24,7 +24,7 @@ public interface AmbInvestService {
 
     List<AmbSystem> getInvestAmbList(Long id);
 
-    List<OutInvestList> AmbInvestDtailsList(Long id);
+    List<OutInvestList> AmbInvestDtailsList(Long id,Integer type);
+
 
-    List<OutInvestList> AmbIncomeDtailsList(Long id);
 }

+ 3 - 7
src/main/java/com/goafanti/ambSystem/service/Impl/AmbInvestServiceImpl.java

@@ -186,13 +186,9 @@ public class AmbInvestServiceImpl extends BaseMybatisDao<AmbInvestMapper> implem
     }
 
     @Override
-    public List<OutInvestList> AmbInvestDtailsList(Long id) {
-
-        return ambInvestMapper.selectAmbInvestDtailsList(id);
+    public List<OutInvestList> AmbInvestDtailsList(Long id,Integer type) {
+        return ambInvestMapper.selectAmbInvestDtailsList(id,type);
     }
 
-    @Override
-    public List<OutInvestList> AmbIncomeDtailsList(Long id) {
-        return ambInvestMapper.selectAmbIncomeDtailsList(id);
-    }
+
 }

+ 3 - 2
src/main/java/com/goafanti/common/dao/AmbInvestMapper.java

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 import com.goafanti.ambSystem.bo.OutInvestList;
 import com.goafanti.common.model.AmbInvest;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -20,9 +21,9 @@ public interface AmbInvestMapper {
 
     Integer selectCountAmountById(Long id);
 
-    List<OutInvestList> selectAmbInvestDtailsList(Long id);
+    List<OutInvestList> selectAmbInvestDtailsList(@Param("id") Long id, @Param("type")Integer type);
+
 
 
 
-    List<OutInvestList> selectAmbIncomeDtailsList(Long id);
 }

+ 7 - 2
src/main/java/com/goafanti/common/mapper/AmbInvestMapper.xml

@@ -167,7 +167,12 @@
            b.name initiateName,c.name acceptName,d.name operator
     from amb_invest  a left join amb_system b on a.initiate_amb_id =b.id
     left join amb_system c on a.accept_amb_id =c.id left join admin d on a.operator =d.id
-    where (a.accept_amb_id = #{id} or a.initiate_amb_id= #{id})
-      and a.status =2
+    where  a.status =2
+    <if test="type==0">
+      and a.initiate_amb_id= #{id}
+    </if>
+    <if test="type==1">
+      and a.accept_amb_id = #{id}
+    </if>
   </select>
 </mapper>