Browse Source

添加关注列表咨询师

Michael 8 years ago
parent
commit
4b58ee26fa

+ 2 - 1
src/main/java/com/goafanti/common/enums/InterestType.java

@@ -12,7 +12,8 @@ public enum InterestType {
 	POLICY(3,"政策"),
 	UNAUDITED(4,"活动"),
 	PROJECT(5,"项目"),
-	OTHER(6, "其他");
+	OTHER(6, "其他"),
+	COUNSELOR(7,"咨询师");
 
 	private InterestType(Integer code, String desc) {
 		this.code = code;

+ 21 - 1
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -1613,7 +1613,27 @@
   	select count(1)
 	from user_interest t
 	left join  user_identity y on t.to_uid=y.uid
-	where  from_uid=#{uid,jdbcType=VARCHAR}
+	where expert=1  
+	and  from_uid=#{uid,jdbcType=VARCHAR}
+	</select>
+	
+	<select id="findAppCounselorInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
+  	select y.uid as id,y.username as name ,t.create_time as createTime
+	from user_interest t
+	left join  user_identity y on t.to_uid=y.uid
+	where expert=2  
+	and from_uid=#{uid,jdbcType=VARCHAR}
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findAppCounselorInterestCount" parameterType="String" resultType="java.lang.Integer">
+  	select count(1)
+	from user_interest t
+	left join  user_identity y on t.to_uid=y.uid
+	where  expert=2  
+	and from_uid=#{uid,jdbcType=VARCHAR}
 	</select>
 	
 	<select id="findAppDemandInterestByPage"  resultType="com.goafanti.demand.bo.ObjectInterestListBo">

+ 10 - 0
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -930,6 +930,16 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			}
 			return p;
 		}
+		if (type==InterestType.COUNSELOR.getCode()) {
+			Pagination<ObjectInterestListBo> p=(Pagination<ObjectInterestListBo>) findPage("findAppCounselorInterestByPage", "findAppCounselorInterestCount", params, pNo, pSize);
+			List<ObjectInterestListBo> l=(List<ObjectInterestListBo>) p.getList();
+			for (ObjectInterestListBo o : l) {
+				int i=userInterestMapper.countInterest(o.getId());
+				o.setCountInterest(String.valueOf(i));
+				o.setType(type);
+			}
+			return p;
+		}
 		return null;
 	}