Преглед изворни кода

首件分页总数,首件按批次搜索,资料查询分页总数

qianxb пре 2 година
родитељ
комит
313abb5820

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1912,7 +1912,7 @@ public class InformationWriteQueryController extends BladeController {
         if (saveList.size() > 0) {
             //保存施工日志
             if (saveLedger.size() > 0) {
-                this.constructionLedgerService.saveBatch(saveLedger, 1000);
+                this.constructionLedgerService.saveBatch(saveLedger,1000);
             }
 
             try {

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.java

@@ -77,6 +77,10 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 	 * 统计
 	 */
 	Integer countInformationQuery(@Param("query") InformationQueryVO informationQuery);
+	/**
+	 * 统计
+	 */
+	Integer countInformationQueryTwo(@Param("query") InformationQueryVO informationQuery);
 
 	/**
 	 * 自定义分页

+ 41 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -384,6 +384,47 @@
         ) AS query
     </select>
 
+    <select id="countInformationQueryTwo" resultType="java.lang.Integer">
+        select
+        count( distinct query.id)
+        from
+        (
+            select
+            query.id
+            from
+            (
+                select
+                iq.id,
+                (case iq.STATUS when 0 THEN null else t.batch end) as report_number,
+                date_format(iq.create_time,'%Y-%m-%d') as createTimes
+                from u_information_query iq left join (select  * from u_task k where k.status!=3 and k.contract_id = #{query.contractId}) t on iq.id = t.form_data_id  and t.is_deleted = 0
+                where
+                iq.is_deleted = 0
+                and iq.classify = #{query.classify}
+                and iq.contract_id = #{query.contractId}
+                <if test="query.taskStatus != null and query.taskStatus != ''"> and iq.status = #{query.taskStatus} </if>
+                <if test="query.sourceType != null and query.sourceType != ''"> and iq.source_type = #{query.sourceType} </if>
+                <if test="query.reportNumber != null and query.reportNumber != ''"> and t.batch = #{query.reportNumber} </if>
+                <if test="query.fileUserIdAndName != null and query.fileUserIdAndName != ''"> and iq.file_user_id_and_name like concat('%',#{query.fileUserIdAndName},'%') </if>
+                <if test="query.queryValue != null and query.queryValue != ''"> and (iq.name like concat('%',#{query.queryValue},'%') OR iq.number like concat('%',#{query.queryValue},'%')) </if>
+                <if test="query.firstTitle != null and query.firstTitle != ''"> and iq.type = 3 </if>
+                <if test="query.firstTitle == null or query.firstTitle == ''"> and iq.type != 3 </if>
+                <if test="query.wbsIds != null">
+                and iq.wbs_id in
+                <foreach collection="query.wbsIds" item="wbsIdc" open="(" separator="," close=")">
+                    #{wbsIdc}
+                </foreach>
+                </if>
+            ) AS query
+        where
+        1 = 1
+        <if test="query.reportNumber != null and query.reportNumber != ''"> and report_number = #{query.reportNumber} </if>
+        <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
+            and query.createTimes between #{query.startTime} and #{query.endTime}
+        </if>
+        ) AS query
+    </select>
+
     <select id="selectInformationQueryPage" resultMap="informationQueryResultMap">
         select
             query.wbs_id,

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -460,7 +460,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         }
 
         //获取总量
-        Integer count = this.baseMapper.countInformationQuery(vo);
+        Integer count = this.baseMapper.countInformationQueryTwo(vo);
 
         //获取数据
         List<InformationQuery> result = this.baseMapper.selectInformationQueryPageTwo(current, page.getSize(), vo);