| 
					
				 | 
			
			
				@@ -839,6 +839,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             WHEN 'MH' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             '从单' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             END billType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            c.m_bill_no mBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             c.mblno inMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             t.load_addr loadAddr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             t.md_load_addr mdLoadAddr, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -863,6 +864,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             AND cntr.dict_type = 'data_cntrId' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             c.id != '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND c.order_no IS NOT NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test='tCorpId != null'>and c.corp_id = #{tCorpId}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test='stlStatus != null and stlStatus == "T"'>and (c.stl_amt_dr != 0 or c.stl_amt_cr != 0)</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test='stlStatus != null and stlStatus == "F"'>and c.stl_amt_dr = 0 and c.stl_amt_cr = 0</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -886,7 +888,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="mBillNo != null  and mBillNo != ''"> and c.m_bill_no like concat('%', #{mBillNo}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="carregNo != null  and carregNo != ''"> and c.carreg_no like concat('%', #{carregNo}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        GROUP BY t.id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        GROUP BY c.m_bill_no 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectTmsorderbillsCarsByBillKind" resultType="Map"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -915,6 +917,20 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	        AND c.m_bill_no = #{billKind} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectCarsFeeByMBillNo" resultType="com.ruoyi.orderPlan.domain.VehicleLedgerExcel"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            sum( CASE WHEN f.f_feeid = 61 AND f.f_dc = 'D' THEN f_amount ELSE 0 END ) shippingDr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            sum( CASE WHEN f.f_feeid != 61 AND f.f_dc = 'D' THEN f_amount ELSE 0 END ) otherDr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            sum( CASE WHEN f.f_feeid = 61 AND f.f_dc = 'C' THEN f_amount ELSE 0 END ) shippingCr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            sum( CASE WHEN f.f_feeid != 61 AND f.f_dc = 'C' THEN f_amount ELSE 0 END ) otherCr 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            F_TMSORDERBILLSCARS c 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN F_TMSORDERBILLSFEES f ON f.f_pid = c.id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_fees fee ON fee.f_id = f.f_feeid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHERE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            c.m_bill_no = #{mBillNo} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <insert id="insertftmsorderbillscars" parameterType="ftmsorderbillscars" useGeneratedKeys="true" keyProperty="id"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         insert into F_TMSORDERBILLSCARS 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <trim prefix="(" suffix=")" suffixOverrides=","> 
			 |