Ver código fonte

首件工程批次查询

qianxb 2 anos atrás
pai
commit
92b9362832

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

@@ -82,6 +82,10 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 	 * 自定义分页
 	 */
 	List<InformationQuery> selectInformationQueryPage(@Param("current") Long current, @Param("size") Long size, @Param("query") InformationQueryVO informationQuery);
+	/**
+	 * 自定义分页,因为information的批次字段数据不全
+	 */
+	List<InformationQuery> selectInformationQueryPageTwo(@Param("current") Long current, @Param("size") Long size, @Param("query") InformationQueryVO informationQuery);
 
 	List<WbsTreeContract> getContractNodeByPrimaryKeyIds(String ids);
 

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

@@ -441,6 +441,64 @@
         limit #{current}, #{size}
     </select>
 
+    <select id="selectInformationQueryPageTwo" resultMap="informationQueryResultMap">
+        select
+        query.wbs_id,
+        query.id,
+        query.name,
+        query.number,
+        query.create_time,
+        query.status,
+        query.report_number,
+        query.file_user_id_and_name,
+        query.pdf_url,
+        query.e_visa_pdf_url,
+        query.sj_record_ids
+        from
+        (
+        select
+        iq.sort,
+        iq.id,
+        iq.name,
+        iq.number,
+        iq.create_time,
+        iq.status,
+        (case iq.STATUS when 0 THEN null else t.batch end) as report_number,
+        iq.file_user_id_and_name,
+        date_format(iq.create_time,'%Y-%m-%d') as createTimes,
+        iq.pdf_url,
+        iq.e_visa_pdf_url,
+        iq.wbs_id,
+        iq.sj_record_ids
+        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>
+        order by create_time desc
+        limit #{current}, #{size}
+    </select>
+
     <select id="getContractNodeByPrimaryKeyIds" resultType="org.springblade.manager.entity.WbsTreeContract">
         select * from m_wbs_tree_contract where p_key_id in (${ids}) and is_deleted = 0 order by ancestors,sort
     </select>

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

@@ -463,7 +463,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         Integer count = this.baseMapper.countInformationQuery(vo);
 
         //获取数据
-        List<InformationQuery> result = this.baseMapper.selectInformationQueryPage(current, page.getSize(), vo);
+        List<InformationQuery> result = this.baseMapper.selectInformationQueryPageTwo(current, page.getSize(), vo);
 
         //转换VO
         if (result != null && result.size() != 0) {