|  |  |  | @ -1,43 +1,44 @@ | 
			
		
	
		
			
				
					|  |  |  |  | <?xml version="1.0" encoding="UTF-8"?> | 
			
		
	
		
			
				
					|  |  |  |  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
			
		
	
		
			
				
					|  |  |  |  | <mapper namespace="com.glxp.api.dao.collect.IoCollectOrderBackupMapper"> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="filterList" resultType="com.glxp.api.res.collect.IoCollectOrderResponse"> | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT icob.billNo, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.busType, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.fromType, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.fromTypeDesc, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.fromCorp, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.billTime, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.orderCirType, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.createTime, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.workPlaceCode, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.remark, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.createUser, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.updateTime, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.updateUser, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.tagStatus, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.splitStatus, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.invAlert, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.splitMsg, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.fromCorpName, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.shipperName, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.thrBusType, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.shipper, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.tagMsg, | 
			
		
	
		
			
				
					|  |  |  |  |         sys_workplace_document.busName busTypeName, | 
			
		
	
		
			
				
					|  |  |  |  |         sw.workplaceName, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.id, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.orderTime, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.uploadStatus, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.uploadError, | 
			
		
	
		
			
				
					|  |  |  |  |         icob.errorMsg, | 
			
		
	
		
			
				
					|  |  |  |  |         row_number() over ( order by case when icob.orderTime is null then icob.createTime else icob.orderTime end desc ) | 
			
		
	
		
			
				
					|  |  |  |  |         as orderSequence | 
			
		
	
		
			
				
					|  |  |  |  |                icob.busType, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.fromType, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.fromTypeDesc, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.fromCorp, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.billTime, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.orderCirType, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.createTime, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.workPlaceCode, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.remark, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.createUser, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.updateTime, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.updateUser, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.tagStatus, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.splitStatus, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.invAlert, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.splitMsg, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.fromCorpName, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.shipperName, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.thrBusType, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.shipper, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.tagMsg, | 
			
		
	
		
			
				
					|  |  |  |  |                sys_workplace_document.busName busTypeName, | 
			
		
	
		
			
				
					|  |  |  |  |                sw.workplaceName, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.id, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.orderTime, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.uploadStatus, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.uploadError, | 
			
		
	
		
			
				
					|  |  |  |  |                icob.errorMsg, | 
			
		
	
		
			
				
					|  |  |  |  |                row_number() over ( order by case | 
			
		
	
		
			
				
					|  |  |  |  |                                                 when icob.orderTime is null then icob.createTime | 
			
		
	
		
			
				
					|  |  |  |  |                                                 else icob.orderTime end desc ) | 
			
		
	
		
			
				
					|  |  |  |  |                    as                         orderSequence | 
			
		
	
		
			
				
					|  |  |  |  |         FROM io_collect_order_backup icob | 
			
		
	
		
			
				
					|  |  |  |  |         left join sys_workplace_document on icob.busType = sys_workplace_document.documentTypeCode | 
			
		
	
		
			
				
					|  |  |  |  |         left join basic_corp bc on icob.fromCorp = bc.erpId | 
			
		
	
		
			
				
					|  |  |  |  |         left join sys_workplace sw on icob.workPlaceCode = sw.workplaceId | 
			
		
	
		
			
				
					|  |  |  |  |                  left join sys_workplace_document on icob.busType = sys_workplace_document.documentTypeCode | 
			
		
	
		
			
				
					|  |  |  |  |                  left join basic_corp bc on icob.fromCorp = bc.erpId | 
			
		
	
		
			
				
					|  |  |  |  |                  left join sys_workplace sw on icob.workPlaceCode = sw.workplaceId | 
			
		
	
		
			
				
					|  |  |  |  |         <where> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="billNo != '' and billNo != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND billNo LIKE concat('%', #{billNo}, '%') | 
			
		
	
	
		
			
				
					|  |  |  | @ -51,9 +52,6 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="fromCorp != '' and fromCorp != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND fromCorp LIKE concat('%', #{fromCorp}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="collectCode != null and collectCode != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND collectCode = #{collectCode} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="busType != null and busType != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND busType = #{busType} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
	
		
			
				
					|  |  |  | @ -68,15 +66,15 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="unionKey != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND ( | 
			
		
	
		
			
				
					|  |  |  |  |                 icob.billNo like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.fromCorp like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.fromCorpName like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.backupOrderRemark1 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.backupOrderRemark2 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.backupOrderRemark3 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.backupOrderRemark4 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.backupOrderRemark5 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.backupOrderRemark6 like concat('%', #{unionKey}, '%')) | 
			
		
	
		
			
				
					|  |  |  |  |                         icob.billNo like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.fromCorp like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.fromCorpName like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.backupOrderRemark1 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.backupOrderRemark2 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.backupOrderRemark3 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.backupOrderRemark4 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.backupOrderRemark5 like concat('%', #{unionKey}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                         or icob.backupOrderRemark6 like concat('%', #{unionKey}, '%')) | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -93,7 +91,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 </foreach> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="invAlert != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 and icob.invAlert =#{invAlert} | 
			
		
	
		
			
				
					|  |  |  |  |                 and icob.invAlert = #{invAlert} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="invAlerts != null and invAlerts.size() > 0"> | 
			
		
	
		
			
				
					|  |  |  |  |                 and icob.invAlert in | 
			
		
	
	
		
			
				
					|  |  |  | @ -106,10 +104,10 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="keyWords != null and keyWords != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 and (icob.billNo like concat('%', #{keyWords}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.fromCorp like concat('%', #{keyWords}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.workPlaceCode like concat('%', #{keyWords}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.busType like concat('%', #{keyWords}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                 or icob.fromType like concat('%', #{keyWords}, '%')) | 
			
		
	
		
			
				
					|  |  |  |  |                     or icob.fromCorp like concat('%', #{keyWords}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                     or icob.workPlaceCode like concat('%', #{keyWords}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                     or icob.busType like concat('%', #{keyWords}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |                     or icob.fromType like concat('%', #{keyWords}, '%')) | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="shipperName != '' and shipperName != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND icob.shipperName LIKE concat('%', #{shipperName}, '%') | 
			
		
	
	
		
			
				
					|  |  |  | @ -120,19 +118,18 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="fromCorpName != '' and fromCorpName != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND icob.fromCorpName LIKE concat('%', #{fromCorpName}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         <if test="startTime != null"> | 
			
		
	
		
			
				
					|  |  |  |  |             <![CDATA[ | 
			
		
	
		
			
				
					|  |  |  |  |             and icob.billTime >= DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S') | 
			
		
	
		
			
				
					|  |  |  |  |             ]]> | 
			
		
	
		
			
				
					|  |  |  |  |         </if> | 
			
		
	
		
			
				
					|  |  |  |  |         <if test="endTime != null"> | 
			
		
	
		
			
				
					|  |  |  |  |             <![CDATA[ | 
			
		
	
		
			
				
					|  |  |  |  |             and icob.billTime <= DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S') | 
			
		
	
		
			
				
					|  |  |  |  |             ]]> | 
			
		
	
		
			
				
					|  |  |  |  |         </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="startTime != null  and startTime != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[ | 
			
		
	
		
			
				
					|  |  |  |  |                 and icob.billTime >= DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S') | 
			
		
	
		
			
				
					|  |  |  |  |                 ]]> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="endTime != null and endTime != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[ | 
			
		
	
		
			
				
					|  |  |  |  |                 and icob.billTime <= DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S') | 
			
		
	
		
			
				
					|  |  |  |  |                 ]]> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  |         GROUP BY | 
			
		
	
		
			
				
					|  |  |  |  |         icob.billNo | 
			
		
	
		
			
				
					|  |  |  |  |         GROUP BY icob.billNo | 
			
		
	
		
			
				
					|  |  |  |  |         order by case when icob.orderTime is null then icob.createTime else icob.orderTime end desc | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | </mapper> | 
			
		
	
	
		
			
				
					|  |  |  | 
 |