update code
parent
b6a04edec9
commit
85b8ed616a
|
@ -389,3 +389,21 @@ SELECT * FROM sur_project_attendance_group WHERE id IN (
|
|||
SELECT MIN(id) FROM sur_project_attendance_group GROUP BY companyId,companyTypeId)
|
||||
|
||||
|
||||
|
||||
|
||||
create view view_sur_project_attendance_group
|
||||
as
|
||||
select * from vw_sur_project_attendance_group where cfgid not in (select id from sur_project_attendance_cfg where is_del=0 and vendors_code='huazhu')
|
||||
union
|
||||
SELECT id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, 1 companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
FROM vw_sur_project_attendance_group where cfgid in (select id from sur_project_attendance_cfg where is_del=0 and vendors_code='huazhu')
|
||||
and companyName in (select unitName from sur_project_unit_info where unittype=2)
|
||||
union
|
||||
SELECT id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, 8 companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
FROM vw_sur_project_attendance_group where cfgid in (select id from sur_project_attendance_cfg where is_del=0 and vendors_code='huazhu')
|
||||
and companyName in (select unitName from sur_project_unit_info where unittype=4)
|
||||
union
|
||||
SELECT id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, 2 companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
FROM vw_sur_project_attendance_group where cfgid in (select id from sur_project_attendance_cfg where is_del=0 and vendors_code='huazhu')
|
||||
and companyName not in (select unitName from sur_project_unit_info where unittype=4 or unittype=2)
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select * FROM
|
||||
(
|
||||
select a.*,b.project_id,b.sub_dept_id,c.companyTypeId
|
||||
from sur_project_attendance_data a,sur_project_attendance_cfg b,vw_sur_project_attendance_group c
|
||||
from sur_project_attendance_data a,sur_project_attendance_cfg b,view_sur_project_attendance_group c
|
||||
where a.cfgid=b.id and a.companyId=c.companyId
|
||||
)
|
||||
sur_project_attendance_data
|
||||
|
|
|
@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectSurProjectAttendanceGroupVo">
|
||||
select id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
from vw_sur_project_attendance_group
|
||||
from view_sur_project_attendance_group
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectAttendanceGroupViewList" parameterType="SurProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">
|
||||
|
|
|
@ -300,7 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
) oo
|
||||
</select>
|
||||
<select id="countTodayAttendance" resultType="Long" parameterType="SurProjectAttendanceUser">
|
||||
select count(1) cnt from sur_project_attendance_user u, sur_project_attendance_cfg c,vw_sur_project_attendance_group g
|
||||
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
|
||||
<if test="id==1">
|
||||
and g.companyTypeId =1
|
||||
|
@ -329,13 +329,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
(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,vw_sur_project_attendance_group g
|
||||
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
|
||||
<if test="id==1">
|
||||
and g.companyTypeId =1
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (2,3)
|
||||
and g.companyTypeId in (2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
|
|
Loading…
Reference in New Issue