|
|
@@ -637,7 +637,7 @@
|
|
|
select
|
|
|
a.id,a.name, a.keyword, a.introduction,a.field_a as fieldA,a.field_b as fieldB,a.data_category as dataCategory,
|
|
|
a.status, a.release_date as releaseDate, a.audit_status as auditStatus,a.maturity,
|
|
|
- f.name as field1,f2.name as field2,ifnull(b.countInterest,0) as countInterest,if(isnull(c.achievement_id),0,1) as interested
|
|
|
+ f.name as field1,f2.name as field2,ifnull(b.countInterest,0) as interestCount,if(isnull(c.achievement_id),0,1) as interested
|
|
|
from achievement a
|
|
|
left join (select count(0) as countInterest,achievement_id from achievement_interest
|
|
|
group by achievement_id)b on a.id = b.achievement_id
|
|
|
@@ -1407,14 +1407,12 @@ where
|
|
|
<select id="selectAppAchuevementDetail" resultType="com.goafanti.achievement.bo.AchievementEntity">
|
|
|
select a.id,a.name,a.keyword,a.data_category,a.summary,a.introduction,a.transfer_mode as transferMode,a.status,a.transfer_price as transferPrice ,a.innovation,a.maturity,a.audit_status,a.technical_picture_url as technicalPictureUrl,
|
|
|
a.field_a as fieldA,a.field_b as fieldB,a.field_c as fieldC,f.name as field1,f2.name as field2,f3.name as field3,a.release_status as releaseStatus,a.audit_status as auditStatus,a.boutique,a.field_a as fieldA,a.is_hot as isHot,a.release_date as releaseDate,if(isnull(b.count),0,b.count) as interestCount,
|
|
|
- if(isnull(d.achievement_id),0,1) interest,ifnull(t.x,0) as orderCount
|
|
|
+ if(isnull(d.achievement_id),0,1) interest,ifnull(t.count,0) as orderCount
|
|
|
from achievement a left join industry_category f on a.field_a=f.id
|
|
|
left join industry_category f2 on a.field_b=f2.id
|
|
|
left join industry_category f3 on a.field_c=f3.id
|
|
|
- left join ( select count(0) as x,tl.commodity_id from t_order tr
|
|
|
- left join t_order_detail tl on tl.order_no=tr.order_no
|
|
|
- where tr.order_status != 4 and tr.order_status != 0
|
|
|
- group by tl.commodity_id) t on a.id=t.commodity_id
|
|
|
+ left join (select b.commodity_id as id,count(*) as count from jt_order a left join jt_order_detail b on a.order_no=b.order_no
|
|
|
+ GROUP by b.commodity_id) t on a.id=t.id
|
|
|
left join (select achievement_id,count(*) as count from achievement_interest group by achievement_id ) b
|
|
|
on a.id=b.achievement_id left join (select achievement_id from achievement_interest where uid= #{uid,jdbcType=VARCHAR} )d on a.id=d.achievement_id
|
|
|
where a.deleted_sign = 0 and a.info_sources=1
|