处理考勤系统
parent
ef1f1ff326
commit
8f8d4dbb08
|
@ -98,7 +98,6 @@ public interface IQuartzProjectAttendanceDataService
|
||||||
|
|
||||||
public List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where);
|
public List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where);
|
||||||
|
|
||||||
public List<Map<String,Object>> initOtherData(Map<String,Object> data);
|
|
||||||
|
|
||||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
|
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
|
||||||
|
|
||||||
|
|
|
@ -304,26 +304,6 @@ public class QuartzProjectAttendanceDataServiceImpl implements IQuartzProjectAtt
|
||||||
return quartzProjectAttendanceDataMapper.groupAllByComany(where);
|
return quartzProjectAttendanceDataMapper.groupAllByComany(where);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map<String,Object>> initOtherData(Map<String,Object> data) {
|
|
||||||
List<Map<String,Object>> dataList = new ArrayList<>();
|
|
||||||
List<Map<String,Object>> list = quartzProjectAttendanceDataMapper.initOtherData(data);
|
|
||||||
if(StringUtils.isNotEmpty(list)){
|
|
||||||
List<String> workerIds = list.stream().map(Map -> Map.get("workerId").toString()).collect(Collectors.toList());
|
|
||||||
data.put("list",workerIds);
|
|
||||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceOtherData(data);
|
|
||||||
for (Map<String,Object> map:list) {
|
|
||||||
for(QuartzProjectAttendanceUser sau:datas){
|
|
||||||
if(Objects.equals(map.get("workerId").toString(),sau.getWorkerId())){
|
|
||||||
map.put("inTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getInTime()));
|
|
||||||
map.put("outTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getOutTime()));
|
|
||||||
dataList.add(map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return dataList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data) {
|
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.yanzhu.job.mapper.QuartzProjectAttendanceCfgMapper">
|
<mapper namespace="com.yanzhu.job.mapper.QuartzProjectAttendanceCfgMapper">
|
||||||
|
|
||||||
<resultMap type="AttendanceCfg" id="AttendanceCfgResult">
|
<resultMap type="QuartzProjectAttendanceCfg" id="AttendanceCfgResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="comId" column="com_id" />
|
<result property="comId" column="com_id" />
|
||||||
<result property="projectId" column="project_id" />
|
<result property="projectId" column="project_id" />
|
||||||
|
|
|
@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<where>
|
<where>
|
||||||
<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="projectId != null ">and cfgid in (select id from sur_project_attendance_cfg where projectId = #{projectId})</if>
|
<if test="projectId != null ">and cfgid in (select id from attendance_cfg where projectId = #{projectId})</if>
|
||||||
<if test="deptId != null "> and deptId = #{deptId}</if>
|
<if test="deptId != null "> and deptId = #{deptId}</if>
|
||||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||||
|
@ -343,32 +343,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
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(attendance_time)=#{attendanceTime}
|
where date(attendance_time)=#{attendanceTime}
|
||||||
<if test="subDeptId!=null and subDeptId>0"> and project_id in (
|
<if test="subDeptId!=null and subDeptId>0"> and projectId in (
|
||||||
SELECT id FROM sur_project WHERE isdel=0 AND deptid = #{subDeptId}
|
SELECT id FROM pro_project_info WHERE is_del=0 AND dis_dept_id = #{subDeptId}
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="prjIds !=null and prjIds.size()>0">
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
and project_id in
|
and projectId in
|
||||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="projectId!=null and projectId>0"> and project_id=#{projectId}</if>
|
<if test="projectId!=null and projectId>0"> and projectId=#{projectId}</if>
|
||||||
group by workerId )
|
group by workerId )
|
||||||
and companyTypeId in (1,2,3,4,5,6,8) group by companyTypeId
|
and companyTypeId in (1,2,3,4,5,6,8) group by companyTypeId
|
||||||
</select>
|
</select>
|
||||||
<select id="groupByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
<select id="groupByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||||
select g.companyTypeId,count(1) id from sur_project_attendance_user u, sur_project_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(attendance_time)=CURDATE()
|
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE()
|
||||||
and cfgid in (select id from sur_project_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">
|
||||||
and project_id=#{projectId}
|
and project_id=#{projectId}
|
||||||
</if>
|
</if>
|
||||||
<if test="subDeptId!=null and subDeptId>0">
|
<if test="subDeptId!=null and subDeptId>0">
|
||||||
and project_id in (SELECT id FROM sur_project WHERE deptid=#{subDeptId})
|
and project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{subDeptId})
|
||||||
</if>
|
</if>
|
||||||
<if test="prjIds !=null and prjIds.size()>0">
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
and project_id in
|
and project_id in
|
||||||
|
@ -385,7 +385,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and c.project_id=#{projectId}
|
and c.project_id=#{projectId}
|
||||||
</if>
|
</if>
|
||||||
<if test="subDeptId!=null and subDeptId>0">
|
<if test="subDeptId!=null and subDeptId>0">
|
||||||
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{subDeptId})
|
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{subDeptId})
|
||||||
</if>
|
</if>
|
||||||
<if test="prjIds !=null and prjIds.size()>0">
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
and c.project_id in
|
and c.project_id in
|
||||||
|
@ -398,18 +398,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="groupAllByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
<select id="groupAllByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||||
select g.companyTypeId,count(1) id
|
select g.companyTypeId,count(1) id
|
||||||
from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g,
|
from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g,
|
||||||
sur_project sp
|
pro_project_info sp
|
||||||
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id
|
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id
|
||||||
and sp.isDel=0
|
and sp.is_Del=0
|
||||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||||
<if test="projectId!=null and projectId>0">
|
<if test="projectId!=null and projectId>0">
|
||||||
and c.project_id=#{projectId}
|
and c.project_id=#{projectId}
|
||||||
</if>
|
</if>
|
||||||
<if test="subDeptId!=null and subDeptId>0">
|
<if test="subDeptId!=null and subDeptId>0">
|
||||||
and sp.deptId=#{subDeptId}
|
and sp.dis_dept_id=#{subDeptId}
|
||||||
</if>
|
</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 c.project_id in
|
and c.project_id in
|
||||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
@ -436,7 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="initHuaZhuData" parameterType="map" resultType="map">
|
<select id="initHuaZhuData" parameterType="map" resultType="map">
|
||||||
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||||
u.workTypeName,u.specWorkType,u.groupName,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del,
|
u.workTypeName,u.specWorkType,u.groupName,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del,
|
||||||
CASE WHEN sd.type_flag = 2 THEN '1' WHEN sd.type_flag = 3 THEN '2' WHEN sd.type_flag = 4 THEN '8' else '0' end as companyTypeId
|
CASE WHEN sd.dept_type = 2 THEN '1' WHEN sd.dept_type = 3 THEN '2' WHEN sd.dept_type = 4 THEN '8' else '0' end as companyTypeId
|
||||||
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
|
||||||
|
@ -453,7 +452,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="todayAttendance" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
<select id="todayAttendance" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||||
select ady.* from sur_project_attendance_data_${year} ady
|
select ady.* from sur_project_attendance_data_${year} ady
|
||||||
left join sur_project sp on sp.id = ady.projectId
|
left join sur_project sp on sp.id = ady.projectId
|
||||||
where sp.isDel=0
|
where sp.is_Del=0
|
||||||
<if test="projectId!=null and projectId>0">
|
<if test="projectId!=null and projectId>0">
|
||||||
and ady.projectId=#{projectId}
|
and ady.projectId=#{projectId}
|
||||||
</if>
|
</if>
|
||||||
|
@ -467,9 +466,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and ady.companyTypeId =8
|
and ady.companyTypeId =8
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId!=null and deptId>0">
|
<if test="deptId!=null and deptId>0">
|
||||||
and sp.deptId=#{deptId}
|
and sp.dis_dept_id=#{deptId}
|
||||||
</if>
|
</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
|
||||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
@ -481,7 +479,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="attendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
<select id="attendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||||
select ady.* from sur_project_attendance_data_${year} ady
|
select ady.* from sur_project_attendance_data_${year} ady
|
||||||
where ady.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
where ady.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||||
<if test="companyTypeId==101">
|
<if test="companyTypeId==101">
|
||||||
and ady.companyTypeId in (1,6)
|
and ady.companyTypeId in (1,6)
|
||||||
</if>
|
</if>
|
||||||
|
@ -500,7 +498,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="groupTodayCompanyTypeId" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
<select id="groupTodayCompanyTypeId" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||||
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
|
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
|
||||||
where ady.cfgid in (select id from sur_project_attendance_cfg where
|
where ady.cfgid in (select id from attendance_cfg where
|
||||||
is_del=0
|
is_del=0
|
||||||
<if test="projectId!=null and projectId>0">
|
<if test="projectId!=null and projectId>0">
|
||||||
and projectId=#{projectId}
|
and projectId=#{projectId}
|
||||||
|
@ -530,7 +528,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select '1' as type,g.companyTypeId,count(1) as total
|
select '1' as type,g.companyTypeId,count(1) as total
|
||||||
from sur_project_attendance_user u
|
from sur_project_attendance_user u
|
||||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||||
and u.state=0
|
and u.state=0
|
||||||
group by g.companyTypeId
|
group by g.companyTypeId
|
||||||
|
@ -538,13 +536,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select '2' as type,g.companyTypeId,count(1) as total
|
select '2' as type,g.companyTypeId,count(1) as total
|
||||||
from sur_project_attendance_user u
|
from sur_project_attendance_user u
|
||||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||||
and u.state=1
|
and u.state=1
|
||||||
group by g.companyTypeId
|
group by g.companyTypeId
|
||||||
UNION ALL
|
UNION ALL
|
||||||
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 sur_project_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(d.attendance_time) = date(now())
|
and date(d.attendance_time) = date(now())
|
||||||
group by d.companyTypeId
|
group by d.companyTypeId
|
||||||
|
@ -552,7 +550,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="groupDataByParams" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
<select id="groupDataByParams" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||||
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 sur_project_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(d.attendance_time) = date(#{attendanceTime})</if>
|
<if test="attendanceTime != null and attendanceTime != ''"> and date(d.attendance_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>
|
||||||
|
@ -562,7 +560,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="findGroupAllByDays" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
<select id="findGroupAllByDays" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||||
select '3' as type, DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
select '3' as type, DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
||||||
select date(d.attendance_time) as attendanceTime, DATE_FORMAT(d.attendance_time, '%m-%d'),count(1) as total from sur_project_attendance_data_${year} d
|
select date(d.attendance_time) as attendanceTime, DATE_FORMAT(d.attendance_time, '%m-%d'),count(1) as total from sur_project_attendance_data_${year} d
|
||||||
where d.cfgid in (select cfg.id from sur_project_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(d.attendance_time) between #{attendanceTime} and #{attendanceOutTime}
|
and date(d.attendance_time) between #{attendanceTime} and #{attendanceOutTime}
|
||||||
group by date(d.attendance_time)
|
group by date(d.attendance_time)
|
||||||
|
|
|
@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="type != null "> and type = #{type}</if>
|
<if test="type != null "> and type = #{type}</if>
|
||||||
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
||||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||||
<if test="createTime != null "> and createTime = #{createTime}</if>
|
<if test="createTime != null "> and create_Time = #{createTime}</if>
|
||||||
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
||||||
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
||||||
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
||||||
|
@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="type != null "> and type = #{type}</if>
|
<if test="type != null "> and type = #{type}</if>
|
||||||
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
||||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||||
<if test="createTime != null "> and createTime = #{createTime}</if>
|
<if test="createTime != null "> and create_Time = #{createTime}</if>
|
||||||
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
||||||
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
||||||
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
||||||
|
|
|
@ -52,8 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<sql id="selectSurProjectAttendanceUserVo">
|
<sql id="selectSurProjectAttendanceUserVo">
|
||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
SELECT a.*,b.project_id,b.sub_dept_id
|
SELECT a.*,b.project_id,b.dept_id
|
||||||
FROM sur_project_attendance_user a,sur_project_attendance_cfg b
|
FROM sur_project_attendance_user a,attendance_cfg b
|
||||||
WHERE a.cfgid=b.id )
|
WHERE a.cfgid=b.id )
|
||||||
sur_project_attendance_user
|
sur_project_attendance_user
|
||||||
</sql>
|
</sql>
|
||||||
|
@ -63,8 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||||
c.project_id,c.sub_dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark
|
c.project_id,c.dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark
|
||||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg c,sur_project_attendance_group g
|
FROM sur_project_attendance_user u,attendance_cfg c,sur_project_attendance_group g
|
||||||
WHERE u.cfgid=c.id AND g.companyid=u.companyid AND u.vendors_code='jgw'
|
WHERE u.cfgid=c.id AND g.companyid=u.companyid AND u.vendors_code='jgw'
|
||||||
<if test="companyTypeId!=null">
|
<if test="companyTypeId!=null">
|
||||||
<if test="companyTypeId>100">
|
<if test="companyTypeId>100">
|
||||||
|
@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="enterType != null and enterType != ''"> and u.enterType = #{enterType}</if>
|
<if test="enterType != null and enterType != ''"> and u.enterType = #{enterType}</if>
|
||||||
<if test="other != null and other != ''"> and u.other = #{other}</if>
|
<if test="other != null and other != ''"> and u.other = #{other}</if>
|
||||||
<if test="projectId != null and projectId > 0 "> and c.project_id = #{projectId}</if>
|
<if test="projectId != null and projectId > 0 "> and c.project_id = #{projectId}</if>
|
||||||
<if test="subDeptId != null and subDeptId >0 "> and c.sub_dept_id = #{subDeptId}</if>
|
<if test="subDeptId != null and subDeptId >0 "> and c.dept_id = #{subDeptId}</if>
|
||||||
<if test="isDel != null "> and u.is_del = #{isDel}</if>
|
<if test="isDel != null "> and u.is_del = #{isDel}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -160,8 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
a.create_by,
|
a.create_by,
|
||||||
a.create_time,
|
a.create_time,
|
||||||
a.update_by,
|
a.update_by,
|
||||||
a.update_time,b.project_id,b.sub_dept_id,g.companyTypeId,g.companyName as remark
|
a.update_time,b.project_id,b.dept_id,g.companyTypeId,g.companyName as remark
|
||||||
FROM sur_project_attendance_user a,sur_project_attendance_cfg b,view_sur_project_attendance_group g
|
FROM sur_project_attendance_user a,attendance_cfg b,view_sur_project_attendance_group g
|
||||||
WHERE a.cfgid=b.id and a.companyId=g.companyId and g.id in(select min(id) from view_sur_project_attendance_group group by companyid)
|
WHERE a.cfgid=b.id and a.companyId=g.companyId and g.id in(select min(id) from view_sur_project_attendance_group group by companyid)
|
||||||
)
|
)
|
||||||
sur_project_attendance_user
|
sur_project_attendance_user
|
||||||
|
@ -216,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
||||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||||
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
||||||
<if test="subDeptId != null and subDeptId >0 "> and sub_dept_id = #{subDeptId}</if>
|
<if test="subDeptId != null and subDeptId >0 "> and dept_id = #{subDeptId}</if>
|
||||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
@ -273,7 +273,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
||||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||||
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
||||||
<if test="subDeptId != null and subDeptId >0 "> and sub_dept_id = #{subDeptId}</if>
|
<if test="subDeptId != null and subDeptId >0 "> and dept_id = #{subDeptId}</if>
|
||||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
@ -455,51 +455,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<sql id="sqlAttendanceData">
|
<select id="countAttendance" resultType="Long" parameterType="QuartzProjectAttendanceCfg">
|
||||||
(
|
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
|
||||||
SELECT * FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
|
||||||
SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
|
|
||||||
) ) xx
|
|
||||||
</sql>
|
|
||||||
<select id="queryAttendanceData" parameterType="SurProjectAttendanceCfg" resultMap="SurProjectAttendanceUserResult">
|
|
||||||
select * from (
|
|
||||||
select n.*,m.inTime,m.outTime from (
|
|
||||||
|
|
||||||
SELECT * FROM (
|
|
||||||
SELECT workerId,attendance_time inTime,null outtime FROM sur_project_attendance_data WHERE id IN (
|
|
||||||
SELECT min(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )) X WHERE workerId NOT IN (
|
|
||||||
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId
|
|
||||||
)
|
|
||||||
|
|
||||||
union
|
|
||||||
|
|
||||||
select * from (
|
|
||||||
select workerId,null inTime,attendance_time outTime from sur_project_attendance_data where id in (
|
|
||||||
select max(id) id from <include refid="sqlAttendanceData"/> where attendance_type='l' group by workerId )) x where workerId not in (
|
|
||||||
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId
|
|
||||||
)
|
|
||||||
|
|
||||||
union
|
|
||||||
|
|
||||||
select x.workerId,y.attendance_time inTime,x.attendance_time outTime from (
|
|
||||||
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
|
|
||||||
SELECT MAX(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId )
|
|
||||||
) x cross join (
|
|
||||||
|
|
||||||
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
|
|
||||||
SELECT MIN(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )
|
|
||||||
) y on x.workerId=y.workerId
|
|
||||||
|
|
||||||
) m left join sur_project_attendance_user n on m.workerId=n.workerId
|
|
||||||
) oo
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="countAttendance" resultType="Long" parameterType="SurProjectAttendanceCfg">
|
|
||||||
select count(1) cnt from sur_project_attendance_user u, sur_project_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(attendance_time)=date(#{createBy}) AND cfgid IN (
|
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
||||||
SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{deptId}
|
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{deptId}
|
||||||
) group by workerid
|
) group by workerid
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
@ -516,11 +477,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
<select id="queryAttendanceUsers" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
<select id="queryAttendanceUsers" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||||
|
|
||||||
select u.* from sur_project_attendance_user u, sur_project_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(attendance_time)=date(#{createBy}) AND cfgid IN (
|
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
||||||
SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
|
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
|
||||||
) group by workerid
|
) group by workerid
|
||||||
)
|
)
|
||||||
order by u.id limit #{index},#{size}
|
order by u.id limit #{index},#{size}
|
||||||
|
@ -528,7 +489,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
|
|
||||||
<select id="countTodayAttendance" resultType="Long" parameterType="QuartzProjectAttendanceUser">
|
<select id="countTodayAttendance" resultType="Long" parameterType="QuartzProjectAttendanceUser">
|
||||||
select count(1) cnt from sur_project_attendance_user u, sur_project_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(attendance_time)=CURDATE() group by workerid
|
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
|
||||||
|
@ -555,43 +516,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="todayAttendanceOld" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
|
||||||
select a.* ,
|
|
||||||
(select min(attendance_time) from sur_project_attendance_data b where b.workerId=a.workerId and date(b.attendance_time)=CURDATE() and b.attendance_type='e') inTime,
|
|
||||||
(SELECT Max(attendance_time) FROM sur_project_attendance_data b WHERE b.workerId=a.workerId AND DATE(b.attendance_time)=CURDATE() AND b.attendance_type='l') outTime
|
|
||||||
from (
|
|
||||||
select u.* from sur_project_attendance_user u, sur_project_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(attendance_time)=CURDATE()
|
|
||||||
)
|
|
||||||
|
|
||||||
<if test="id==1">
|
|
||||||
and g.companyTypeId in (1,6)
|
|
||||||
</if>
|
|
||||||
<if test="id==2">
|
|
||||||
and g.companyTypeId in (0,2,3,4,5)
|
|
||||||
</if>
|
|
||||||
<if test="id==8">
|
|
||||||
and g.companyTypeId =8
|
|
||||||
</if>
|
|
||||||
<if test="projectId!=null and projectId>0">
|
|
||||||
and c.project_id=#{projectId}
|
|
||||||
</if>
|
|
||||||
<if test="deptId!=null and deptId>0">
|
|
||||||
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
|
||||||
</if>
|
|
||||||
<if test="prjIds !=null and prjIds.size()>0">
|
|
||||||
and c.project_id in
|
|
||||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
order by u.id limit #{index},#{size} ) a
|
|
||||||
</select>
|
|
||||||
<select id="todayAttendance" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
<select id="todayAttendance" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||||
|
|
||||||
select u.* from sur_project_attendance_user u, sur_project_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(attendance_time)=CURDATE() group by workerid
|
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
|
||||||
|
@ -648,10 +576,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
u.companyName,u.workTypeName,u.groupName,
|
||||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
|
b.project_id,b.dept_id, g.teamname remark,g.companyName degreeName
|
||||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
|
||||||
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
|
||||||
<if test="id==101">
|
<if test="id==101">
|
||||||
and g.companyTypeId in (1,6)
|
and g.companyTypeId in (1,6)
|
||||||
</if>
|
</if>
|
||||||
|
@ -665,9 +593,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and b.project_id=#{projectId}
|
and b.project_id=#{projectId}
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId!=null and deptId>0">
|
<if test="deptId!=null and deptId>0">
|
||||||
and sp.deptId=#{deptId}
|
and sp.dis_dept_id=#{deptId}
|
||||||
</if>
|
</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 b.project_id in
|
and b.project_id in
|
||||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
@ -682,10 +610,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
u.companyName,u.workTypeName,u.groupName,
|
||||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName,g.companyTypeId
|
b.project_id,b.dept_id, g.teamname remark,g.companyName degreeName,g.companyTypeId
|
||||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
|
||||||
WHERE u.cfgid=b.id and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
WHERE u.cfgid=b.id and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
|
||||||
<if test="companyTypeId==101">
|
<if test="companyTypeId==101">
|
||||||
and g.companyTypeId in (1,6)
|
and g.companyTypeId in (1,6)
|
||||||
</if>
|
</if>
|
||||||
|
@ -705,13 +633,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="groupByWorkerOnDutyByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
<select id="groupByWorkerOnDutyByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||||
SELECT p.id, p.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
SELECT p.id, p.project_name NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
||||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project p,sys_dept c
|
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info p,sys_dept c
|
||||||
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.sub_dept_id
|
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.dept_id
|
||||||
and p.isDel=0
|
and p.is_Del=0
|
||||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||||
<if test="deptId!=null and deptId>0">
|
<if test="deptId!=null and deptId>0">
|
||||||
and p.deptId=#{deptId}
|
and p.dis_dept_id=#{deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
|
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
|
||||||
<if test="prjIds !=null and prjIds.size()>0">
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
|
@ -720,7 +648,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
group by p.projectName,c.dept_name,g.companyTypeId,p.id
|
group by p.project_Name,c.dept_name,g.companyTypeId,p.id
|
||||||
order by p.id
|
order by p.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -728,7 +656,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select '1' as type,g.companyTypeId,count(1) as total
|
select '1' as type,g.companyTypeId,count(1) as total
|
||||||
from sur_project_attendance_user u
|
from sur_project_attendance_user u
|
||||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||||
and u.state=0
|
and u.state=0
|
||||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||||
|
@ -737,7 +665,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select '2' as type,g.companyTypeId,count(1) as total
|
select '2' as type,g.companyTypeId,count(1) as total
|
||||||
from sur_project_attendance_user u
|
from sur_project_attendance_user u
|
||||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||||
and u.state=1
|
and u.state=1
|
||||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||||
|
@ -748,29 +676,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select '1' as type,g.companyTypeId,count(1) as total
|
select '1' as type,g.companyTypeId,count(1) as total
|
||||||
from sur_project_attendance_user u
|
from sur_project_attendance_user u
|
||||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||||
and u.state=0
|
and u.state=0
|
||||||
group by g.companyTypeId
|
group by g.companyTypeId
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="groupByWorkerByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
<select id="groupByWorkerByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||||
SELECT p.id, p.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
SELECT p.id, p.project_Name NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
||||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project p,sys_dept c
|
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info p,sys_dept c
|
||||||
where u.cfgid=b.id and u.state= #{state} and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.sub_dept_id
|
where u.cfgid=b.id and u.state= #{state} and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.dept_id
|
||||||
and p.isDel=0
|
and p.is_Del=0
|
||||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||||
<if test="deptId!=null and deptId>0">
|
<if test="deptId!=null and deptId>0">
|
||||||
and p.deptId=#{deptId}
|
and p.dis_dept_id=#{deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
|
|
||||||
<if test="prjIds !=null and prjIds.size()>0">
|
<if test="prjIds !=null and prjIds.size()>0">
|
||||||
and b.project_id in
|
and b.project_id in
|
||||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
group by p.projectName,c.dept_name,g.companyTypeId,p.id
|
group by p.project_Name,c.dept_name,g.companyTypeId,p.id
|
||||||
order by p.id
|
order by p.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -780,10 +707,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
u.companyName,u.workTypeName,u.groupName,
|
||||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
|
b.project_id,b.dept_id, g.teamname remark,g.companyName degreeName
|
||||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
|
||||||
WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
|
||||||
<if test="id==101">
|
<if test="id==101">
|
||||||
and g.companyTypeId in (1,6)
|
and g.companyTypeId in (1,6)
|
||||||
</if>
|
</if>
|
||||||
|
@ -797,9 +724,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and b.project_id=#{projectId}
|
and b.project_id=#{projectId}
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId!=null and deptId>0">
|
<if test="deptId!=null and deptId>0">
|
||||||
and sp.deptId=#{deptId}
|
and sp.dis_dept_id=#{deptId}
|
||||||
</if>
|
</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 b.project_id in
|
and b.project_id in
|
||||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
|
Loading…
Reference in New Issue