提交代码
parent
72bd0e9240
commit
7660cc28cd
|
|
@ -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="craftType != null and craftType != ''"> and craft_type = #{craftType}</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="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="deviceNo != null and deviceNo != ''"> and deviceNo = #{deviceNo}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</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>
|
||||
and is_del = 0
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
|
@ -80,10 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="userId != null "> and userId = #{userId}</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="inTime != null ">
|
||||
and (date(inTime) = date(#{inTime}) or date(outTime) = date(#{inTime}))
|
||||
</if>
|
||||
<if test="outTime != null "> and date(outTime) = date(#{outTime})</if>
|
||||
<if test="inTime != null "> and date(ifNull(inTime,outTime)) = date(#{inTime})</if>
|
||||
<if test="outTime != null "> and date(ifNull(outTime,inTime)) = date(#{outTime})</if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and deviceNo = #{deviceNo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
@ -92,22 +91,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select * from (
|
||||
select ad.`userId`
|
||||
from attendance_ubi_data ad
|
||||
where
|
||||
date(ad.`inTime`)>=date(#{inTime}) and date(ad.`inTime`) < date(#{outTime})
|
||||
<where>
|
||||
<if test="projectId != null "> and ad.projectId = #{projectId}</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`
|
||||
order by ad.userId) xx
|
||||
</select>
|
||||
|
||||
<select id="queryStatisticsByUserIds" parameterType="AttendanceUbiData" resultMap="AttendanceUbiDataResult">
|
||||
<include refid="selectAttendanceUbiDataVo"/>
|
||||
where date(inTime)>=date(#{inTime}) and date(inTime) < date(#{outTime})
|
||||
<where>
|
||||
<if test="userIds!=null">
|
||||
and userId in
|
||||
<foreach item="id" collection="userIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
and date(ifNull(inTime,outTime)) <![CDATA[ >= ]]> date(#{inTime}) and date(ifNull(outTime,inTime)) <![CDATA[ < ]]> date(#{outTime})
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<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 dt comName, count(1) comId
|
||||
from (SELECT DISTINCT userid, date (ifnull(inTime, outTime)) dt from attendance_ubi_data
|
||||
where is_del!=1
|
||||
and projectid=#{prjId}
|
||||
AND (date (inTime) >= date (#{dateStart})
|
||||
or date (outTime) >= date (#{dateStart}))
|
||||
AND (date (inTime) <= date (#{dateEnd})
|
||||
or date (outTime) <= date (#{dateEnd}))
|
||||
from (SELECT DISTINCT userid, date (ifNull(inTime, outTime)) dt from attendance_ubi_data
|
||||
<where>
|
||||
<if test="prjId != null "> and projectid = #{prjId}</if>
|
||||
and is_del = 0
|
||||
and date(ifNull(inTime,outTime)) <![CDATA[ >= ]]> date(#{dateStart}) and date(ifNull(outTime,inTime)) <![CDATA[ <= ]]> date(#{dateEnd})
|
||||
</where>
|
||||
) tmp
|
||||
GROUP BY dt
|
||||
</select>
|
||||
|
||||
<select id="getRealAttendance" resultMap="AttendanceUbiDataResult">
|
||||
<include refid="selectAttendanceUbiDataVo"/>
|
||||
where
|
||||
is_del!=1
|
||||
and projectid=#{prjId}
|
||||
and date(inTime)=date(now()) or date(outTime)=date(now())
|
||||
order by ifnull(inTime,outTime) DESC
|
||||
where projectid=#{prjId} and is_del=0 and date(ifNull(inTime,outTime)) = date(CURDATE())
|
||||
order by ifNull(inTime,outTime) DESC
|
||||
LIMIT 4
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
</if>
|
||||
<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>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
|
||||
<if test="noBim != null and noBim != ''">
|
||||
left(ifnull(pp.bim_id,''),10) bim_id,
|
||||
left(ifNull(pp.bim_id,''),10) bim_id,
|
||||
</if>
|
||||
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,
|
||||
|
|
@ -360,7 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
JOIN (
|
||||
SELECT
|
||||
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
|
||||
pro_plan_schedule
|
||||
WHERE
|
||||
|
|
@ -421,7 +421,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pp.plan_finish_date,
|
||||
<choose>
|
||||
<when test="noBim = null or noBim = ''">
|
||||
left(ifnull(pp.bim_id,''),10) bim_id,
|
||||
left(ifNull(pp.bim_id,''),10) bim_id,
|
||||
</when>
|
||||
<otherwise>
|
||||
pp.bim_id,
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectProProjectInfoSubdeptsUsersByParamId" resultMap="ProProjectInfoSubdeptsUsersResult">
|
||||
<include refid="selectProProjectInfoSubdeptsUsersVo"/>
|
||||
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
|
||||
</select>
|
||||
|
||||
|
|
@ -453,7 +453,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM
|
||||
(
|
||||
SELECT
|
||||
ifnull( craft_post, 4037 ) craft_post
|
||||
ifNull( craft_post, 4037 ) craft_post
|
||||
FROM
|
||||
pro_project_info_subdepts_users
|
||||
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}
|
||||
) us
|
||||
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
|
||||
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 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
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</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>
|
||||
order by id desc LIMIT 1
|
||||
</select>
|
||||
|
|
@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</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>
|
||||
order by id desc
|
||||
</select>
|
||||
|
|
@ -344,7 +344,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="groupByComanyOld" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
|
||||
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 (
|
||||
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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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
|
||||
<where>
|
||||
<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
|
||||
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
|
||||
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
|
||||
</select>
|
||||
|
||||
|
|
@ -442,7 +442,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
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 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
|
||||
</select>
|
||||
|
||||
|
|
@ -558,7 +558,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</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 id="attendanceDataList" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
|
|
@ -575,7 +575,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</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="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
|
||||
order by ady.id desc
|
||||
</select>
|
||||
|
|
@ -591,7 +591,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deptId!=null and deptId>0">
|
||||
and sp.dis_dept_id=#{deptId}
|
||||
</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="prjIds !=null and prjIds.size()>0">
|
||||
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
|
||||
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 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
|
||||
</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
|
||||
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
|
||||
<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>
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
|
@ -651,12 +651,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="groupAttendanceLastWeek" resultMap="SurProjectAttendanceDataResult">
|
||||
SELECT dt deptName,count(1) deptId
|
||||
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
|
||||
is_del !=1
|
||||
and projectid=#{prjId}
|
||||
AND DATE( ifnull( attendance_time, attendance_out_time ) ) >= date(#{dateStart})
|
||||
AND DATE( ifnull( attendance_time, attendance_out_time ) ) <= date(#{dateEnd})
|
||||
AND DATE( ifNull( attendance_time, attendance_out_time ) ) >= date(#{dateStart})
|
||||
AND DATE( ifNull( attendance_time, attendance_out_time ) ) <= date(#{dateEnd})
|
||||
|
||||
) tmp
|
||||
group by dt
|
||||
|
|
@ -665,10 +665,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getRealAttendance" resultMap="SurProjectAttendanceDataResult">
|
||||
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 projectid=#{prjId}
|
||||
order by ifnull(attendance_time,attendance_out_time) DESC
|
||||
order by ifNull(attendance_time,attendance_out_time) DESC
|
||||
LIMIT 4
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<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}
|
||||
) ) xx
|
||||
</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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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}
|
||||
) group by workerid
|
||||
)
|
||||
</select>
|
||||
<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
|
||||
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">
|
||||
and workerid in
|
||||
<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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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}
|
||||
) 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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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">
|
||||
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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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">
|
||||
|
|
@ -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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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">
|
||||
|
|
@ -841,11 +841,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and cfg.project_id=#{projectId} ) u
|
||||
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}
|
||||
where projectid=#{projectId} and is_del!=1
|
||||
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
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<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
|
||||
</sql>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</resultMap>
|
||||
|
||||
<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
|
||||
</sql>
|
||||
|
||||
|
|
@ -49,13 +49,13 @@
|
|||
</select>
|
||||
|
||||
<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
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<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
|
||||
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
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
</select>
|
||||
|
||||
<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
|
||||
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
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
a.workParts,
|
||||
a.changeInfo,
|
||||
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.copySend,
|
||||
a.copySendUser,
|
||||
|
|
@ -423,14 +423,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
a.checkUserPhone,
|
||||
a.smark_url,
|
||||
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.createTime,
|
||||
a.updateUser,
|
||||
a.updateTime,
|
||||
a.danger_type,
|
||||
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.roleType,
|
||||
a.problemType
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</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>
|
||||
order by id desc LIMIT 1
|
||||
</select>
|
||||
|
|
@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</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>
|
||||
order by id desc
|
||||
</select>
|
||||
|
|
@ -342,7 +342,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="groupByComanyOld" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
|
||||
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 (
|
||||
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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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
|
||||
<where>
|
||||
<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
|
||||
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
|
||||
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
|
||||
</select>
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
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 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
|
||||
</select>
|
||||
|
||||
|
|
@ -476,7 +476,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</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 id="attendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
|
|
@ -493,7 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</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="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
|
||||
order by ady.id desc
|
||||
</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
|
||||
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 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
|
||||
</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
|
||||
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
|
||||
<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>
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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}
|
||||
) group by workerid
|
||||
)
|
||||
</select>
|
||||
<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
|
||||
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">
|
||||
and workerid in
|
||||
<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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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}
|
||||
) 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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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">
|
||||
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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
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">
|
||||
|
|
|
|||
Loading…
Reference in New Issue