wanghui 7 anni fa
parent
commit
dabab63fc2

+ 3 - 12
src/main/java/com/goafanti/achievement/controller/UserAchievementApiController.java

@@ -107,20 +107,11 @@ public class UserAchievementApiController extends CertifyApiController {
 	@RequestMapping(value = "/list", method = RequestMethod.GET)
 	private Result list(Integer auditStatus, String name, Integer dataCategory,
 		 String releaseDateStartDate, String releaseDateEndDate,
-		 String pageNo, String pageSize) {
-		System.out.println("、list *-*-");
+		 Integer pageNo, Integer pageSize) {
 		Result res = new Result();
-		Integer pNo = 1;
-		Integer pSize = 10;
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
+		
 		res.setData(achievementService.listUserAchievement(auditStatus, name, dataCategory,
-				 releaseDateStartDate, releaseDateEndDate, pNo, pSize));
+				 releaseDateStartDate, releaseDateEndDate, pageNo, pageSize));
 		return res;
 	}
 

+ 1 - 1
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -279,7 +279,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 		}
-		return (Pagination<AchievementListBo>) findPage("ListMyAchievement", "findAchievementCount",
+		return (Pagination<AchievementListBo>) findPage("listMyAchievementByPage", "listMyAchievementCount",
 				disposeParams( TokenManager.getUserId(), auditStatus,   dataCategory,name,
 						releaseDateStartDate, releaseDateEndDate),
 				pNo, pSize);

+ 26 - 89
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -933,94 +933,7 @@
 		#{item}
 	</foreach>
   </update>
-  	<select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
-  	
-	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
-  	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 
-	<if test="ownerId != null">
-  	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
-  	</if>
-  	<if test="serialNumber != null">
-		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
-	</if>
-	<if test="auditStatus != null">
-		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
-	</if>
-	<if test="name != null">
-
-		and  a.name = #{name,jdbcType=VARCHAR}
-
-	</if>
-	<if test="keyword != null">
-
-		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
-
-	</if>
-	<if test="dataCategory != null and dataCategory != ''">
-  		and a.data_category = #{dataCategory,jdbcType=INTEGER}
-  	</if>
-  	<if test="category != null">
-  		and a.category = #{category,jdbcType=INTEGER}
-  	</if>
-	<if test="ownerType != null">
-		and  a.owner_type = #{ownerType,jdbcType=INTEGER}
-	</if>
-	<if test="fieldA != null">
-		and a.field_a  = #{fieldA,jdbcType=VARCHAR}
-	</if>
-	<if test="status != null">
-		and  a.status = #{status,jdbcType=INTEGER}
-	</if>
-	<if test="rStart != null">
-       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
-	</if>
-	<if test="rEnd != null">
-	   and  a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
-	</if>
-	<if test="releaseStatus != null">
-	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
-	</if>
-	order by serial_number desc
-	<if test="page_sql!=null">
-			${page_sql}
-	</if>
-  </select>
   
-  <select id="findAchievementCount" parameterType="String" resultType="java.lang.Integer">
-  	select 
-  		count(1)
-  		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 
-	<if test="ownerId != null">
-  	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
-  	</if>
-  	<if test="serialNumber != null">
-		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
-	</if>
-	<if test="auditStatus != null">
-		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
-	</if>
-	<if test="name != null">
-
-		and  a.name = #{name,jdbcType=VARCHAR}
-
-	</if>
-	</select>
    <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
   	
 	select 
@@ -2271,8 +2184,8 @@ audit_status=2
 and info_sources=1
 order by release_date limit #{0}
 </select>
-<select id="ListMyAchievement"   resultType="com.goafanti.demand.bo.DemandAchievementListBo">
-select 
+<select id="listMyAchievementByPage"   resultType="com.goafanti.demand.bo.DemandAchievementListBo">
+	select 
   		a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
   		a.name, a.release_date as releaseDate, a.audit_status as auditStatus 
   	from achievement a
@@ -2301,4 +2214,28 @@ select
 			${page_sql}
 	</if>
 </select>
+<select id="listMyAchievementCount" resultType="java.lang.Integer">
+	select 
+  		count(0)
+  	from achievement a
+  	where deleted_sign = 0 
+	<if test="ownerId != null">
+  		and a.owner_id = #{ownerId,jdbcType=VARCHAR}
+  	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and a.name like "%"#{name,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="dataCategory != null and dataCategory != ''">
+  		and a.data_category = #{dataCategory,jdbcType=INTEGER}
+  	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and  a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+</select>
 </mapper>