Browse Source

科技成果页面展示数据条件更改

anderx 8 years ago
parent
commit
6d20920160
1 changed files with 11 additions and 15 deletions
  1. 11 15
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

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

@@ -1013,23 +1013,19 @@
 	</foreach>
   </update>
   	<select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
-  	select 
+  	
+	select 
   		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
   		a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
   		a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
-  		a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest,
-  		ap.publish_page,ap.publish_platform,ap.publish_client,ap.if_top,ap.top_number,ap.show_number
+  		a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
   	from achievement a
-  	right join achievement_publish ap on a.id=ap.achievement_id
   	left join (
 	select count(0)  as countInterest,achievement_id from achievement_interest group by achievement_id
 			)b on a.id = b.achievement_id 
   	left join field_glossory f on a.field_a=f.id
   	left join field_glossory f2 on a.field_b=f2.id
   	where deleted_sign = 0 
-	and ap.publish_client=0
-	and ap.publish_page='W01'
-	and ap.publish_platform='112461d9-2120-4809-b709-3cb5f5acfcc3'
 	<if test="ownerId != null">
   	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>
@@ -1073,7 +1069,7 @@
 	<if test="releaseStatus != null">
 	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
 	</if>
-	order by ap.if_top,ap.top_number,ap.show_number asc
+	order by serial_number desc
 	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -1082,17 +1078,13 @@
   <select id="findAchievementCount" parameterType="String" resultType="java.lang.Integer">
   	select 
   		count(1)
-  	from achievement a
-  	right join achievement_publish ap on a.id=ap.achievement_id
+  		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 
   	left join field_glossory f on a.field_a=f.id
   	left join field_glossory f2 on a.field_b=f2.id
   	where deleted_sign = 0 
-	and ap.publish_client=0
-	and ap.publish_page='W01'
-	and ap.publish_platform='112461d9-2120-4809-b709-3cb5f5acfcc3'
 	<if test="ownerId != null">
   	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>
@@ -1330,8 +1322,12 @@
   		a.technical_picture_url as technicalPictureUrl,
   		b.name as fieldAs
   	from achievement a 
+  	right join achievement_publish ap on a.id=ap.achievement_id
   	left join field_glossory b on a.field_a = b.id
   	where a.deleted_sign = 0 
+  	and ap.publish_client=0
+	and ap.publish_page='W01'
+	and ap.publish_platform='112461d9-2120-4809-b709-3cb5f5acfcc3'
   	<if test="dataCategory != null and dataCategory != ''">
   		and a.data_category = #{dataCategory,jdbcType=INTEGER}
   	</if>
@@ -1359,10 +1355,10 @@
   	and a.release_status = 1
   	and a.audit_status = 3 
   	<if test="dateSort == 0">
-  		order by a.release_date asc
+  		order by order by ap.if_top,ap.top_number,ap.show_number,a.release_date  asc
   	</if>
   	<if test="dateSort == 1">
-  		order by a.release_date desc
+  		order by ap.if_top asc,ap.top_number asc,ap.show_number asc,a.release_date desc
   	</if>	
   	<if test="page_sql != null">
 		${page_sql}