|  |  | @ -3,38 +3,15 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | <mapper namespace="com.glxp.api.dao.trace.TraceRecordMapper"> |  |  |  | <mapper namespace="com.glxp.api.dao.trace.TraceRecordMapper"> | 
			
		
	
		
		
			
				
					
					|  |  |  |     <select id="filterTraces" parameterType="com.glxp.api.req.trace.TraceRecordRequest" |  |  |  |     <select id="filterTraces" parameterType="com.glxp.api.req.trace.TraceRecordRequest" | 
			
		
	
		
		
			
				
					
					|  |  |  |             resultType="com.glxp.api.res.trace.TraceRecordResponse"> |  |  |  |             resultType="com.glxp.api.res.trace.TraceRecordResponse"> | 
			
		
	
		
		
			
				
					
					|  |  |  |         select * |  |  |  |         SELECT tr.recordCode,tr.remark,trd.*,mid.* | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         from trace_record |  |  |  |         FROM trace_record tr | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                      inner join trace_record_detail |  |  |  |         LEFT JOIN trace_record_detail trd ON trd.recordIdFk = tr.id | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 on trace_record.id = trace_record_detail.recordIdFk |  |  |  |         LEFT JOIN (SELECT tor.recordCodeFk,tor.fromCorp,tor.toCorp,tor.createUser,uc.companyName | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         FROM trace_order tor LEFT JOIN user_company uc ON uc.id = tor.companyIdFk) mid ON mid.recordCodeFk = tr.recordCode | 
			
		
	
		
		
			
				
					
					|  |  |  |         <where> |  |  |  |         <where> | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="id != '' and id != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and id = #{id} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="recordCode != '' and recordCode != null"> |  |  |  |             <if test="recordCode != '' and recordCode != null"> | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and recordCode = #{recordCode} |  |  |  |                 and recordCode = #{recordCode} | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="fromType != '' and fromType != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and fromType = #{fromType} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="createUser != '' and createUser != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and `createUser` = #{createUser} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="traceType != '' and traceType != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and traceType = #{traceType} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="udiCode != '' and udiCode != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and udiCode = #{udiCode} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="creditNum != '' and creditNum != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and creditNum = #{creditNum} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and `ylqxzcrbarmc` = #{ylqxzcrbarmc} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="nameCode != '' and nameCode != null"> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and nameCode = #{nameCode} |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <if test="cpmctymc != '' and cpmctymc != null"> |  |  |  |             <if test="cpmctymc != '' and cpmctymc != null"> | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and cpmctymc = #{cpmctymc} |  |  |  |                 and cpmctymc = #{cpmctymc} | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |             </if> | 
			
		
	
	
		
		
			
				
					|  |  | @ -45,6 +22,5 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                 and `batchNo` = #{batchNo} |  |  |  |                 and `batchNo` = #{batchNo} | 
			
		
	
		
		
			
				
					
					|  |  |  |             </if> |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |         </where> |  |  |  |         </where> | 
			
		
	
		
		
			
				
					
					|  |  |  |         ORDER BY id DESC |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     </select> |  |  |  |     </select> | 
			
		
	
		
		
			
				
					
					|  |  |  | </mapper> |  |  |  | </mapper> | 
			
		
	
	
		
		
			
				
					|  |  | 
 |