update code

dev_xds
haha 2024-01-25 22:51:56 +08:00
parent b6a04edec9
commit 85b8ed616a
4 changed files with 24 additions and 6 deletions

View File

@ -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) 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)

View File

@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * FROM select * FROM
( (
select a.*,b.project_id,b.sub_dept_id,c.companyTypeId 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 where a.cfgid=b.id and a.companyId=c.companyId
) )
sur_project_attendance_data sur_project_attendance_data

View File

@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectSurProjectAttendanceGroupVo"> <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 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> </sql>
<select id="selectSurProjectAttendanceGroupViewList" parameterType="SurProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult"> <select id="selectSurProjectAttendanceGroupViewList" parameterType="SurProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">

View File

@ -300,7 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) oo ) oo
</select> </select>
<select id="countTodayAttendance" resultType="Long" parameterType="SurProjectAttendanceUser"> <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 where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
<if test="id==1"> <if test="id==1">
and g.companyTypeId =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 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 (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 ( 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 where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
<if test="id==1"> <if test="id==1">
and g.companyTypeId =1 and g.companyTypeId in (1,6)
</if> </if>
<if test="id==2"> <if test="id==2">
and g.companyTypeId in (2,3) and g.companyTypeId in (2,3,4,5)
</if> </if>
<if test="id==8"> <if test="id==8">
and g.companyTypeId =8 and g.companyTypeId =8