update code
parent
aa9ad12c7d
commit
c6e886cd40
|
@ -124,6 +124,18 @@ public class ProjectAttendanceController extends BaseController {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/groupAllByComany")
|
||||
public AjaxResult groupAllByComany(@RequestBody SurProjectAttendanceData where){
|
||||
Long deptId= where.getDeptId();
|
||||
if(deptId==null || deptId<=0){
|
||||
if (SecurityUtils.isUserB()) {
|
||||
where.setPrjIds(getProjectIds());
|
||||
}
|
||||
}
|
||||
List<SurProjectAttendanceData> list=attendanceDataService.groupAllByComany(where);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 今日出勤详情
|
||||
*/
|
||||
|
|
|
@ -77,6 +77,7 @@ public interface SurProjectAttendanceDataMapper
|
|||
|
||||
public Long getLastServerId(SurProjectAttendanceData where);
|
||||
|
||||
List<SurProjectAttendanceData> groupAllByComany(SurProjectAttendanceData where);
|
||||
List<SurProjectAttendanceData> groupByComany(SurProjectAttendanceData where);
|
||||
|
||||
public Long getHuazhuPage(Long id);
|
||||
|
|
|
@ -83,4 +83,6 @@ public interface ISurProjectAttendanceDataService
|
|||
public List<SurProjectAttendanceData> groupByComany(SurProjectAttendanceData where);
|
||||
|
||||
public Long getHuazhuPage(Long id);
|
||||
|
||||
public List<SurProjectAttendanceData> groupAllByComany(SurProjectAttendanceData where);
|
||||
}
|
||||
|
|
|
@ -152,4 +152,9 @@ public class SurProjectAttendanceDataServiceImpl implements ISurProjectAttendanc
|
|||
public Long getHuazhuPage(Long id) {
|
||||
return surProjectAttendanceDataMapper.getHuazhuPage(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurProjectAttendanceData> groupAllByComany(SurProjectAttendanceData where) {
|
||||
return surProjectAttendanceDataMapper.groupAllByComany(where);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -230,6 +230,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" 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
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.state=0
|
||||
and g.companyTypeId in (1,2,3,4,5,6,8)
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="subDeptId!=null and subDeptId>0">
|
||||
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{subDeptId})
|
||||
</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>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="getHuazhuPage" parameterType="long" resultType="Long">
|
||||
select max(vendorId) vendorId from sur_project_attendance_data WHERE cfgid=#{id}
|
||||
</select>
|
||||
|
|
|
@ -306,11 +306,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and u.workerid 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}
|
||||
)
|
||||
) group by workerid
|
||||
)
|
||||
</select>
|
||||
<select id="queryAttendanceByUserIds" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) max from sur_project_attendance_data
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data
|
||||
where DATE(attendance_time)=date(#{createBy})
|
||||
<if test="workerIds !=null and workerIds.size()>0">
|
||||
and workerid in
|
||||
|
@ -327,22 +327,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and u.workerid 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}
|
||||
)
|
||||
) group by workerid
|
||||
)
|
||||
order by u.id limit #{index},#{size}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countTodayAttendance" resultType="Long" parameterType="SurProjectAttendanceUser">
|
||||
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
|
||||
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() group by workerid
|
||||
)
|
||||
<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
|
||||
|
@ -399,7 +400,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
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()
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
|
||||
)
|
||||
|
||||
<if test="id==1">
|
||||
|
@ -426,7 +427,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by u.id limit #{index},#{size}
|
||||
</select>
|
||||
<select id="todayAttendanceData" parameterType="java.util.List" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) max from sur_project_attendance_data where DATE(attendance_time)=CURDATE()
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data where DATE(attendance_time)=CURDATE()
|
||||
<if test="list !=null and list.size()>0">
|
||||
and workerid in
|
||||
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
||||
|
|
|
@ -123,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
UNION
|
||||
|
||||
SELECT 2 cost_type , SUM(money) money FROM sur_project_cost_output
|
||||
WHERE (cost_type=2 AND YEAR=#{year} )
|
||||
WHERE (cost_type=9 AND YEAR=#{year} AND MONTH <= #{month} )
|
||||
<if test="id!=null and id>0">
|
||||
and project_id IN (SELECT id FROM sur_project WHERE deptid=#{id})
|
||||
</if>
|
||||
|
|
Loading…
Reference in New Issue