Browse Source

知识产权赚钱科技项目顺序

limin 7 years ago
parent
commit
1daef410f2

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

@@ -40,4 +40,13 @@ public interface JtBusinessService {
 	 */
 	List<JtBusinessCategory> getCategoryByModule(Integer module);
 	
+	/**
+	 * 查看模块项目
+	 * @param module
+	 * @param isHost
+	 * @param size
+	 * @return
+	 */
+	List<JtBusinessProject> getKJListByIds(Integer module, Integer isHost, Integer size);
+	
 }

+ 6 - 0
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -438,6 +438,12 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	public List<JtBusinessCategory> getCategoryByModule(Integer module) {
 		return jtBusinessCategoryMapper.getCategoryByModule(module);
 	}
+
+	@Override
+	public List<JtBusinessProject> getKJListByIds(Integer module,
+			Integer isHost, Integer size) {
+		return jtBusinessProjectMapper.getKJListByIds( module,  isHost,  size);
+	}
 	
 	
 	

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

@@ -444,19 +444,9 @@ public class WebpageController extends BaseController {
 		//科技项目
 		//获得所有模块为5的科技项目id
 		JtBusinessCategory scienceProject1 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
-		List<JtBusinessCategory> scienceProject = jtBusinessService.getCategoryByModule(5);
-		List<JtBusinessProject> manageSysPro = new ArrayList<JtBusinessProject>();
-		for (JtBusinessCategory jtBusinessCategory : scienceProject) {
-			List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategory.getId(), 12, 1);
-			manageSysPro.addAll(list);
-		}
-		if(null != manageSysPro){
-			if(manageSysPro.size()>12){
-				manageSysPro.subList(0, 12);
-			}
-			modelview.addObject("scienceProjectList", manageSysPro);
-			modelview.addObject("spc1", scienceProject1);
-		}
+		List<JtBusinessProject> manageSysPro = jtBusinessService.getKJListByIds(5,1,12);
+		modelview.addObject("scienceProjectList", manageSysPro);
+		modelview.addObject("spc1", scienceProject1);
 		/****************************以上是新修改的部分********************************************/
 		// 咨询师
 		List<UserIdentityBo> userIdentityBos = userIdentityService.getExperts(8);

+ 1 - 1
src/main/java/com/goafanti/common/dao/JtBusinessProjectMapper.java

@@ -84,7 +84,7 @@ public interface JtBusinessProjectMapper {
   
 	JtBusinessProjectResult selectByPrimaryKeyWithModule(@Param("id")String id,@Param("uid")String uid);
   
-
+	List<JtBusinessProject> getKJListByIds(Integer module, Integer isHost, Integer size);
      
   
 }

+ 16 - 0
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -839,4 +839,20 @@
   	and b.module = 5 
   	</if>
   </select>
+  
+  <!-- 查看科技服务项目   -->
+  <select id="getKJListByIds" resultType="com.goafanti.common.model.JtBusinessProject">
+    select 
+	    p.id,
+	  	p.name,
+	  	p.introduce,
+	  	p.min_img_url as minImgUrl
+  	from jt_business_project p
+    left join jt_business_category c on p.category_id = c.id
+    where c.module = #{0} 
+    and p.audit_status = 2 and is_hot = #{1}
+    order by release_date desc
+	  	limit #{2}
+	
+	  </select>
 </mapper>