Browse Source

项目列表新增标签搜索

anderx 7 years ago
parent
commit
7f15b4a7c4

+ 2 - 2
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -71,9 +71,9 @@ public class OpenAppHomeController extends BaseApiController{
 	 * @return
 	 * @return
 	 */
 	 */
 	@RequestMapping(value="/projectList", method=RequestMethod.GET)
 	@RequestMapping(value="/projectList", method=RequestMethod.GET)
-	public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
+	public Result getProjectList(String tag,String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
 		Result result=new Result();
 		Result result=new Result();
-		result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort,ownerId));
+		result.setData(jtBusinessService.getProjects(tag,topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort,ownerId));
 		return result;
 		return result;
 	}
 	}
 	
 	

+ 1 - 1
src/main/java/com/goafanti/business/controller/JtBusinessController.java

@@ -33,7 +33,7 @@ public class JtBusinessController extends CertifyApiController {
 	@RequestMapping(value="/jtProject/list", method=RequestMethod.GET)
 	@RequestMapping(value="/jtProject/list", method=RequestMethod.GET)
 	public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
 	public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
 		Result result=new Result();
 		Result result=new Result();
-		result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort,ownerId));
+		result.setData(jtBusinessService.getProjects(null,topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort,ownerId));
 		return result;
 		return result;
 	}
 	}
 	
 	

+ 1 - 1
src/main/java/com/goafanti/business/service/JtBusinessService.java

@@ -19,7 +19,7 @@ public interface JtBusinessService {
 	JtBusinessProjectResult getBusinessProjectDetail(String id);
 	JtBusinessProjectResult getBusinessProjectDetail(String id);
 	JtBusinessCategoryTree getCategoryTree(String id);
 	JtBusinessCategoryTree getCategoryTree(String id);
 	List<JtBusinessCategoryBo>getCategoryBoList(Integer module);
 	List<JtBusinessCategoryBo>getCategoryBoList(Integer module);
-	Pagination<JtBusinessProjectResult>getProjects(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId); 
+	Pagination<JtBusinessProjectResult>getProjects(String tag,String topId,String secondId,String name, Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId); 
 	int insertCategory(JtBusinessCategory jtBusinessCategory);
 	int insertCategory(JtBusinessCategory jtBusinessCategory);
 	int deleteCategoryById(String id);
 	int deleteCategoryById(String id);
 	JtBusinessCategory getCategoryById(String id);
 	JtBusinessCategory getCategoryById(String id);

+ 2 - 1
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -91,7 +91,7 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	 * */
 	 * */
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
 	@Override
 	@Override
-	public Pagination<JtBusinessProjectResult> getProjects(String topId, String secondId, String name, Integer pageSize,
+	public Pagination<JtBusinessProjectResult> getProjects(String tag,String topId, String secondId, String name, Integer pageSize,
 			Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
 			Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
 		if(orderType==null)orderType=0;
 		if(orderType==null)orderType=0;
 		if(orderSort==null)orderSort=0;
 		if(orderSort==null)orderSort=0;
@@ -115,6 +115,7 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		if(isHot!=null)params.put("isHot", isHot);
 		if(isHot!=null)params.put("isHot", isHot);
 		if(orderType!=null)params.put("orderType", orderType);
 		if(orderType!=null)params.put("orderType", orderType);
 		if(orderSort!=null)params.put("orderSort", orderSort);
 		if(orderSort!=null)params.put("orderSort", orderSort);
+		if(StringUtils.isNotBlank(tag))params.put("tag", tag);
 		return (Pagination<JtBusinessProjectResult>)findPage("findJtBusinessProjectByPage","findJtBusinessCountByPage",params,pageNo,pageSize);
 		return (Pagination<JtBusinessProjectResult>)findPage("findJtBusinessProjectByPage","findJtBusinessCountByPage",params,pageNo,pageSize);
 	}
 	}
 	
 	

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

@@ -652,7 +652,7 @@ public class WebpageController extends BaseController {
 		patentCategory = patentCategory.subList(0, Math.min(3, patentCategory.size()));
 		patentCategory = patentCategory.subList(0, Math.min(3, patentCategory.size()));
 		modelview.addObject("patentCategory", patentCategory);
 		modelview.addObject("patentCategory", patentCategory);
 		List<JtBusinessProject> jtBusinessProjects = (List<JtBusinessProject>) jtBusinessService
 		List<JtBusinessProject> jtBusinessProjects = (List<JtBusinessProject>) jtBusinessService
-				.getProjects(null, null, null, 5, 1, 1, 2, 0, 1, 0, 0, null).getList();
+				.getProjects(null,null, null, null, 5, 1, 1, 2, 0, 1, 0, 0, null).getList();
 		for (JtBusinessProject project : jtBusinessProjects) {
 		for (JtBusinessProject project : jtBusinessProjects) {
 			if (project.getMaxImgUrl() != null && project.getMaxImgUrl().length() <= 0)
 			if (project.getMaxImgUrl() != null && project.getMaxImgUrl().length() <= 0)
 				project.setMaxImgUrl(null);
 				project.setMaxImgUrl(null);
@@ -932,24 +932,24 @@ public class WebpageController extends BaseController {
 
 
 		// 最新发布
 		// 最新发布
 		List<JtBusinessProjectResult> recents = (List<JtBusinessProjectResult>) jtBusinessService
 		List<JtBusinessProjectResult> recents = (List<JtBusinessProjectResult>) jtBusinessService
-				.getProjects(null, null, null, 4, 1, 1, 2, 1, null, 0, 0, null).getList();
+				.getProjects(null,null, null, null, 4, 1, 1, 2, 1, null, 0, 0, null).getList();
 		modelAndView.addObject("recent", recents);
 		modelAndView.addObject("recent", recents);
 
 
 		// 专利服务-商标服务-版权服务
 		// 专利服务-商标服务-版权服务
 		for (JtBusinessCategoryBo c : categoryBos) {
 		for (JtBusinessCategoryBo c : categoryBos) {
 			if ("专利服务".equals(c.getTopLevel())) {
 			if ("专利服务".equals(c.getTopLevel())) {
 				List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
 				List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
-						.getProjects(c.getTopLevelId(), null, null, 3, 1, 1, 2, 1, null, 0, 0, null).getList();
+						.getProjects(null,c.getTopLevelId(), null, null, 3, 1, 1, 2, 1, null, 0, 0, null).getList();
 				modelAndView.addObject("patentService", res);
 				modelAndView.addObject("patentService", res);
 				modelAndView.addObject("patentTopId", c.getTopLevelId());
 				modelAndView.addObject("patentTopId", c.getTopLevelId());
 			} else if ("商标服务".equals(c.getTopLevel())) {
 			} else if ("商标服务".equals(c.getTopLevel())) {
 				List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
 				List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
-						.getProjects(c.getTopLevelId(), null, null, 4, 1, 1, 2, 1, null, 0, 0, null).getList();
+						.getProjects(null,c.getTopLevelId(), null, null, 4, 1, 1, 2, 1, null, 0, 0, null).getList();
 				modelAndView.addObject("branchService", res);
 				modelAndView.addObject("branchService", res);
 				modelAndView.addObject("branchTopId", c.getTopLevelId());
 				modelAndView.addObject("branchTopId", c.getTopLevelId());
 			} else if ("版权服务".equals(c.getTopLevel())) {
 			} else if ("版权服务".equals(c.getTopLevel())) {
 				List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
 				List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
-						.getProjects(c.getTopLevelId(), null, null, 3, 1, 1, 2, 1, null, 0, 0, null).getList();
+						.getProjects(null,c.getTopLevelId(), null, null, 3, 1, 1, 2, 1, null, 0, 0, null).getList();
 				modelAndView.addObject("copyrightService", res);
 				modelAndView.addObject("copyrightService", res);
 				modelAndView.addObject("copyrightTopId", c.getTopLevelId());
 				modelAndView.addObject("copyrightTopId", c.getTopLevelId());
 			}
 			}
@@ -1016,7 +1016,7 @@ public class WebpageController extends BaseController {
 		OrgIdentityBo org = organizationIdentityService.selectOrgIdentityBoByUserId(uid);
 		OrgIdentityBo org = organizationIdentityService.selectOrgIdentityBoByUserId(uid);
 		modelAndView.addObject("org", org);
 		modelAndView.addObject("org", org);
 		List<JtBusinessProjectResult> projectResults = (List<JtBusinessProjectResult>) jtBusinessService
 		List<JtBusinessProjectResult> projectResults = (List<JtBusinessProjectResult>) jtBusinessService
-				.getProjects(null, null, null, 4, 1, 0, 2, null, null, 0, 0, uid).getList();
+				.getProjects(null,null, null, null, 4, 1, 0, 2, null, null, 0, 0, uid).getList();
 		modelAndView.addObject("jtProjects", projectResults);
 		modelAndView.addObject("jtProjects", projectResults);
 		String honor = org.getHonorPicture();
 		String honor = org.getHonorPicture();
 		if (honor != null && honor.contains(".")) {
 		if (honor != null && honor.contains(".")) {

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

@@ -625,14 +625,21 @@
 	  u.identify_name as companyName,u.id as companyId
 	  u.identify_name as companyName,u.id as companyId
   from jt_business_project jtbp
   from jt_business_project jtbp
   left join user u on u.id=jtbp.owner_id
   left join user u on u.id=jtbp.owner_id
+  left join (select sum(commodity_quantity) as dealCount ,commodity_id from jt_order_detail group by commodity_id) dct on jtbp.id=dct.commodity_id
   <if test="topId!=null">
   <if test="topId!=null">
   left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
   left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
   </if>
   </if>
   <if test="module!=null">
   <if test="module!=null">
   left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
   left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
   </if>
   </if>
-  left join (select sum(commodity_quantity) as dealCount ,commodity_id from jt_order_detail group by commodity_id) dct on jtbp.id=dct.commodity_id
+  <if test="tag != null">
+  left join jt_business_project_tag x on x.project_id=jtbp.id
+  left join jt_tag y on x.tag_id=y.id
+  </if>
   where 1=1
   where 1=1
+  <if test="tag != null">
+  and y.id= #{tag,jdbcType=VARCHAR}
+  </if>
   <if test="module == 0">
   <if test="module == 0">
   and jtbc1.module !=1
   and jtbc1.module !=1
   </if>
   </if>
@@ -680,8 +687,15 @@
 	    <if test="module!=null">
 	    <if test="module!=null">
   left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
   left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
   </if>
   </if>
-	  where 1=1
-	    <if test="module !=null">
+	<if test="tag != null">
+  left join jt_business_project_tag x on x.project_id=jtbp.id
+  left join jt_tag y on x.tag_id=y.id
+  </if>
+  where 1=1
+  <if test="tag != null">
+  and y.id= #{tag,jdbcType=VARCHAR}
+  </if> 
+  <if test="module !=null">
   and jtbc1.module=#{module,jdbcType=INTEGER}
   and jtbc1.module=#{module,jdbcType=INTEGER}
   </if>
   </if>
 	  <if test="secondId!=null">
 	  <if test="secondId!=null">