Pārlūkot izejas kodu

审核bug修复

wangtong 1 gadu atpakaļ
vecāks
revīzija
82c8f915d7

+ 1 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZEngineeringCivilMapper.java

@@ -34,4 +34,5 @@ public interface ZEngineeringCivilMapper extends BaseMapperPlus<ZEngineeringCivi
     LinkedList<String> getTableNames(String tableName);
     List<ZEngineeringInfoBo> getsumId(@Param("tableNames") List tableNames, @Param("createTime")List createTime, @Param("UserName") String UserName);
     List<ZEngineeringCivilExportVo> getexportList(@Param("tableNames") List tableNames,@Param("createTime") String createTime,@Param("p") ZEngineeringCivilBo bo);
+    Long getTypeNumber( @Param("tableNames") List tableNames,@Param("p")ZEngineeringCivilBo bo);
 }

+ 9 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringCivilServiceImpl.java

@@ -172,7 +172,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
         lqw.eq(StringUtils.isNotBlank(bo.getBuildingId()), ZEngineeringCivil::getBuildingId, bo.getBuildingId());
         lqw.eq(StringUtils.isNotBlank(bo.getUnitId()), ZEngineeringCivil::getUnitId, bo.getUnitId());
         lqw.eq(StringUtils.isNotBlank(bo.getDistrict()), ZEngineeringCivil::getDistrict, bo.getDistrict());
-        lqw.last("limit "+(pageQuery.getPageNum() - 1)+","+(pageQuery.getPageNum()*pageQuery.getPageSize()));
+        //lqw.last("limit "+(pageQuery.getPageNum() - 1)+","+(pageQuery.getPageNum()*pageQuery.getPageSize()));
         LambdaQueryWrapper<ZEngineeringCivil> lqw2 = Wrappers.lambdaQuery();
         lqw2.eq(StringUtils.isNotBlank(bo.getEnginType()), ZEngineeringCivil::getEnginType, bo.getEnginType());
         lqw2.eq(StringUtils.isNotBlank(bo.getEnginClassification()), ZEngineeringCivil::getEnginClassification, bo.getEnginClassification());
@@ -190,7 +190,14 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
             {
                 return TableDataInfo.build(result);
             }
-          result = baseMapper.queryPageIdList(IDList, baseMapper.selectCount(lqw2), page,pageQuery.getPageNum() - 1, pageQuery.getPageSize());
+            LinkedList <String>list=baseMapper.getTableNames("z_engineering_info");
+            List DateList=new ArrayList();
+            list.removeLast();
+            list.stream().forEach(item->{
+
+                DateList.add(item.substring(item.indexOf("2")));
+            });
+          result = baseMapper.queryPageIdList(IDList, baseMapper.getTypeNumber(DateList,bo), page,pageQuery.getPageNum() - 1, pageQuery.getPageSize());
             Map<String,Object> ReviewList=zEngineeringNodeService.ReViewList(result.getRecords());
             result.getRecords().forEach(item->{
                     item.setNodeReViewStateList(ReviewList.get(item.getId()));

+ 1 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringReviewServiceImpl.java

@@ -72,6 +72,7 @@ public class ZEngineeringReviewServiceImpl implements IZEngineeringReviewService
     }
 
 
+
     @Override
     @DynamicName(spel = "#bo.createTime")
     public ZEngineeringReviewBo query(ZEngineeringNodeBo bo) {

+ 76 - 0
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngineeringCivilMapper.xml

@@ -446,4 +446,80 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </foreach>
     </select>
+    <select id="getTypeNumber" resultType="Long">
+        SELECT
+        COUNT( DISTINCT c.id)
+        FROM
+        (
+        SELECT
+        a.*
+        FROM
+        z_engineering_civil  a
+        LEFT JOIN  z_engineering_node b ON a.id=b.civli_id
+        where 1=1
+        <if test="p.district != null and p.district != ''">
+            and a.district = #{p.district}
+        </if>
+        <if test="p.areaId != null and p.areaId != ''">
+            and a.area_id = #{p.areaId}
+        </if>
+        <if test="p.buildingId != null and p.buildingId != ''">
+            and a.building_id = #{p.buildingId}
+        </if>
+        <if test="p.unitId != null and p.unitId != ''">
+            and a.unit_id = #{p.unitId}
+        </if>
+        <if test="p.enginType != null and p.enginType != ''">
+            and engin_type = #{p.enginType}
+        </if>
+        <if test="p.enginClassification != null and p.enginClassification != ''">
+            and engin_classification = #{p.enginClassification}
+        </if>
+        <if test="p.enginCycle != null and p.enginCycle != ''">
+            and engin_cycle = 0
+        </if>
+        <if test="p.beginTime != null and p.beginTime != ''">
+            and  update_info_time between #{beginTime[0]} and #{beginTime[1]}
+        </if>
+        <if test="p.type != null and p.type != ''">
+            and b.type =#{p.type}
+        </if>
+        <foreach collection="tableNames" item="name">
+            union
+            SELECT
+            a.*
+            FROM
+            z_engineering_civil  a
+            LEFT JOIN  z_engineering_node_${name} b ON a.id=b.civli_id
+            where 1=1
+            <if test="p.district != null and p.district != ''">
+                and a.district = #{p.district}
+            </if>
+            <if test="p.areaId != null and p.areaId != ''">
+                and a.area_id = #{p.areaId}
+            </if>
+            <if test="p.buildingId != null and p.buildingId != ''">
+                and a.building_id = #{p.buildingId}
+            </if>
+            <if test="p.unitId != null and p.unitId != ''">
+                and a.unit_id = #{p.unitId}
+            </if>
+            <if test="p.enginType != null and p.enginType != ''">
+                and a.engin_type = #{p.enginType}
+            </if>
+            <if test="p.enginClassification != null and p.enginClassification != ''">
+                and a.engin_classification = #{p.enginClassification}
+            </if>
+            <if test="p.enginCycle != null and p.enginCycle != ''">
+                and a.engin_cycle = 0
+            </if>
+            <if test="p.beginTime != null and p.beginTime != ''">
+                and  a.update_info_time between #{beginTime[0]} and #{beginTime[1]}
+            </if>
+            <if test="p.type != null and p.type != ''">
+                and b.type =#{p.type}
+            </if>
+        </foreach>
+                                                     ) as c
+    </select>
 </mapper>