hanwenjie 4 年之前
父節點
當前提交
42089adcb9
共有 1 個文件被更改,包括 17 次插入17 次删除
  1. 17 17
      code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckReportMapper.xml

+ 17 - 17
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckReportMapper.xml

@@ -2,10 +2,10 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="SapCheckReportMapper">
 	<select id="selectReportDayList" resultType="java.util.LinkedHashMap">
-		select * from 
+		select * from
 		(
 			SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '状态' as type, ${reportDaySql}
-			from wx_user c, sap_check_report a 
+			from wx_user c, sap_check_report a
 			where a.userId = c.userId and a.checkinDay >= #{startDate} and a.checkinDay &lt;= #{endDate}
 			<if test="name != null and name != ''">
 				and a.name like CONCAT(CONCAT('%', #{name}),'%')
@@ -16,7 +16,7 @@
 			group by c.firstDepartName,c.secondDepartName, c.userId, c.name
 			union all
 			SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '备注信息' as type, ${reportDayRemarkSql}
-			from wx_user c, sap_check_report a 
+			from wx_user c, sap_check_report a
 			where a.userId = c.userId and a.checkinDay >= #{startDate} and a.checkinDay &lt;= #{endDate}
 			<if test="name != null and name != ''">
 				and a.name like CONCAT(CONCAT('%', #{name}),'%')
@@ -28,44 +28,44 @@
 		) a
 		ORDER BY userId,type desc
 	</select>
-	
+
 	<select id="findUserReports" resultType="java.util.LinkedHashMap">
 		SELECT c.firstDepartName,c.secondDepartName,a.userId,groupName,workTime,offWorkTime,a.name,a.checkinDay,
 			realCheckinDate as checkinDate,checkinException,realCheckoffDate as checkoffDate,checkoffException,
 			checkoutDate1,checkoutDate2,realCheckinDate,realCheckoffDate,leaveCreatedTime,leaveStartDate,
 			leaveEndDate,leaveDay,leaveComment,bukaDay,workMins,workHours,realResult,realResultRemark
-		from sap_check_report a, sap_checkdate b, wx_user c 
+		from sap_check_report a, sap_checkdate b, wx_user c
 		where a.checkinDay=b.checkinDay and a.userId = c.userId
 		<if test="departId != null and departId != ''">
 			and (c.firstDepartId=#{departId} or c.secondDepartId=#{departId})
 		</if>
-		<if test="departIds != null and departIds != ''">
+		<if test="departIds != null and departIds.size() > 0">
 			and c.firstDepartId in
 			<foreach collection="departIds" item="depId" separator="," open="(" close=")">
 				#{depId}
 			</foreach>
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and a.checkinDay >= #{startDate} 
+			and a.checkinDay >= #{startDate}
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and a.checkinDay &lt;= #{endDate} 
+			and a.checkinDay &lt;= #{endDate}
 		</if>
 		<if test="name != null and name != ''">
 			and a.name like CONCAT(CONCAT('%', #{name}),'%')
 		</if>
 		<if test="state != null and state != ''">
-			and a.result = #{state} 
+			and a.result = #{state}
 		</if>
-		order by a.userId, a.checkinDay 
+		order by a.userId, a.checkinDay
 		<if test="pageCurrent != null and pageCurrent != ''">
 			limit ${pageCurrent},${pageSize}
 		</if>
 	</select>
-	
+
 	<select id="findUserReportTotal" resultType="Long">
-		SELECT count(1) 
-		from sap_check_report a, sap_checkdate b, wx_user c 
+		SELECT count(1)
+		from sap_check_report a, sap_checkdate b, wx_user c
 		where a.checkinDay=b.checkinDay and a.userId = c.userId
 		<if test="departId != null and departId != ''">
 			and (c.firstDepartId=#{departId} or c.secondDepartId=#{departId})
@@ -77,16 +77,16 @@
 			</foreach>
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and a.checkinDay >= #{startDate} 
+			and a.checkinDay >= #{startDate}
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and a.checkinDay &lt;= #{endDate} 
+			and a.checkinDay &lt;= #{endDate}
 		</if>
 		<if test="name != null and name != ''">
 			and a.name like CONCAT(CONCAT('%', #{name}),'%')
 		</if>
 		<if test="state != null and state != ''">
-			and a.result = #{state} 
+			and a.result = #{state}
 		</if>
 	</select>
-</mapper>
+</mapper>