|
@@ -2,24 +2,41 @@
|
|
|
<!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, 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 <= #{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, c.userId, c.name
|
|
|
- order by c.userId
|
|
|
+ select * from
|
|
|
+ (
|
|
|
+ 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 <= #{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, c.userId, c.name
|
|
|
+ union all
|
|
|
+ SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '备注信息', ${reportDayRemarkSql}
|
|
|
+ from wx_user c left join sap_check_report a on a.userId = c.userId
|
|
|
+ and a.checkinDay >= #{startDate} and a.checkinDay <= #{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, c.userId, c.name
|
|
|
+ order by c.userId
|
|
|
+ ) a
|
|
|
+ order by userId
|
|
|
</select>
|
|
|
|
|
|
<select id="findUserReports" resultType="java.util.LinkedHashMap">
|
|
|
SELECT c.firstDepartName,c.secondDepartName,a.userId,groupName,workTime,offWorkTime,a.name,a.checkinDay,
|
|
|
- checkinDate,checkinException,checkoffDate,checkoffException,checkoutDate1,checkoutDate2,leaveCreatedTime,
|
|
|
- leaveStartDate,leaveEndDate,leaveDay,leaveComment,bukaDay,result
|
|
|
+ checkinDate,checkinException,checkoffDate,checkoffException,checkoutDate1,checkoutDate2,
|
|
|
+ realCheckinDate,realCheckoffDate,leaveCreatedTime,leaveStartDate,leaveEndDate,leaveDay,
|
|
|
+ leaveComment,bukaDay,workMins,realResult,realResultRemark
|
|
|
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 != ''">
|