Просмотр исходного кода

成果、需求收藏列表修改

anderx лет назад: 7
Родитель
Сommit
d9a145fdee

+ 3 - 1
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1429,10 +1429,12 @@ where
   	</select>
   	</select>
   	<select id="myCollectionAchievementList" resultType="com.goafanti.common.bo.MyCollection">
   	<select id="myCollectionAchievementList" resultType="com.goafanti.common.bo.MyCollection">
   	select 
   	select 
-  		a.id, a.name, a.introduction, b.name as fieidA, ai.uid, a.maturity as textA
+  		a.id, a.name, a.introduction, b.name as fieidA, ai.uid, a.maturity as textA,ifnull(c.x,0) as interestCount 
   	from achievement a
   	from achievement a
   	left join achievement_interest ai on ai.achievement_id=a.id
   	left join achievement_interest ai on ai.achievement_id=a.id
   	left join industry_category b on a.field_a= b.id
   	left join industry_category b on a.field_a= b.id
+  	left join (select achievement_id,count(*) as x from achievement_interest GROUP by achievement_id) c
+  	on c.achievement_id=a.id
   	where  a.deleted_sign=0
   	where  a.deleted_sign=0
   	and ai.uid= #{uid,jdbcType=VARCHAR}
   	and ai.uid= #{uid,jdbcType=VARCHAR}
   	order by ai.create_time desc
   	order by ai.create_time desc

+ 4 - 2
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -1188,12 +1188,14 @@ order by release_date desc limit #{0}
    where di.uid=#{uid,jdbcType=VARCHAR}
    where di.uid=#{uid,jdbcType=VARCHAR}
   </select>
   </select>
   <select id="MyCollectionDemandList" resultType="com.goafanti.common.bo.MyCollection">
   <select id="MyCollectionDemandList" resultType="com.goafanti.common.bo.MyCollection">
-  	select a.id,a.name,a.problem_des as introduction,b.name as fieidA,
+  	select a.id,a.name,a.problem_des as introduction,b.name as fieidA,ifnull(c.x,0) as interestCount,
   	a.is_urgent as textA
   	a.is_urgent as textA
    from demand a
    from demand a
    left join demand_interest di on di.demand_id=a.id
    left join demand_interest di on di.demand_id=a.id
    left join industry_category b on a.industry_category_a= b.id
    left join industry_category b on a.industry_category_a= b.id
-     where a.deleted_sign=0 
+   left join (select demand_id,count(*) as x from demand_interest GROUP by demand_id) c
+  	on c.demand_id=a.id
+     where a.deleted_sign=0
    and di.uid= #{uid,jdbcType=VARCHAR}
    and di.uid= #{uid,jdbcType=VARCHAR}
    order by di.create_time desc
    order by di.create_time desc
     <if test="page_sql !=null">
     <if test="page_sql !=null">