liupeng 4 years ago
parent
commit
e99de071f7

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

@@ -2,17 +2,18 @@
 <!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 c.firstDepartName,c.secondDepartName, a.userId, a.name, ${reportDaySql}
-		from sap_check_report a, wx_user c
-		where a.userId = c.userId and a.checkinDay >= #{startDate} and a.checkinDay &lt;= #{endDate}
+		SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, ${reportDaySql}
+		from wx_user c left join sap_check_report a on a.userId = c.userId 
+			and a.checkinDay >= #{startDate} and a.checkinDay &lt;= #{endDate}
+		where 1=1 
 		<if test="name != null and name != ''">
 			and a.name like CONCAT(CONCAT('%', #{name}),'%')
 		</if>
 		<if test="departId != null and departId != ''">
 			and (c.firstDepartId=#{departId} or c.secondDepartId=#{departId})
 		</if>
-		group by c.firstDepartName,c.secondDepartName, a.userId, a.name
-		order by a.userId
+		group by c.firstDepartName,c.secondDepartName, c.userId, c.name
+		order by c.userId
 	</select>
 	
 	<select id="findUserReports" resultType="java.util.LinkedHashMap">