anderx преди 7 години
родител
ревизия
3a86233185

+ 10 - 9
src/main/java/com/goafanti/achievement/bo/AchievementListBo.java

@@ -1,7 +1,7 @@
 package com.goafanti.achievement.bo;
 
 public class AchievementListBo extends InputAchievement{
-	private String countInterest;
+	private Integer interestCount;
 	
 	private String		field1;
 	
@@ -9,14 +9,7 @@ public class AchievementListBo extends InputAchievement{
 	
 	private String 		interested;
 
-	public String getCountInterest() {
-		return countInterest;
-	}
-
-	public void setCountInterest(String countInterest) {
-		this.countInterest = countInterest;
-	}
-
+	
 	public String getField1() {
 		return field1;
 	}
@@ -40,5 +33,13 @@ public class AchievementListBo extends InputAchievement{
 	public void setInterested(String interested) {
 		this.interested = interested;
 	}
+
+	public Integer getInterestCount() {
+		return interestCount;
+	}
+
+	public void setInterestCount(Integer interestCount) {
+		this.interestCount = interestCount;
+	}
 	
 }

+ 1 - 1
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -854,7 +854,7 @@ public class WebpageController extends BaseController {
 		// 详情
 		DemandListBo demand = demandService.getDemandDetail(id, type);
 		int countInterest = demandService.getInterestCount(id);
-		demand.setCountInterest(countInterest + "");
+		demand.setCountInterest(countInterest);
 		modelAndView.addObject("demand", demand);
 
 		// 精品需求

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

@@ -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

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

@@ -66,11 +66,10 @@
     f.name as field1,f2.name as field2,d.is_hot as isHot,d.release_date as releaseDate,d.demand_type as demandType,
     d.name,d.problem_des as problemDes,d.picture_url as pictureUrl,d.release_status as releaseStatus,
     d.audit_status as auditStatus,d.fixed_budget as fixedBudget,d.crowd_cost as crowdCost,
-    ifnull(i.y,0) as interestCount,if(isnull(a.demand_id),0,1) as interest,ifnull(t.x,0) as orderCount
+    ifnull(i.y,0) as interestCount,if(isnull(a.demand_id),0,1) as interest,ifnull(t.count,0) as orderCount
     from demand d
-    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
-		group by  tl.commodity_id) t on d.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 d.id=t.id
 	left join (select count(0) as y,demand_id from demand_interest
 		group by demand_id ) i on d.id=i.demand_id
 	left join (select demand_id from demand_interest where uid=#{uid,jdbcType=VARCHAR}) a on d.id=a.demand_id
@@ -547,7 +546,7 @@
 	  d.id,d.name, d.keyword, d.is_urgent as isUrgent, d.demand_type as demandType, d.industry_category_a as industryCategoryA, d.industry_category_b as industryCategoryB, 
 	  d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,d.release_date as releaseDate, d.employer_id as employerId,
 	  d.audit_status as auditStatus,d.urgent_money as urgentMoney,d.urgent_days as  urgentDays,d.problem_des as problemDes,
-	  ifnull(t.countInterest,0) as countInterest,if(isnull(y.demand_id),0,1) as interested,
+	  ifnull(t.countInterest,0) as interestCount,if(isnull(y.demand_id),0,1) as interested,
 	  g.name as industryCategory1,g2.name as industryCategory2
 	from  demand d 
 	left join  user_identity t on d.employer_id=t.uid

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

@@ -1324,13 +1324,13 @@ from
 	and ui.consultant_type=#{consultantType,jdbcType=INTEGER}
 	</if>
 	<if test="province != null">
-	and ui.province= #{consultantType,jdbcType=INTEGER}
+	and ui.province= #{province,jdbcType=INTEGER}
 	</if>
 	<if test="city != null">
-	and ui.city=#{consultantType,jdbcType=INTEGER}
+	and ui.city=#{city,jdbcType=INTEGER}
 	</if>
 	<if test="area != null">
-	and ui.area=#{consultantType,jdbcType=INTEGER}
+	and ui.area=#{area,jdbcType=INTEGER}
 	</if>
 	<if test="name != null">
 	and u.nickname like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')

+ 5 - 13
src/main/java/com/goafanti/demand/bo/DemandListBo.java

@@ -20,10 +20,8 @@ public class DemandListBo extends InputDemand{
 	//有效
 	private Date	validityPeriod;
 	
-	//是否关注
-	private String 	interest;
 	//关注数量
-	private String countInterest;
+	private Integer interestCount;
 	//企业名称
 	private String employerName;
 	private BigDecimal fundForPersonnel;
@@ -72,21 +70,15 @@ public class DemandListBo extends InputDemand{
 		this.fundForCrowd = fundForCrowd;
 	}
 
-	public String getCountInterest() {
-		return countInterest;
+	public Integer getCountInterest() {
+		return interestCount;
 	}
 
-	public void setCountInterest(String countInterest) {
-		this.countInterest = countInterest;
+	public void setCountInterest(Integer interestCount) {
+		this.interestCount = interestCount;
 	}
 
-	public String getInterest() {
-		return interest;
-	}
 
-	public void setInterest(String interest) {
-		this.interest = interest;
-	}
 
 	public Integer getBoutique() {
 		return boutique;