Просмотр исходного кода

客户端科技成果--CRUD&文件上传、下载

Antiloveg лет назад: 8
Родитель
Сommit
ac55a65ad3

+ 2 - 0
schema/2017-05-19.sql

@@ -0,0 +1,2 @@
+alter TABLE `achievement`
+add column `owner_id` varchar(36) null comment'所有人ID' after `innovation`;

+ 265 - 0
src/main/java/com/goafanti/achievement/controller/AchievementApiController.java

@@ -0,0 +1,265 @@
+package com.goafanti.achievement.controller;
+
+import java.util.Arrays;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.achievement.bo.InputAchievement;
+import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AchievementFields;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.model.Achievement;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
+
+@RestController
+@RequestMapping(value = "/api/user/achievement")
+public class AchievementApiController extends CertifyApiController{
+	@Resource
+	private AchievementService achievementService;
+	
+	/**
+	 * 成果列表
+	 */
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	private Result list(Integer serialNumber, String name, String keyword, Integer category, Integer ownerType,
+			Integer status, String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus,
+			String pageNo, String 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(serialNumber, name, keyword, category, ownerType, status,
+				releaseDateStartDate, releaseDateEndDate, releaseStatus, pNo, pSize));
+		return res;
+	}
+	
+	/**
+	 * 新增成果
+	 */
+	@RequestMapping(value = "/apply", method = RequestMethod.POST)
+	private Result apply(@Valid InputAchievement ia, BindingResult bindingResult) {
+		Result res = new Result();
+
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					AchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		res = disposeInputAchievement(res, ia);
+		if (!res.getError().isEmpty()) {
+			return res;
+		}
+
+		Achievement a = new Achievement();
+		BeanUtils.copyProperties(ia, a);
+		a.setOwnerId(TokenManager.getUserId());
+		achievementService.saveAchievement(a);
+		return res;
+	}
+	
+	/**
+	 * 详情
+	 */
+	@RequestMapping(value = "/detail", method = RequestMethod.GET)
+	private Result detail(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
+			return res;
+		}
+		res.setData(achievementService.selectByPrimaryKey(id));
+		return res;
+	}
+	
+	/**
+	 * 修改成果
+	 */
+	@RequestMapping(value = "/update", method = RequestMethod.POST)
+	public Result update(@Valid InputAchievement ia, BindingResult bindingResult) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					AchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
+			return res;
+		}
+		res = disposeInputAchievement(res, ia);
+		if (!res.getError().isEmpty()) {
+			return res;
+		}
+
+		Achievement a = new Achievement();
+		BeanUtils.copyProperties(ia, a);
+		achievementService.updateAchievement(a);
+		return res;
+	}
+	
+	/**
+	 * 下载文本文件
+	 */
+	@RequestMapping(value = "/download", method = RequestMethod.GET)
+	public Result download(HttpServletResponse response, String id, String sign) {
+		Result res = new Result();
+
+		if (StringUtils.isEmpty(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
+			return res;
+		}
+
+		Achievement a = achievementService.selectByPrimaryKey(id);
+		if (null == a) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
+			return res;
+		}
+		
+		if (TokenManager.getUserId().equals(a.getOwnerId())){
+			AttachmentType attachmentType = AttachmentType.getField(sign);
+			if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE) {
+				downloadUnPrivateFile(response, a.getMaturityTextFileDownloadFileName(), a.getMaturityTextFileUrl());
+			} else if (attachmentType == AttachmentType.ACHIEVEMENT_TECH_PLAN){
+				downloadUnPrivateFile(response, a.getTechPlanDownloadFileName(), a.getTechPlanUrl());
+			} else if (attachmentType == AttachmentType.ACHIEVEMENT_BUSINESS_PLAN){
+				downloadUnPrivateFile(response, a.getBusinessPlanDownloadFileName(), a.getBusinessPlanUrl());
+			} else {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+			}
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
+			return res;
+		}
+
+		
+		return res;
+	}
+
+	/**
+	 * 文本文件上传
+	 */
+	@RequestMapping(value = "/uploadTextFile", method = RequestMethod.POST)
+	public Result uploadTextFile(HttpServletRequest req, String sign) {
+		Result res = new Result();
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+
+		if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE
+				|| attachmentType == AttachmentType.ACHIEVEMENT_TECH_PLAN
+				|| attachmentType == AttachmentType.ACHIEVEMENT_BUSINESS_PLAN) {
+			res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+		return res;
+	}
+
+	/**
+	 * 图片上传
+	 */
+	@RequestMapping(value = "/uploadPicture", method = RequestMethod.POST)
+	public Result uploadPicture(HttpServletRequest req, String sign) {
+		Result res = new Result();
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+
+		if (attachmentType == AttachmentType.ACHIEVEMENT_TECHNICAL_PICTURE
+				|| attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_PICTURE) {
+			res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}
+
+		return res;
+	}
+
+	/**
+	 * 删除
+	 */
+	@RequestMapping(value = "/delete", method = RequestMethod.POST)
+	private Result delete(@RequestParam(name = "ids[]", required = false) String[] ids) {
+		Result res = new Result();
+		if (ids == null || ids.length < 1) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
+		} else {
+			res.setData(achievementService.deleteByPrimaryKey(Arrays.asList(ids)));
+		}
+		return res;
+	}
+	
+	private Result disposeInputAchievement(Result res, InputAchievement ia) {
+		if (StringUtils.isBlank(ia.getName())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果名称", "成果名称"));
+			return res;
+		}
+
+		if (null == ia.getCategory()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到数据类别", "数据类别"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getKeyword())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getOwnerName())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果所有人名称", "成果所有人名称"));
+			return res;
+		}
+
+		if (null == ia.getOwnerType()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人类型", "所有人类型"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getOwnerIdNumber())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人证件号", "所有人证件号"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getOwnerMobile())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人联系电话", "所有人联系电话"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getOwnerEmail())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人电子邮箱", "所有人电子邮箱"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getOwnerPostalAddress())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人通讯地址", "所有人通讯地址"));
+			return res;
+		}
+
+		if (null == ia.getCooperationMode()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));
+			return res;
+		}
+		return res;
+	}
+
+}

+ 6 - 2
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -12,12 +12,16 @@ public interface AchievementService {
 			Integer ownerType, Integer status, String releaseDateStartDate,
 			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
 
-	void saveAchievementByManager(Achievement a);
+	void saveAchievement(Achievement a);
 
-	int updateAchievementByManager(Achievement a);
+	int updateAchievement(Achievement a);
 
 	Achievement selectByPrimaryKey(String id);
 
 	int deleteByPrimaryKey(List<String> asList);
 
+	Pagination<AchievementListBo> listUserAchievement(Integer serialNumber, String name, String keyword, Integer category, Integer ownerType,
+			Integer status, String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo,
+			Integer pSize);
+
 }

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

@@ -25,19 +25,101 @@ import com.goafanti.common.model.Achievement;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 
 @Service
 public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> implements AchievementService {
-	
+
 	@Autowired
 	private AchievementMapper achievementMapper;
-	
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<AchievementListBo> listAchievement(Integer serialNumber, String name, String keyword,
 			Integer category, Integer ownerType, Integer status, String releaseDateStartDate, String releaseDateEndDate,
 			Integer releaseStatus, Integer pNo, Integer pSize) {
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0) {
+			pSize = 10;
+		}
+		return (Pagination<AchievementListBo>) findPage(
+				"findManageAchievementListByPage", "findManageAchievementCount", disposeParams(serialNumber, name,
+						keyword, category, ownerType, status, releaseDateStartDate, releaseDateEndDate, releaseStatus),
+				pNo, pSize);
+	}
+
+	@Override
+	public void saveAchievement(Achievement a) {
+		a.setId(UUID.randomUUID().toString());
+		a.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+
+		a.setStatus(AchievementStatus.CREATE.getCode());
+		if (AchievementReleaseStatus.RELEASED.getCode().equals(a.getReleaseStatus())) {
+			a.setReleaseDate(now.getTime());
+			a.setStatus(AchievementStatus.ONGOING.getCode());
+		}
+		a.setCreateTime(now.getTime());
+		achievementMapper.insert(a);
+	}
+
+	@Override
+	public int updateAchievement(Achievement a) {
+		Achievement aa = achievementMapper.selectByPrimaryKey(a.getId());
+		if (AchievementReleaseStatus.RELEASED.getCode().equals(a.getReleaseStatus())
+				&& DemandReleaseStatus.UNRELEASE.getCode().equals(aa.getReleaseStatus())) {
+			Calendar now = Calendar.getInstance();
+			now.set(Calendar.MILLISECOND, 0);
+			a.setReleaseDate(now.getTime());
+			a.setStatus(AchievementStatus.ONGOING.getCode());
+		}
+
+		if (DemandReleaseStatus.UNRELEASE.getCode().equals(a.getReleaseStatus())
+				&& DemandReleaseStatus.RELEASED.getCode().equals(aa.getReleaseStatus())) {
+			a.setStatus(DemandStatus.CREATE.getCode());
+			achievementMapper.updateReleaseDate(aa.getId());
+		}
+		return achievementMapper.updateByPrimaryKeySelective(a);
+	}
+
+	@Override
+	public Achievement selectByPrimaryKey(String id) {
+		return achievementMapper.selectByPrimaryKey(id);
+	}
+
+	@Override
+	public int deleteByPrimaryKey(List<String> id) {
+		return achievementMapper.batchDeleteByPrimaryKey(id);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AchievementListBo> listUserAchievement(Integer serialNumber, String name, String keyword,
+			Integer category, Integer ownerType, Integer status, String releaseDateStartDate, String releaseDateEndDate,
+			Integer releaseStatus, Integer pNo, Integer pSize) {
+		Map<String, Object> params = disposeParams(serialNumber, name, keyword, category, ownerType, status,
+				releaseDateStartDate, releaseDateEndDate, releaseStatus);
+		params.put("ownerId", TokenManager.getUserId());
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0) {
+			pSize = 10;
+		}
+		return (Pagination<AchievementListBo>) findPage(
+				"findAchievementListByPage", "findAchievementCount", disposeParams(serialNumber, name, keyword,
+						category, ownerType, status, releaseDateStartDate, releaseDateEndDate, releaseStatus),
+				pNo, pSize);
+	}
 
+	private Map<String, Object> disposeParams(Integer serialNumber, String name, String keyword, Integer category,
+			Integer ownerType, Integer status, String releaseDateStartDate, String releaseDateEndDate,
+			Integer releaseStatus) {
 		Map<String, Object> params = new HashMap<>();
 
 		Date rStart = null;
@@ -88,65 +170,12 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (null != status) {
 			params.put("status", status);
 		}
-		
+
 		if (null != releaseStatus) {
 			params.put("releaseStatus", releaseStatus);
 		}
 
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-
-		if (pSize == null || pSize < 0) {
-			pSize = 10;
-		}
-		return (Pagination<AchievementListBo>) findPage("findManageAchievementListByPage", "findManageAchievementCount",
-				params, pNo, pSize);
-	}
-
-	@Override
-	public void saveAchievementByManager(Achievement a) {
-		a.setId(UUID.randomUUID().toString());
-		a.setDeletedSign(DeleteStatus.UNDELETE.getCode());
-		Calendar now = Calendar.getInstance();
-		now.set(Calendar.MILLISECOND, 0);
-		
-		a.setStatus(AchievementStatus.CREATE.getCode());
-		if (AchievementReleaseStatus.RELEASED.getCode().equals(a.getReleaseStatus())) {
-			a.setReleaseDate(now.getTime());
-			a.setStatus(AchievementStatus.ONGOING.getCode());
-		}
-		a.setCreateTime(now.getTime());
-		achievementMapper.insert(a);
-	}
-
-	@Override
-	public int updateAchievementByManager(Achievement a) {
-		Achievement aa = achievementMapper.selectByPrimaryKey(a.getId());
-		if (AchievementReleaseStatus.RELEASED.getCode().equals(a.getReleaseStatus())
-				&& DemandReleaseStatus.UNRELEASE.getCode().equals(aa.getReleaseStatus())) {
-			Calendar now = Calendar.getInstance();
-			now.set(Calendar.MILLISECOND, 0);
-			a.setReleaseDate(now.getTime());
-			a.setStatus(AchievementStatus.ONGOING.getCode());
-		}
-
-		if (DemandReleaseStatus.UNRELEASE.getCode().equals(a.getReleaseStatus())
-				&& DemandReleaseStatus.RELEASED.getCode().equals(aa.getReleaseStatus())) {
-			a.setStatus(DemandStatus.CREATE.getCode());
-			achievementMapper.updateReleaseDate(aa.getId());
-		}
-		return achievementMapper.updateByPrimaryKeySelective(a);
-	}
-
-	@Override
-	public Achievement selectByPrimaryKey(String id) {
-		return achievementMapper.selectByPrimaryKey(id);
-	}
-
-	@Override
-	public int deleteByPrimaryKey(List<String> id) {
-		return achievementMapper.batchDeleteByPrimaryKey(id);
+		return params;
 	}
 
 }

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminAchievementApiController.java

@@ -169,7 +169,7 @@ public class AdminAchievementApiController extends CertifyApiController {
 
 		Achievement a = new Achievement();
 		BeanUtils.copyProperties(ia, a);
-		achievementService.saveAchievementByManager(a);
+		achievementService.saveAchievement(a);
 		return res;
 	}
 
@@ -196,7 +196,7 @@ public class AdminAchievementApiController extends CertifyApiController {
 
 		Achievement a = new Achievement();
 		BeanUtils.copyProperties(ia, a);
-		achievementService.updateAchievementByManager(a);
+		achievementService.updateAchievement(a);
 		return res;
 	}
 

+ 96 - 10
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -19,6 +19,7 @@
     <result column="maturity_text_file_url" jdbcType="VARCHAR" property="maturityTextFileUrl" />
     <result column="maturity_video_url" jdbcType="VARCHAR" property="maturityVideoUrl" />
     <result column="innovation" jdbcType="INTEGER" property="innovation" />
+    <result column="owner_id" jdbcType="VARCHAR" property="ownerId" />
     <result column="owner_name" jdbcType="VARCHAR" property="ownerName" />
     <result column="owner_type" jdbcType="INTEGER" property="ownerType" />
     <result column="owner_id_number" jdbcType="VARCHAR" property="ownerIdNumber" />
@@ -55,7 +56,7 @@
   <sql id="Base_Column_List">
     id, serial_number, data_category, name, keyword, category, summary, introduction, 
     technical_picture_url, field_a, field_b, field_c, maturity, maturity_picture_url, 
-    maturity_text_file_url, maturity_video_url, innovation, owner_name, owner_type, owner_id_number, 
+    maturity_text_file_url, maturity_video_url, innovation, owner_id, owner_name, owner_type, owner_id_number, 
     owner_mobile, owner_email, owner_postal_address, cooperation_mode, transfer_mode, 
     bargaining_mode, transfer_price, technical_scene, breakthrough, patent_case, awards, 
     team_des, parameter, tech_plan_url, business_plan_url, org_id, org_name, org_address, 
@@ -78,7 +79,7 @@
       summary, introduction, technical_picture_url, 
       field_a, field_b, field_c, 
       maturity, maturity_picture_url, maturity_text_file_url, 
-      maturity_video_url, innovation, owner_name, 
+      maturity_video_url, innovation, owner_id, owner_name, 
       owner_type, owner_id_number, owner_mobile, 
       owner_email, owner_postal_address, cooperation_mode, 
       transfer_mode, bargaining_mode, transfer_price, 
@@ -95,7 +96,7 @@
       #{summary,jdbcType=VARCHAR}, #{introduction,jdbcType=VARCHAR}, #{technicalPictureUrl,jdbcType=VARCHAR}, 
       #{fieldA,jdbcType=INTEGER}, #{fieldB,jdbcType=INTEGER}, #{fieldC,jdbcType=INTEGER}, 
       #{maturity,jdbcType=INTEGER}, #{maturityPictureUrl,jdbcType=VARCHAR}, #{maturityTextFileUrl,jdbcType=VARCHAR}, 
-      #{maturityVideoUrl,jdbcType=VARCHAR}, #{innovation,jdbcType=INTEGER}, #{ownerName,jdbcType=VARCHAR}, 
+      #{maturityVideoUrl,jdbcType=VARCHAR}, #{innovation,jdbcType=INTEGER}, #{ownerId,jdbcType=VARCHAR}, #{ownerName,jdbcType=VARCHAR},
       #{ownerType,jdbcType=INTEGER}, #{ownerIdNumber,jdbcType=VARCHAR}, #{ownerMobile,jdbcType=VARCHAR}, 
       #{ownerEmail,jdbcType=VARCHAR}, #{ownerPostalAddress,jdbcType=VARCHAR}, #{cooperationMode,jdbcType=INTEGER}, 
       #{transferMode,jdbcType=INTEGER}, #{bargainingMode,jdbcType=INTEGER}, #{transferPrice,jdbcType=DECIMAL}, 
@@ -162,8 +163,11 @@
       <if test="innovation != null">
         innovation,
       </if>
-      <if test="ownerName != null">
-        owner_name,
+      <if test="ownerId != null">
+        owner_id,
+      </if>
+      <if test="ownerName != null">
+        owner_name,
       </if>
       <if test="ownerType != null">
         owner_type,
@@ -311,8 +315,11 @@
       <if test="innovation != null">
         #{innovation,jdbcType=INTEGER},
       </if>
-      <if test="ownerName != null">
-        #{ownerName,jdbcType=VARCHAR},
+      <if test="ownerId != null">
+        #{ownerId,jdbcType=VARCHAR},
+      </if>
+      <if test="ownerName != null">
+        #{ownerName,jdbcType=VARCHAR},
       </if>
       <if test="ownerType != null">
         #{ownerType,jdbcType=INTEGER},
@@ -460,8 +467,11 @@
       <if test="innovation != null">
         innovation = #{innovation,jdbcType=INTEGER},
       </if>
-      <if test="ownerName != null">
-        owner_name = #{ownerName,jdbcType=VARCHAR},
+      <if test="ownerId != null">
+        owner_id = #{ownerId,jdbcType=VARCHAR},
+      </if>
+      <if test="ownerName != null">
+        owner_name = #{ownerName,jdbcType=VARCHAR},
       </if>
       <if test="ownerType != null">
         owner_type = #{ownerType,jdbcType=INTEGER},
@@ -577,6 +587,7 @@
       maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
       maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
       innovation = #{innovation,jdbcType=INTEGER},
+      owner_id = #{ownerId,jdbcType=VARCHAR},
       owner_name = #{ownerName,jdbcType=VARCHAR},
       owner_type = #{ownerType,jdbcType=INTEGER},
       owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
@@ -698,5 +709,80 @@
 	<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
 		#{item}
 	</foreach>
-  </update>
+  </update>
+  
+   <select id="findAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
+  	select 
+  		id, serial_number as serialNumber, data_category as dataCategory, 
+  		name, keyword, category, 
+  		owner_name as ownerName, owner_type as ownerType, owner_mobile as ownerMobile,
+  		status, release_date as releaseDate
+  	from achievement
+  	where deleted_sign = 0 and owner_id = #{ownerId, jdbcType=VARCHAR}
+  	<if test="serialNumber != null">
+		and  serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  name = #{name,jdbcType=VARCHAR}
+	</if>
+	<if test="keyword != null">
+		and  keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="ownerType != null">
+		and  owner_type = #{ownerType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="releaseStatus != null">
+	   and  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
+  	where deleted_sign = 0 and owner_id = #{ownerId, jdbcType=VARCHAR}
+  	<if test="serialNumber != null">
+		and  serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  name = #{name,jdbcType=VARCHAR}
+	</if>
+	<if test="keyword != null">
+		and  keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="ownerType != null">
+		and  owner_type = #{ownerType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="releaseStatus != null">
+	   and  release_status = #{releaseStatus,jdbcType=INTEGER}
+	</if>
+  </select>
 </mapper>

+ 17 - 3
src/main/java/com/goafanti/common/model/Achievement.java

@@ -94,6 +94,11 @@ public class Achievement {
 	 * 创新度(0--行业先进,1--行业领先,2--国内先进,3--国内领先,4--国际先进,5--国际领先)
 	 */
 	private Integer		innovation;
+	
+	/**
+	 * 所有人ID
+	 */
+	private String		ownerId;
 
 	/**
 	 * 成果所有人名称
@@ -394,6 +399,15 @@ public class Achievement {
 	public void setInnovation(Integer innovation) {
 		this.innovation = innovation;
 	}
+	
+
+	public String getOwnerId() {
+		return ownerId;
+	}
+
+	public void setOwnerId(String ownerId) {
+		this.ownerId = ownerId;
+	}
 
 	public String getOwnerName() {
 		return ownerName;
@@ -669,7 +683,7 @@ public class Achievement {
 	public void setReleaseDateFormattedDate(String releaseDateFormattedDate) {
 
 	}
-	
+
 	public String getMaturityTextFileDownloadFileName() {
 		if (StringUtils.isBlank(this.maturityTextFileUrl)) {
 			return null;
@@ -681,7 +695,7 @@ public class Achievement {
 	public void setMaturityTextFileUrlDownloadFileName(String maturityTextFileDownloadFileName) {
 
 	}
-	
+
 	public String getBusinessPlanDownloadFileName() {
 		if (StringUtils.isBlank(this.businessPlanUrl)) {
 			return null;
@@ -693,7 +707,7 @@ public class Achievement {
 	public void setBusinessPlanDownloadFileName(String businessPlanDownloadFileName) {
 
 	}
-	
+
 	public String getTechPlanDownloadFileName() {
 		if (StringUtils.isBlank(this.techPlanUrl)) {
 			return null;