liupeng 4 years ago
parent
commit
53406aa8bc

+ 1 - 0
code/sapparent/sapservice/src/main/java/org/fouram/.gitignore

@@ -0,0 +1 @@
+/service/

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

@@ -4,7 +4,7 @@
 	<select id="selectReportDayList" resultType="java.util.LinkedHashMap">
 		select * from 
 		(
-			SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '状态', ${reportDaySql}
+			SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '状态' as type, ${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 
@@ -16,7 +16,7 @@
 			</if>
 			group by c.firstDepartName,c.secondDepartName, c.userId, c.name
 			union all
-			SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '备注信息', ${reportDayRemarkSql}
+			SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '备注信息' as type, ${reportDayRemarkSql}
 			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 
@@ -27,9 +27,8 @@
 				and (c.firstDepartId=#{departId} or c.secondDepartId=#{departId})
 			</if>
 			group by c.firstDepartName,c.secondDepartName, c.userId, c.name
-			order by c.userId
 		) a
-		order by userId
+		ORDER BY userId,type desc
 	</select>
 	
 	<select id="findUserReports" resultType="java.util.LinkedHashMap">