提交代码

dev_xd
姜玉琦 2025-12-11 11:27:20 +08:00
parent 72bd0e9240
commit 7660cc28cd
11 changed files with 85 additions and 86 deletions

View File

@ -59,14 +59,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if> <if test="subDeptGroupName != null and subDeptGroupName != ''"> and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if> <if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if> <if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
<if test="inTime != null "> and date(inTime) = date(#{inTime})</if> <if test="inTime != null "> and date(ifNull(inTime,outTime)) = date(#{inTime})</if>
<if test="inData != null and inData != ''"> and inData = #{inData}</if> <if test="inData != null and inData != ''"> and inData = #{inData}</if>
<if test="outTime != null "> and date(outTime) = date(#{outTime})</if> <if test="outTime != null "> and date(ifNull(outTime,inTime)) = date(#{outTime})</if>
<if test="outData != null and outData != ''"> and outData = #{outData}</if> <if test="outData != null and outData != ''"> and outData = #{outData}</if>
<if test="deviceNo != null and deviceNo != ''"> and deviceNo = #{deviceNo}</if> <if test="deviceNo != null and deviceNo != ''"> and deviceNo = #{deviceNo}</if>
<if test="isDel != null "> and is_del = #{isDel}</if> <if test="isDel != null "> and is_del = #{isDel}</if>
<if test="state != null "> and state = #{state}</if> <if test="state != null "> and state = #{state}</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(create_time) between #{params.beginTime} and #{params.endTime}</if> <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(create_time) between #{params.beginTime} and #{params.endTime}</if>
and is_del = 0
</where> </where>
order by id desc order by id desc
</select> </select>
@ -80,10 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and userId = #{userId}</if> <if test="userId != null "> and userId = #{userId}</if>
<if test="admitGuid != null and admitGuid != ''"> and admitGuid = #{admitGuid}</if> <if test="admitGuid != null and admitGuid != ''"> and admitGuid = #{admitGuid}</if>
<if test="userName != null and userName != ''"> and userName like concat('%', #{userName}, '%')</if> <if test="userName != null and userName != ''"> and userName like concat('%', #{userName}, '%')</if>
<if test="inTime != null "> <if test="inTime != null "> and date(ifNull(inTime,outTime)) = date(#{inTime})</if>
and (date(inTime) = date(#{inTime}) or date(outTime) = date(#{inTime})) <if test="outTime != null "> and date(ifNull(outTime,inTime)) = date(#{outTime})</if>
</if>
<if test="outTime != null "> and date(outTime) = date(#{outTime})</if>
<if test="deviceNo != null and deviceNo != ''"> and deviceNo = #{deviceNo}</if> <if test="deviceNo != null and deviceNo != ''"> and deviceNo = #{deviceNo}</if>
</where> </where>
</select> </select>
@ -92,22 +91,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from ( select * from (
select ad.`userId` select ad.`userId`
from attendance_ubi_data ad from attendance_ubi_data ad
where <where>
date(ad.`inTime`)>=date(#{inTime}) and date(ad.`inTime`) &lt; date(#{outTime}) <if test="projectId != null "> and ad.projectId = #{projectId}</if>
<if test="projectId != null "> and ad.projectId = #{projectId}</if> <if test="subDeptId != null "> and ad.sub_dept_id = #{subDeptId}</if>
<if test="subDeptId != null "> and ad.sub_dept_id = #{subDeptId}</if> and date(ifNull(ad.`inTime`,ad.`outTime`)) <![CDATA[ >= ]]> date(#{inTime}) and date(ifNull(ad.`outTime`,ad.`inTime`)) <![CDATA[ < ]]> date(#{outTime})
</where>
group by ad.`userId` group by ad.`userId`
order by ad.userId) xx order by ad.userId) xx
</select> </select>
<select id="queryStatisticsByUserIds" parameterType="AttendanceUbiData" resultMap="AttendanceUbiDataResult"> <select id="queryStatisticsByUserIds" parameterType="AttendanceUbiData" resultMap="AttendanceUbiDataResult">
<include refid="selectAttendanceUbiDataVo"/> <include refid="selectAttendanceUbiDataVo"/>
where date(inTime)>=date(#{inTime}) and date(inTime) &lt; date(#{outTime}) <where>
<if test="userIds!=null"> <if test="userIds!=null">
and userId in and userId in
<foreach item="id" collection="userIds" open="(" separator="," close=")"> <foreach item="id" collection="userIds" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</if> </if>
and date(ifNull(inTime,outTime)) <![CDATA[ >= ]]> date(#{inTime}) and date(ifNull(outTime,inTime)) <![CDATA[ < ]]> date(#{outTime})
</where>
</select> </select>
<select id="selectAttendanceUbiDataById" parameterType="Long" resultMap="AttendanceUbiDataResult"> <select id="selectAttendanceUbiDataById" parameterType="Long" resultMap="AttendanceUbiDataResult">
@ -253,24 +256,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="groupAttendanceLastWeek" resultMap="AttendanceUbiDataResult"> <select id="groupAttendanceLastWeek" resultMap="AttendanceUbiDataResult">
SELECT dt comName, count(1) comId SELECT dt comName, count(1) comId
from (SELECT DISTINCT userid, date (ifnull(inTime, outTime)) dt from attendance_ubi_data from (SELECT DISTINCT userid, date (ifNull(inTime, outTime)) dt from attendance_ubi_data
where is_del!=1 <where>
and projectid=#{prjId} <if test="prjId != null "> and projectid = #{prjId}</if>
AND (date (inTime) &gt;= date (#{dateStart}) and is_del = 0
or date (outTime) &gt;= date (#{dateStart})) and date(ifNull(inTime,outTime)) <![CDATA[ >= ]]> date(#{dateStart}) and date(ifNull(outTime,inTime)) <![CDATA[ <= ]]> date(#{dateEnd})
AND (date (inTime) &lt;= date (#{dateEnd}) </where>
or date (outTime) &lt;= date (#{dateEnd})) ) tmp
) tmp
GROUP BY dt GROUP BY dt
</select> </select>
<select id="getRealAttendance" resultMap="AttendanceUbiDataResult"> <select id="getRealAttendance" resultMap="AttendanceUbiDataResult">
<include refid="selectAttendanceUbiDataVo"/> <include refid="selectAttendanceUbiDataVo"/>
where where projectid=#{prjId} and is_del=0 and date(ifNull(inTime,outTime)) = date(CURDATE())
is_del!=1 order by ifNull(inTime,outTime) DESC
and projectid=#{prjId}
and date(inTime)=date(now()) or date(outTime)=date(now())
order by ifnull(inTime,outTime) DESC
LIMIT 4 LIMIT 4
</select> </select>

View File

@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ( (c.is_all=1 and c.valid=0 ) or g.group_id= #{groupId}) and ( (c.is_all=1 and c.valid=0 ) or g.group_id= #{groupId})
</if> </if>
<if test="userId!=null"> <if test="userId!=null">
and ( (c.is_all=1 and c.valid=0 ) or g.group_id in (SELECT sub_dept_group from pro_project_info_subdepts_users where user_id=#{userId} order by ifnull(update_time,date('2099-12-31')) desc ,create_time desc LIMIT 1) ) and ( (c.is_all=1 and c.valid=0 ) or g.group_id in (SELECT sub_dept_group from pro_project_info_subdepts_users where user_id=#{userId} order by ifNull(update_time,date('2099-12-31')) desc ,create_time desc LIMIT 1) )
</if> </if>
</where> </where>
</select> </select>

View File

@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="noBim != null and noBim != ''"> <if test="noBim != null and noBim != ''">
left(ifnull(pp.bim_id,''),10) bim_id, left(ifNull(pp.bim_id,''),10) bim_id,
</if> </if>
pp.operator, pp.operator_id, pp.operator, pp.operator_id,
pp.group_id, pp.group_name, pp.schedule_node, pp.is_del, pp.create_by, pp.create_time, pp.update_by, pp.update_time, pp.remark, pp.group_id, pp.group_name, pp.schedule_node, pp.is_del, pp.create_by, pp.create_time, pp.update_by, pp.update_time, pp.remark,
@ -360,7 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
JOIN ( JOIN (
SELECT SELECT
plan_id, plan_id,
ifnull(max(date(finish_date)),'2000-01-01') AS finish_date ifNull(max(date(finish_date)),'2000-01-01') AS finish_date
FROM FROM
pro_plan_schedule pro_plan_schedule
WHERE WHERE
@ -421,7 +421,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pp.plan_finish_date, pp.plan_finish_date,
<choose> <choose>
<when test="noBim = null or noBim = ''"> <when test="noBim = null or noBim = ''">
left(ifnull(pp.bim_id,''),10) bim_id, left(ifNull(pp.bim_id,''),10) bim_id,
</when> </when>
<otherwise> <otherwise>
pp.bim_id, pp.bim_id,

View File

@ -165,7 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProProjectInfoSubdeptsUsersByParamId" resultMap="ProProjectInfoSubdeptsUsersResult"> <select id="selectProProjectInfoSubdeptsUsersByParamId" resultMap="ProProjectInfoSubdeptsUsersResult">
<include refid="selectProProjectInfoSubdeptsUsersVo"/> <include refid="selectProProjectInfoSubdeptsUsersVo"/>
where psu.project_id = #{proId} and psu.user_id = #{userId} where psu.project_id = #{proId} and psu.user_id = #{userId}
order by ifnull(psu.update_time, date('2099-12-31')) desc,psu.create_time desc order by ifNull(psu.update_time, date('2099-12-31')) desc,psu.create_time desc
limit 1 limit 1
</select> </select>
@ -453,7 +453,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM FROM
( (
SELECT SELECT
ifnull( craft_post, 4037 ) craft_post ifNull( craft_post, 4037 ) craft_post
FROM FROM
pro_project_info_subdepts_users pro_project_info_subdepts_users
WHERE WHERE
@ -481,10 +481,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where psu.is_del!=2 and psu.use_status=0 and psu.project_id=#{projectId} where psu.is_del!=2 and psu.use_status=0 and psu.project_id=#{projectId}
) us ) us
join ( join (
select userId,max(ifnull(inTime,outTime)) dt from attendance_ubi_data select userId,max(ifNull(inTime,outTime)) dt from attendance_ubi_data
where projectid=#{projectId} and is_del!=1 where projectid=#{projectId} and is_del!=1
group by userId group by userId
order by max(ifnull(inTime,outTime)) ) att on us.id=att.userId order by max(ifNull(inTime,outTime)) ) att on us.id=att.userId
</select> </select>
<select id="getEduCompletedCount" parameterType="Long" resultType="Long"> <select id="getEduCompletedCount" parameterType="Long" resultType="Long">
select count(1) from pro_project_info_subdepts_users where project_id=#{prjId} and edu_status='0' and is_del=0 select count(1) from pro_project_info_subdepts_users where project_id=#{prjId} and edu_status='0' and is_del=0

View File

@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cfgid != null "> and cfgid = #{cfgid}</if> <if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if> <if test="appId != null "> and app_id = #{appId}</if>
<if test="workerId != null and workerId != ''"> and workerId = #{workerId}</if> <if test="workerId != null and workerId != ''"> and workerId = #{workerId}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(attendance_time,attendance_out_time)) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(attendance_time,attendance_out_time)) = date(#{attendanceTime})</if>
</where> </where>
order by id desc LIMIT 1 order by id desc LIMIT 1
</select> </select>
@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if> <if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
<if test="isDel != null "> and is_del = #{isDel}</if> <if test="isDel != null "> and is_del = #{isDel}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(attendance_time,attendance_out_time)) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(attendance_time,attendance_out_time)) = date(#{attendanceTime})</if>
</where> </where>
order by id desc order by id desc
</select> </select>
@ -344,7 +344,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="groupByComanyOld" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult"> <select id="groupByComanyOld" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in ( select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
select min(id) from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x1 select min(id) from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x1
where date(ifnull(attendance_time,attendance_out_time))=#{attendanceTime} where date(ifNull(attendance_time,attendance_out_time))=#{attendanceTime}
<if test="subDeptId!=null and subDeptId>0"> and project_id in ( <if test="subDeptId!=null and subDeptId>0"> and project_id in (
SELECT id FROM pro_project_info WHERE is_del=0 AND deptid = #{subDeptId} SELECT id FROM pro_project_info WHERE is_del=0 AND deptid = #{subDeptId}
) )
@ -363,7 +363,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select g.companyTypeId,count(1) id from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select g.companyTypeId,count(1) id from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=CURDATE() SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=CURDATE()
and cfgid in (select id from attendance_cfg and cfgid in (select id from attendance_cfg
<where> <where>
<if test="projectId!=null and projectId>0"> <if test="projectId!=null and projectId>0">
@ -431,7 +431,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sur_project_attendance_data d from sur_project_attendance_data d
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid
where d.cfgid=#{cfgid} and date(ifnull(d.attendance_time,d.attendance_out_time)) = #{date} where d.cfgid=#{cfgid} and date(ifNull(d.attendance_time,d.attendance_out_time)) = #{date}
GROUP BY d.workerId GROUP BY d.workerId
</select> </select>
@ -442,7 +442,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sur_project_attendance_data d from sur_project_attendance_data d
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
left join sys_dept sd on u.companyName = sd.dept_name left join sys_dept sd on u.companyName = sd.dept_name
where d.cfgid=#{cfgid} and date(ifnull(d.attendance_time,d.attendance_out_time)) = #{date} where d.cfgid=#{cfgid} and date(ifNull(d.attendance_time,d.attendance_out_time)) = #{date}
GROUP BY d.workerId GROUP BY d.workerId
</select> </select>
@ -558,7 +558,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime})</if>
</select> </select>
<select id="attendanceDataList" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult"> <select id="attendanceDataList" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
@ -575,7 +575,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if> <if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if>
<if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if> <if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(ady.attendance_time,ady.attendance_out_time)) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(ady.attendance_time,ady.attendance_out_time)) = date(#{attendanceTime})</if>
and ady.is_del=0 and ady.is_del=0
order by ady.id desc order by ady.id desc
</select> </select>
@ -591,7 +591,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId!=null and deptId>0"> <if test="deptId!=null and deptId>0">
and sp.dis_dept_id=#{deptId} and sp.dis_dept_id=#{deptId}
</if> </if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull( ady.attendance_time, ady.attendance_out_time)) =date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull( ady.attendance_time, ady.attendance_out_time)) =date(#{attendanceTime})</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if> <if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0"> <if test="prjIds !=null and prjIds.size()>0">
and ady.projectId in and ady.projectId in
@ -624,7 +624,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and d.is_del=0 and d.is_del=0
and date(ifnull(d.attendance_time,d.attendance_out_time)) = date(now()) and date(ifNull(d.attendance_time,d.attendance_out_time)) = date(now())
group by d.companyTypeId group by d.companyTypeId
</select> </select>
@ -632,7 +632,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and d.is_del=0 and d.is_del=0
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime})</if>
<if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if> <if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if>
group by d.companyTypeId group by d.companyTypeId
</select> </select>
@ -651,12 +651,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="groupAttendanceLastWeek" resultMap="SurProjectAttendanceDataResult"> <select id="groupAttendanceLastWeek" resultMap="SurProjectAttendanceDataResult">
SELECT dt deptName,count(1) deptId SELECT dt deptName,count(1) deptId
from ( from (
select DISTINCT workerId, date(ifnull(attendance_time,attendance_out_time)) dt select DISTINCT workerId, date(ifNull(attendance_time,attendance_out_time)) dt
from sur_project_attendance_data_${year} where from sur_project_attendance_data_${year} where
is_del !=1 is_del !=1
and projectid=#{prjId} and projectid=#{prjId}
AND DATE( ifnull( attendance_time, attendance_out_time ) ) &gt;= date(#{dateStart}) AND DATE( ifNull( attendance_time, attendance_out_time ) ) &gt;= date(#{dateStart})
AND DATE( ifnull( attendance_time, attendance_out_time ) ) &lt;= date(#{dateEnd}) AND DATE( ifNull( attendance_time, attendance_out_time ) ) &lt;= date(#{dateEnd})
) tmp ) tmp
group by dt group by dt
@ -665,10 +665,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getRealAttendance" resultMap="SurProjectAttendanceDataResult"> <select id="getRealAttendance" resultMap="SurProjectAttendanceDataResult">
select * from sur_project_attendance_data_${year} select * from sur_project_attendance_data_${year}
where date(ifnull(attendance_time,attendance_out_time))=date(now()) where date(ifNull(attendance_time,attendance_out_time))=date(now())
and is_del!=1 and is_del!=1
and projectid=#{prjId} and projectid=#{prjId}
order by ifnull(attendance_time,attendance_out_time) DESC order by ifNull(attendance_time,attendance_out_time) DESC
LIMIT 4 LIMIT 4
</select> </select>

View File

@ -460,7 +460,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="sqlAttendanceData"> <sql id="sqlAttendanceData">
( (
SELECT * FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN ( SELECT * FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId} SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
) ) xx ) ) xx
</sql> </sql>
@ -501,14 +501,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN ( SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId} SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
) group by workerid ) group by workerid
) )
</select> </select>
<select id="queryAttendanceByUserIds" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult"> <select id="queryAttendanceByUserIds" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data
where DATE(ifnull(attendance_time,attendance_out_time))=date(#{createBy}) where DATE(ifNull(attendance_time,attendance_out_time))=date(#{createBy})
<if test="workerIds !=null and workerIds.size()>0"> <if test="workerIds !=null and workerIds.size()>0">
and workerid in and workerid in
<foreach collection="workerIds" item="item" index="index" open="(" close=")" separator=","> <foreach collection="workerIds" item="item" index="index" open="(" close=")" separator=",">
@ -522,7 +522,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN ( SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId} SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
) group by workerid ) group by workerid
) )
@ -534,7 +534,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=CURDATE() group by workerid SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=CURDATE() group by workerid
) )
<if test="id==1"> <if test="id==1">
and g.companyTypeId in (1) and g.companyTypeId in (1)
@ -566,7 +566,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=CURDATE() SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=CURDATE()
) )
<if test="id==1"> <if test="id==1">
@ -597,7 +597,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=CURDATE() group by workerid SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=CURDATE() group by workerid
) )
<if test="id==1"> <if test="id==1">
@ -841,11 +841,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and cfg.project_id=#{projectId} ) u and cfg.project_id=#{projectId} ) u
join join
( (
select workerId,max(ifnull(attendance_time,attendance_out_time)) dt select workerId,max(ifNull(attendance_time,attendance_out_time)) dt
from sur_project_attendance_data_${year} from sur_project_attendance_data_${year}
where projectid=#{projectId} and is_del!=1 where projectid=#{projectId} and is_del!=1
GROUP BY workerId GROUP BY workerId
order by max(ifnull(attendance_time,attendance_out_time)) order by max(ifNull(attendance_time,attendance_out_time))
) att on u.workerId=att.workerId ) att on u.workerId=att.workerId
</select> </select>

View File

@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDeptVo"> <sql id="selectDeptVo">
select d.dept_id, ifnull(d.com_id,d.dept_id) com_id, d.parent_id, d.ancestors, d.dept_name, d.dept_short_name, d.dept_code, d.dept_type, d.dept_infos, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time select d.dept_id, ifNull(d.com_id,d.dept_id) com_id, d.parent_id, d.ancestors, d.dept_name, d.dept_short_name, d.dept_code, d.dept_type, d.dept_infos, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d from sys_dept d
</sql> </sql>

View File

@ -28,7 +28,7 @@
</resultMap> </resultMap>
<sql id="selectMenuVo"> <sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifNull(perms,'') as perms, icon, create_time
from sys_menu from sys_menu
</sql> </sql>
@ -49,13 +49,13 @@
</select> </select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult"> <select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifNull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
order by m.parent_id, m.order_num order by m.parent_id, m.order_num
</select> </select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult"> <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifNull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id left join sys_user_role ur on rm.role_id = ur.role_id
@ -74,7 +74,7 @@
</select> </select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult"> <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifNull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id left join sys_user_role ur on rm.role_id = ur.role_id

View File

@ -408,7 +408,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.workParts, a.workParts,
a.changeInfo, a.changeInfo,
a.lordSent, a.lordSent,
CONCAT(ifnull(a.lordSentUser,a.lordSent) ,'【',ifnull(b.sub_dept_name,'施工单位'),'】',ifnull(b.user_phone,'')) as lordSentUser, CONCAT(ifNull(a.lordSentUser,a.lordSent) ,'【',ifNull(b.sub_dept_name,'施工单位'),'】',ifNull(b.user_phone,'')) as lordSentUser,
a.lordSentUser, a.lordSentUser,
a.copySend, a.copySend,
a.copySendUser, a.copySendUser,
@ -423,14 +423,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.checkUserPhone, a.checkUserPhone,
a.smark_url, a.smark_url,
a.isDel, a.isDel,
CONCAT(ifnull(c.nick_name,''),'【',ifnull(c.phonenumber,''),'】') as createUser, CONCAT(ifNull(c.nick_name,''),'【',ifNull(c.phonenumber,''),'】') as createUser,
a.createUser as updateUser, a.createUser as updateUser,
a.createTime, a.createTime,
a.updateUser, a.updateUser,
a.updateTime, a.updateTime,
a.danger_type, a.danger_type,
a.recheckSend, a.recheckSend,
CONCAT(ifnull(a.recheckSendUser,a.recheckSend) ,'【',ifnull(d.sub_dept_name,'施工单位'),'】',ifnull(d.user_phone,'')) as recheckSendUser, CONCAT(ifNull(a.recheckSendUser,a.recheckSend) ,'【',ifNull(d.sub_dept_name,'施工单位'),'】',ifNull(d.user_phone,'')) as recheckSendUser,
a.recheckSendUser, a.recheckSendUser,
a.roleType, a.roleType,
a.problemType a.problemType

View File

@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cfgid != null "> and cfgid = #{cfgid}</if> <if test="cfgid != null "> and cfgid = #{cfgid}</if>
<if test="appId != null "> and app_id = #{appId}</if> <if test="appId != null "> and app_id = #{appId}</if>
<if test="workerId != null and workerId != ''"> and workerId = #{workerId}</if> <if test="workerId != null and workerId != ''"> and workerId = #{workerId}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(attendance_time,attendance_out_time)) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(attendance_time,attendance_out_time)) = date(#{attendanceTime})</if>
</where> </where>
order by id desc LIMIT 1 order by id desc LIMIT 1
</select> </select>
@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if> <if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
<if test="isDel != null "> and is_del = #{isDel}</if> <if test="isDel != null "> and is_del = #{isDel}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and DATE( ifnull( attendance_time, attendance_out_time ) ) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and DATE( ifNull( attendance_time, attendance_out_time ) ) = date(#{attendanceTime})</if>
</where> </where>
order by id desc order by id desc
</select> </select>
@ -342,7 +342,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="groupByComanyOld" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult"> <select id="groupByComanyOld" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in ( select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
select min(id) from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x1 select min(id) from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x1
where date(ifnull(attendance_time,attendance_out_time))=#{attendanceTime} where date(ifNull(attendance_time,attendance_out_time))=#{attendanceTime}
<if test="subDeptId!=null and subDeptId>0"> and projectId in ( <if test="subDeptId!=null and subDeptId>0"> and projectId in (
SELECT id FROM pro_project_info WHERE is_del=0 AND dis_dept_id = #{subDeptId} SELECT id FROM pro_project_info WHERE is_del=0 AND dis_dept_id = #{subDeptId}
) )
@ -361,7 +361,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select g.companyTypeId,count(1) id from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select g.companyTypeId,count(1) id from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=CURDATE() SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=CURDATE()
and cfgid in (select id from attendance_cfg and cfgid in (select id from attendance_cfg
<where> <where>
<if test="projectId!=null and projectId>0"> <if test="projectId!=null and projectId>0">
@ -429,7 +429,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sur_project_attendance_data d from sur_project_attendance_data d
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid
where d.cfgid=#{cfgid} and date(ifnull(d.attendance_time,d.attendance_out_time)) = #{date} where d.cfgid=#{cfgid} and date(ifNull(d.attendance_time,d.attendance_out_time)) = #{date}
GROUP BY d.workerId GROUP BY d.workerId
</select> </select>
@ -440,7 +440,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sur_project_attendance_data d from sur_project_attendance_data d
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
left join sys_dept sd on u.companyName = sd.dept_name left join sys_dept sd on u.companyName = sd.dept_name
where d.cfgid=#{cfgid} and date(ifnull(d.attendance_time,d.attendance_out_time)) = #{date} where d.cfgid=#{cfgid} and date(ifNull(d.attendance_time,d.attendance_out_time)) = #{date}
GROUP BY d.workerId GROUP BY d.workerId
</select> </select>
@ -476,7 +476,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime})</if>
</select> </select>
<select id="attendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult"> <select id="attendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
@ -493,7 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if> <if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if>
<if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if> <if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(ady.attendance_time,ady.attendance_out_time)) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(ady.attendance_time,ady.attendance_out_time)) = date(#{attendanceTime})</if>
and ady.is_del=0 and ady.is_del=0
order by ady.id desc order by ady.id desc
</select> </select>
@ -546,7 +546,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and d.is_del=0 and d.is_del=0
and date(ifnull(d.attendance_time,d.attendance_out_time)) = date(now()) and date(ifNull(d.attendance_time,d.attendance_out_time)) = date(now())
group by d.companyTypeId group by d.companyTypeId
</select> </select>
@ -554,7 +554,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
and d.is_del=0 and d.is_del=0
<if test="attendanceTime != null and attendanceTime != ''"> and date(ifnull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and date(ifNull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime})</if>
<if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if> <if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if>
group by d.companyTypeId group by d.companyTypeId
</select> </select>

View File

@ -472,14 +472,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN ( SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{deptId} SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{deptId}
) group by workerid ) group by workerid
) )
</select> </select>
<select id="queryAttendanceByUserIds" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult"> <select id="queryAttendanceByUserIds" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data
where DATE(ifnull(attendance_time,attendance_out_time))=date(#{createBy}) where DATE(ifNull(attendance_time,attendance_out_time))=date(#{createBy})
<if test="workerIds !=null and workerIds.size()>0"> <if test="workerIds !=null and workerIds.size()>0">
and workerid in and workerid in
<foreach collection="workerIds" item="item" index="index" open="(" close=")" separator=","> <foreach collection="workerIds" item="item" index="index" open="(" close=")" separator=",">
@ -493,7 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN ( SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=date(#{createBy}) AND cfgid IN (
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId} SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
) group by workerid ) group by workerid
) )
@ -505,7 +505,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=CURDATE() group by workerid SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=CURDATE() group by workerid
) )
<if test="id==1"> <if test="id==1">
and g.companyTypeId in (1) and g.companyTypeId in (1)
@ -535,7 +535,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
and u.workerid in( and u.workerid in(
SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifnull(attendance_time,attendance_out_time))=CURDATE() group by workerid SELECT workerid FROM sur_project_attendance_data WHERE DATE(ifNull(attendance_time,attendance_out_time))=CURDATE() group by workerid
) )
<if test="id==1"> <if test="id==1">