Commit 8f7a1efc authored by 廖旭伟's avatar 廖旭伟

考勤汇总查询增加条件

parent be4cf8b8
......@@ -11,6 +11,8 @@
s.deptId,
s.deptName,
s.phoneNumer,
s.salaId,
s.salaName,
count(1) as workDays,
ROUND(IFNULL(sum(s.goTimes),0)/count(1),4) as attendanceRate,
sum(s.goTimes) AS goTimes,
......@@ -54,6 +56,7 @@
<if test="staffName != null and staffName!=''"> AND s.staffName like #{staffName}</if>
<if test="phoneNumer != null and phoneNumer!=''"> AND s.phoneNumer like #{phoneNumer}</if>
<if test="deptId != null and deptId!=''"> AND s.deptId = #{deptId}</if>
<if test="salaId != null and salaId!=''"> AND s.salaId = #{salaId}</if>
<if test="idList != null and idList.size>0">
and s.id in
<foreach collection="idList" open="(" close=")" index="index" item="item" separator=",">
......@@ -78,6 +81,8 @@
s.deptId,
s.deptName,
s.phoneNumer,
s.salaId,
s.salaName,
ROUND(IFNULL(sum(s.goTimes),0)/count(1),4) as attendanceRate,
sum(s.goTimes) AS goTimes,
sum(s.morningTimes) AS morningTimes,
......@@ -120,6 +125,13 @@
<if test="staffName != null and staffName!=''"> AND s.staffName like #{staffName}</if>
<if test="phoneNumer != null and phoneNumer!=''"> AND s.phoneNumer like #{phoneNumer}</if>
<if test="deptId != null and deptId!=''"> AND s.deptId = #{deptId}</if>
<if test="salaId != null and salaId!=''"> AND s.salaId = #{salaId}</if>
<if test="idList != null and idList.size>0">
and s.id in
<foreach collection="idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
GROUP BY
s.staffId,
s.staffName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment