Переглянути джерело

修改项目申报 首页查询问题

wangjiang988 5 роки тому
батько
коміт
bf5b624284

+ 3 - 2
src/main/java/platform/modules/government/dao/ProjectDeclarationDao.java

@@ -24,7 +24,8 @@ public interface ProjectDeclarationDao extends BaseMapper<ProjectDeclaration> {
 	int findProjectsCountOnHome(@Param("request") FindRequest request);
 
 	List<ProjectDeclaration> findProjectsOnHome(@Param("request") FindRequest request);
-	
-	List<ProjectDeclaration> findUnionProjectsOnHome(@Param("request") FindRequest request);
+
+    List<ProjectDeclaration> findUnionProjectsOnHome(@Param("request") FindRequest request);
+    List<ProjectDeclaration> findUnionProjectsOnHomeV2(@Param("request") FindRequest request);
 
 }

+ 3 - 1
src/main/java/platform/modules/government/service/ProjectDeclarationService.java

@@ -2271,7 +2271,9 @@ public class ProjectDeclarationService extends BaseService<ProjectDeclaration> {
         if (request.getId() == 77) {
             contents = projectFillingService.findUnionProjectsOnHome(request);
         } else {//项目申报、省市申报
-            contents = projectDeclarationDao.findUnionProjectsOnHome(request);
+            // 解决项目申报 国家和高新区不能区分问题
+//            contents = projectDeclarationDao.findUnionProjectsOnHome(request);
+            contents = projectDeclarationDao.findUnionProjectsOnHomeV2(request);
         }
         if (contents.size() > 0) {
             for (ProjectDeclaration project : contents) {

+ 37 - 0
src/main/resources/mapper/government/ProjectDeclarationDao.xml

@@ -135,6 +135,43 @@
         </if>
 
     </select>
+
+    <select id="findUnionProjectsOnHomeV2" resultType="platform.modules.government.entity.ProjectDeclaration">
+            select * from
+            (
+            SELECT
+            a.id,a.project_name,a.create_time,a.project_source,a.apply_enddate,0 as isFilling,a.project_content AS
+            content
+            FROM project_declaration a
+            where
+            a.del_flag=0
+            and a.is_open = 1
+            and a.status = 1
+            UNION
+            select
+            b.id ,b.project_name,b.create_time,b.project_source,b.end_time AS apply_enddate,3 as isFilling,b.content
+            from project_intelligent_declaration b
+            where b.del_flag = 0 and b.status=1
+            union
+            select
+            c.id ,c.project_name,c.create_time,c.project_source,c.end_time AS apply_enddate,1 as isFilling,c.content
+            from project_provinces_declaration c
+            where c.del_flag = 0 and c.status=1
+            AND c.is_public = 1
+            ) temp
+            where 1=1
+            <if test="request.type != null and request.type != ''">
+                and temp.project_source = #{request.type}
+            </if>
+            <if test="request.startTime !='' and request.startTime !=null ">
+                and temp.create_time <![CDATA[>=]]> #{request.startTime}
+            </if>
+            <if test="request.endTime !='' and request.endTime !=null ">
+                and temp.create_time <![CDATA[<=]]> #{request.endTime}
+            </if>
+            order by temp.create_time desc
+    </select>
+
     <select id="findProjectsOnHome" resultType="platform.modules.government.entity.ProjectDeclaration">
         SELECT
         a.project_name,a.id,a.create_time,a.project_source,a.apply_enddate