|
@@ -74,18 +74,15 @@
|
|
|
where EXISTS (SELECT 1 from sap_checkin_option o where a.userId = o.userId)
|
|
|
order by a.userId ASC, b.checkinDay asc;
|
|
|
</insert>
|
|
|
- <update id="dropCheckReportUser">
|
|
|
- drop table if exists sap_check_report_${startDayT}_${endDayT}
|
|
|
- </update>
|
|
|
- <insert id="saveCheckReportUser">
|
|
|
- create table sap_check_report_${startDayT}_${endDayT}
|
|
|
+ <select id="selectReportDayList" resultType="Map">
|
|
|
SELECT a.userId, a.name,
|
|
|
replace(group_concat(case when a.checkinDay = '2020-05-11' then a.result else '' end ),',','') as '2020-05-11',
|
|
|
replace(group_concat(case when a.checkinDay = '2020-05-12' then a.result else '' end ),',','') as '2020-05-12',
|
|
|
replace(group_concat(case when a.checkinDay = '2020-05-13' then a.result else '' end ),',','') as '2020-05-13',
|
|
|
replace(group_concat(case when a.checkinDay = '2020-05-14' then a.result else '' end ),',','') as '2020-05-14',
|
|
|
replace(group_concat(case when a.checkinDay = '2020-05-15' then a.result else '' end ),',','') as '2020-05-15'
|
|
|
- from sap_check_report a
|
|
|
+ from sap_check_report a, sap_checkdate b
|
|
|
+ where b.weekday = 1 and a.checkinDay=b.checkinDay
|
|
|
where a.checkinDay >= #{startDay} and a.checkinDay <= #{endDay}
|
|
|
group by a.userId, a.name;
|
|
|
</insert>
|
|
@@ -145,36 +142,38 @@
|
|
|
where a.userId = b.userId and a.checkinDay = b.checkinDay order by a.exceptionType, a.checkinDate;
|
|
|
</select>
|
|
|
|
|
|
- <update id="deleteCheckin">
|
|
|
+ <update id="deleteCheckinById">
|
|
|
delete from sap_checkin where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <update id="deleteCheckoff">
|
|
|
+ <update id="deleteCheckoffById">
|
|
|
delete from sap_checkoff where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <update id="deleteCheckoutStart">
|
|
|
+ <update id="deleteCheckoutStartById">
|
|
|
delete from sap_checkout_start where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <update id="deleteCheckoutEnd">
|
|
|
+ <update id="deleteCheckoutEndById">
|
|
|
delete from sap_checkout_end where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<select id="findUserReports" resultType="Map">
|
|
|
- SELECT a.* from sap_check_report a where 1=1
|
|
|
+ SELECT a.*,c.firstDepartName,c.secondDepartName
|
|
|
+ from sap_check_report a, sap_checkdate b, wx_user c
|
|
|
+ where b.weekday = 1 and a.checkinDay=b.checkinDay and a.userId = c.userId
|
|
|
<if test="departId != null and departId != ''">
|
|
|
- and (firstDepartId=#{departId} or secondDepartId=#{departId})
|
|
|
+ and (a.firstDepartId=#{departId} or a.secondDepartId=#{departId})
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- and checkinDay >= #{startDate}
|
|
|
+ and a.checkinDay >= #{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
- and checkinDay <= #{endDate}
|
|
|
+ and a.checkinDay <= #{endDate}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and name like CONCAT(CONCAT('%', #{name}),'%')
|
|
|
+ and a.name like CONCAT(CONCAT('%', #{name}),'%')
|
|
|
</if>
|
|
|
- order by userId, checkinDay
|
|
|
+ order by a.userId, a.checkinDay
|
|
|
</select>
|
|
|
</mapper>
|