albertshaw 8 years ago
parent
commit
5fb6dcf131
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/main/java/com/goafanti/common/mapper/MyAppMapper.xml

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

@@ -23,14 +23,14 @@
   </select>
   <select id="countMyTech" parameterType="String" resultType="org.springframework.ui.ModelMap">
   	select 
-	(select count(1) from achievement a left join achievement_demand ad on a.id=ad.achievement_id where a.owner_id=#{uid,jdbcType=VARCHAR}) as `match`,
+	(select count(1) from achievement a left join achievement_demand ad on a.id=ad.achievement_id where ad.id is not null and a.owner_id=#{uid,jdbcType=VARCHAR}) as `match`,
 	(select count(1) from achievement a left join achievement_order ao on a.id=ao.achievement_id where a.owner_id=#{uid,jdbcType=VARCHAR} and ao.status>5 and (ao.service_money>0 or ao.commission>0 or ao.intention_money>0)) as `deal`,
-	(select count(1) from achievement a left join achievement_interest ai on a.id=ai.achievement_id where a.owner_id=#{uid,jdbcType=VARCHAR}) as `intention`
+	(select count(1) from achievement a left join achievement_interest ai on a.id=ai.achievement_id where ai.id is not null and a.owner_id=#{uid,jdbcType=VARCHAR}) as `intention`
   </select>
   <select id="countMyDemand" parameterType="String" resultType="org.springframework.ui.ModelMap">
 	select 
-	(select count(1) from demand d left join achievement_demand ad on d.id=ad.demand_id where d.employer_id=#{uid,jdbcType=VARCHAR}) as `match`,
+	(select count(1) from demand d left join achievement_demand ad on d.id=ad.demand_id where ad.id is not null and d.employer_id=#{uid,jdbcType=VARCHAR}) as `match`,
 	(select count(1) from demand d left join demand_order `do` on d.id=`do`.demand_id where d.employer_id=#{uid,jdbcType=VARCHAR} and `do`.status>5 and (`do`.service_money>0 or `do`.commission>0 or `do`.intention_money>0)) as `deal`,
-	(select count(1) from demand d left join demand_interest di on d.id=di.demand_id where d.employer_id=#{uid,jdbcType=VARCHAR}) as `intention`
+	(select count(1) from demand d left join demand_interest di on d.id=di.demand_id where di.id is not null and d.employer_id=#{uid,jdbcType=VARCHAR}) as `intention`
   </select>
 </mapper>