diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml index 74a74936..d50c880d 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDataMapper.xml @@ -59,14 +59,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%') and craft_type = #{craftType} and craft_post = #{craftPost} - and date(inTime) = date(#{inTime}) + and date(ifNull(inTime,outTime)) = date(#{inTime}) and inData = #{inData} - and date(outTime) = date(#{outTime}) + and date(ifNull(outTime,inTime)) = date(#{outTime}) and outData = #{outData} and deviceNo = #{deviceNo} and is_del = #{isDel} and state = #{state} and date(create_time) between #{params.beginTime} and #{params.endTime} + and is_del = 0 order by id desc @@ -80,10 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and userId = #{userId} and admitGuid = #{admitGuid} and userName like concat('%', #{userName}, '%') - - and (date(inTime) = date(#{inTime}) or date(outTime) = date(#{inTime})) - - and date(outTime) = date(#{outTime}) + and date(ifNull(inTime,outTime)) = date(#{inTime}) + and date(ifNull(outTime,inTime)) = date(#{outTime}) and deviceNo = #{deviceNo} @@ -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}) - and ad.projectId = #{projectId} - and ad.sub_dept_id = #{subDeptId} + + and ad.projectId = #{projectId} + and ad.sub_dept_id = #{subDeptId} + and date(ifNull(ad.`inTime`,ad.`outTime`)) = ]]> date(#{inTime}) and date(ifNull(ad.`outTime`,ad.`inTime`)) date(#{outTime}) + group by ad.`userId` order by ad.userId) xx + 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})) - ) tmp + from (SELECT DISTINCT userid, date (ifNull(inTime, outTime)) dt from attendance_ubi_data + + and projectid = #{prjId} + and is_del = 0 + and date(ifNull(inTime,outTime)) = ]]> date(#{dateStart}) and date(ifNull(outTime,inTime)) date(#{dateEnd}) + + ) tmp GROUP BY dt diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProMobileAttendanceConfigMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProMobileAttendanceConfigMapper.xml index 0610d8dc..4249dc33 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProMobileAttendanceConfigMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProMobileAttendanceConfigMapper.xml @@ -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 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) ) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml index e48b9d7d..3a0d0954 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProPlanMapper.xml @@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - left(ifnull(pp.bim_id,''),10) bim_id, + left(ifNull(pp.bim_id,''),10) bim_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, @@ -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, - left(ifnull(pp.bim_id,''),10) bim_id, + left(ifNull(pp.bim_id,''),10) bim_id, pp.bim_id, diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml index b33646ae..0b0e4123 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml @@ -165,7 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -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 @@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and scanPhoto = #{scanPhoto} and is_del = #{isDel} - and date(ifnull(attendance_time,attendance_out_time)) = date(#{attendanceTime}) + and date(ifNull(attendance_time,attendance_out_time)) = date(#{attendanceTime}) order by id desc @@ -344,7 +344,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -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 @@ -558,7 +558,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item} - and date(ifnull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime}) + and date(ifNull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime}) @@ -591,7 +591,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sp.dis_dept_id=#{deptId} - and date(ifnull( ady.attendance_time, ady.attendance_out_time)) =date(#{attendanceTime}) + and date(ifNull( ady.attendance_time, ady.attendance_out_time)) =date(#{attendanceTime}) and sp.projectType = #{proType} 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 @@ -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 - and date(ifnull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime}) + and date(ifNull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime}) and d.workerName like concat('%', #{workerName}, '%') group by d.companyTypeId @@ -651,12 +651,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml index 1f0d1acd..da4c8c47 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceUserMapper.xml @@ -460,7 +460,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ( - 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 @@ -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 ) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysDeptMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysDeptMapper.xml index 89bcf9a6..8ccea5be 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysDeptMapper.xml @@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysMenuMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysMenuMapper.xml index 2d67ff9b..53b4de3d 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysMenuMapper.xml @@ -28,7 +28,7 @@ - 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 @@ -49,13 +49,13 @@ @@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and scanPhoto = #{scanPhoto} and is_del = #{isDel} - and DATE( ifnull( attendance_time, attendance_out_time ) ) = date(#{attendanceTime}) + and DATE( ifNull( attendance_time, attendance_out_time ) ) = date(#{attendanceTime}) order by id desc @@ -342,7 +342,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -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 @@ -476,7 +476,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item} - and date(ifnull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime}) + and date(ifNull(ady.attendance_time,ady.attendance_out_time)) =date(#{attendanceTime}) @@ -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 @@ -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 - and date(ifnull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime}) + and date(ifNull(d.attendance_time,d.attendance_out_time)) = date(#{attendanceTime}) and d.workerName like concat('%', #{workerName}, '%') group by d.companyTypeId diff --git a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml index b6149fbb..cd449c6a 100644 --- a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml +++ b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml @@ -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 )