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