| 
					
				 | 
			
			
				@@ -18,6 +18,40 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         su.name as "user.name" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <sql id="reimbursementColumns"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        create_by, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        create_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        update_by, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        update_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        remarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        del_flag, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        parent_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        parent_ids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        invoice_code, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        invoice_number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        firm_name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        make_time, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        money, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tax, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        income, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        business_code, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        gathering_time, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        proposer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        partner, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        business_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        reimbursement_ratio, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        gathering_status, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        reimbursement_status, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        batch_flag, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        year, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        random_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        random_business_code_index, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        reimbursement_batch, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sort 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <sql id="reimbursementBusinessColumns"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         a.id AS "id", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		a.create_by AS "createBy.id", 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -253,12 +287,42 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ,zri.business_code as "businessCode" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM zs_reimbursement_business_info a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <include refid="reimbursementUserJoinColumns"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        left join zs_reimbursement_info zri on zri.id = a.business_code_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        left join (select <include refid="reimbursementColumns"/> from zs_reimbursement_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    UNION all 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    select <include refid="reimbursementColumns"/> from zs_wuhan_reimbursement_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    UNION all 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_accountant_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    UNION all 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_project_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    UNION all 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_assess_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ) zri on zri.id = a.business_code_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             a.del_flag = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and a.user_id = #{userId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and a.year = #{year} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            and a.reimbursement_address = #{reimbursementAddress} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="reimbursementAddress != null and reimbursementAddress != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.reimbursement_address = #{reimbursementAddress} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="reimbursementFsalary != null and reimbursementFsalary != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.reimbursement_fsalary = #{reimbursementFsalary} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="beginReimbursementQuota != null and beginReimbursementQuota != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.reimbursement_amount >= #{beginReimbursementQuota} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="endReimbursementQuota != null and endReimbursementQuota != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.reimbursement_amount <= #{endReimbursementQuota} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="beginDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.create_date >= #{beginDate} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="endDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.create_date <= #{endDate} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="officeType != null and officeType != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and a.office_type = #{officeType} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         order by a.update_date desc,a.year desc, a.user_id asc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 |