|  | @@ -218,7 +218,7 @@
 | 
	
		
			
				|  |  |  		prr.process_instance_id as prrProcessInstanceId
 | 
	
		
			
				|  |  |  		,prr.id as prrId
 | 
	
		
			
				|  |  |  		FROM rural_project_records a
 | 
	
		
			
				|  |  | -		<include refid="projectRecordsJoins"/>
 | 
	
		
			
				|  |  | +		LEFT JOIN sys_area area ON area.id = a.area_id
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          <if test="leaderNameStr !=null and leaderNameStr !=''">
 | 
	
		
			
				|  |  |              LEFT JOIN work_project_user w on a.id = w.project_id
 | 
	
	
		
			
				|  | @@ -286,6 +286,17 @@
 | 
	
		
			
				|  |  |              <if test="endDate !=null">
 | 
	
		
			
				|  |  |                  AND a.create_date < #{endDate}
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			<if test="projectReportStatus != null and projectReportStatus != ''">
 | 
	
		
			
				|  |  | +				AND prd.status = #{projectReportStatus}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			<if test="projectReportRecordStatus != null and projectReportRecordStatus != ''">
 | 
	
		
			
				|  |  | +				AND prr.status = #{projectReportRecordStatus}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
 | 
	
		
			
				|  |  |              <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
 | 
	
		
			
				|  |  |                 AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id} )${sqlMap.dsf} )
 | 
	
	
		
			
				|  | @@ -304,6 +315,7 @@
 | 
	
		
			
				|  |  |      <select id="queryCount" resultType="int" >
 | 
	
		
			
				|  |  |          SELECT count(DISTINCT a.id)
 | 
	
		
			
				|  |  |          FROM rural_project_records a
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          <if test="leaderNameStr !=null and leaderNameStr !=''">
 | 
	
		
			
				|  |  |              LEFT JOIN work_project_user w on a.id = w.project_id
 | 
	
		
			
				|  |  |              LEFT JOIN sys_user su on w.user_id = su.id
 | 
	
	
		
			
				|  | @@ -315,6 +327,8 @@
 | 
	
		
			
				|  |  |          <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
 | 
	
		
			
				|  |  |              LEFT JOIN work_client_info wct on wci.client_id = wct.id
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  | +		left join project_report_data prd on prd.project_id = a.id
 | 
	
		
			
				|  |  | +		left join rural_project_report_record prr on prr.report_id = prd.id
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  |              a.status = 5
 | 
	
		
			
				|  |  |              <if test="projectId != null and projectId != ''">
 | 
	
	
		
			
				|  | @@ -371,6 +385,14 @@
 | 
	
		
			
				|  |  |              <if test="endDate !=null">
 | 
	
		
			
				|  |  |                  AND a.create_date < #{endDate}
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			<if test="projectReportStatus != null and projectReportStatus != ''">
 | 
	
		
			
				|  |  | +				AND prd.status = #{projectReportStatus}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			<if test="projectReportRecordStatus != null and projectReportRecordStatus != ''">
 | 
	
		
			
				|  |  | +				AND prr.status = #{projectReportRecordStatus}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  |              AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
 | 
	
		
			
				|  |  |              <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
 | 
	
		
			
				|  |  |                  AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id})${sqlMap.dsf} )
 |