Browse Source

Merge branch 'test' of git@git.coding.net:aft/AFT.git into test

wanghui 8 years ago
parent
commit
0e5a5ffd75

+ 2 - 0
src/main/java/com/goafanti/common/dao/DemandMapper.java

@@ -58,4 +58,6 @@ public interface DemandMapper {
 	List<DemandInterestBo> demandInterest(String uid);
 
 	Demand selectDemandDetail(String id);
+
+	DemandListBo selectAppByPrimaryKey(String id);
 }

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

@@ -1228,7 +1228,7 @@
 	</select>
   
   <select id="selectUserOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementUserOwnerDetailBo">
-  select  
+     select  
 		  	a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
 		  	a.name, a.keyword, a.category, 
 		  	a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl, 
@@ -1245,12 +1245,19 @@
 		    a.create_time as createTime, a.release_status as releaseStatus, 
 		    a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
 		    ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
-		    ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,jea.easemob_name as easemobName
+			ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,
+			ifnull(t.x,0) as orderIntentionCount ,ifnull(t2.x,0) as orderCount
     from achievement a
     left join user_identity ui on a.owner_id = ui.uid
+    left join (select count(0) as x,commodity_id from t_order
+				where order_status != 4
+				group by  commodity_id ) t on a.id=t.commodity_id 
+	left join (select count(0) as x,commodity_id from t_order
+				where order_status != 4 and order_status != 0
+				group by  commodity_id ) t2 on a.id=t2.commodity_id 
+    left join jpush_easemob_account j on a.owner_id=j.uid
     left join user u on u.id = a.owner_id
-    left join jpush_easemob_account jea on a.owner_id = jea.uid
-    where a.id = #{id,jdbcType=VARCHAR}
+  where a.id =#{id,jdbcType=VARCHAR}
   </select>
   
    <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">

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

@@ -55,6 +55,12 @@
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
+    <include refid="Base_Column_List" />
+    from demand
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectAppByPrimaryKey" resultType="com.goafanti.demand.bo.DemandListBo" parameterType="java.lang.String" >
+     select 
     d.id, d.serial_number AS serialNumber, d.data_category AS dataCategory, d.name, d.keyword, d.info_sources AS infoSources, d.industry_category_a AS industryCategoryA, 
     d.industry_category_b AS industryCategoryB, d.industry_category_c AS industryCategoryC, d.demand_type AS demandType, d.problem_des AS problemDes, d.technical_requirements AS technicalRequirements, 
     d.picture_url AS pictureUrl, d.text_file_url AS textFileUrl, d.video_url AS videoUrl, d.fixed_budget AS fixedBudget, d.fixed_cycle AS fixedCycle, d.people_number AS peopleNumber, 
@@ -62,16 +68,17 @@
     d.employer_address AS employerAddress, d.employer_contacts AS employerContacts, d.employer_contacts_mobile AS employerContactsMobile, d.employer_contacts_mailbox AS employerContactsMailbox, 
     d.contacts, d.status, d.release_status AS releaseStatus, d.release_date AS releaseDate , d.create_time AS createTime, d.principal_id AS principalId, d.deleted_sign AS deletedSign,
     d.audit_status AS auditStatus, d.tech_broker_id AS techBrokerId,d.boutique,d.urgent_money AS urgentMoney,d.urgent_days as urgentDays
-    ,ifnull(t.x,0) as orderIntentionCount,ifnull(t2.x,0) as orderCount
+    ,ifnull(t.x,0) as orderIntentionCount,ifnull(t2.x,0) as orderCount,j.easemob_name as easemobName
     from demand d
+    left join jpush_easemob_account j on d.employer_id=j.uid
     left join (select count(0) as x,commodity_id from t_order
 				where order_status != 4
 				group by  commodity_id ) t on d.id=t.commodity_id
     left join (select count(0) as x,commodity_id from t_order
 				where order_status != 4 and order_status != 0
 				group by  commodity_id ) t2 on d.id=t2.commodity_id 
-    where id = #{id,jdbcType=VARCHAR}
-  </select>
+    where d.id =  #{id,jdbcType=VARCHAR}
+	</select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
     delete from demand
     where id = #{id,jdbcType=VARCHAR}

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

@@ -1079,9 +1079,12 @@
   
   <select id="findUserIdentityCount" parameterType="String" resultType="java.lang.Integer">
   	select count(0) 
-   from user u left JOIN user_identity t
-	on t.uid = u.id
-	where 1=1
+   from user_identity t left JOIN user u on t.uid = u.id
+	left join (select count(0) as x,seller_id from t_order
+				where order_status != 4
+				group by  seller_id ) o on t.uid=o.seller_id
+	where expert=1
+	and u.status !=1
     <if test="industry != null">
         and t.industry = #{industry,jdbcType=VARCHAR}
     </if>

+ 2 - 3
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -787,9 +787,8 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 	@Override
 	public DemandListBo selectDemandDetail(String id ) {
-		Demand d1=demandMapper.selectByPrimaryKey(id);
-		DemandListBo d=new DemandListBo();
-		BeanUtils.copyProperties(d1, d);
+		DemandListBo d=demandMapper.selectAppByPrimaryKey(id);
+		
 		if (null!=d.getIndustryCategoryA()) {
 			d.setIndustryCategory1(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryA()).getName());
 		}