|
@@ -972,6 +972,12 @@
|
|
<if test="projectId != null">
|
|
<if test="projectId != null">
|
|
and project.id = #{projectId}
|
|
and project.id = #{projectId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="list!=null and list.size()>0">
|
|
|
|
+ and project.id in
|
|
|
|
+ <foreach collection="list" open="(" close=")" item="item" separator=",">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
<if test="pageStart != null and pageSize != null">
|
|
<if test="pageStart != null and pageSize != null">
|
|
LIMIT #{pageStart},#{pageSize}
|
|
LIMIT #{pageStart},#{pageSize}
|
|
</if>
|
|
</if>
|
|
@@ -1780,7 +1786,7 @@
|
|
|
|
|
|
<select id="userProjectProcessList" resultType="java.util.Map">
|
|
<select id="userProjectProcessList" resultType="java.util.Map">
|
|
select d.department_name as departmentName,d.corpwx_deptid as corpwxDeptId,u.corpwx_userid as corpwxUserId,u.name as userName,u.job_number as jobNumber,p.project_name as projectName,p.project_code as projectCode,
|
|
select d.department_name as departmentName,d.corpwx_deptid as corpwxDeptId,u.corpwx_userid as corpwxUserId,u.name as userName,u.job_number as jobNumber,p.project_name as projectName,p.project_code as projectCode,
|
|
- IFNULL(IFNULL(SUM(te.plan_hours),0)-IFNULL((select SUM(working_time) from report where task_id=te.task_id),0),0)as residueTime
|
|
|
|
|
|
+ IFNULL(IFNULL(SUM(te.plan_hours),0)-IFNULL((select SUM(working_time) from report where task_id=te.task_id and state=1),0),0)as residueTime
|
|
from task_executor te
|
|
from task_executor te
|
|
left join user u on u.id=te.executor_id
|
|
left join user u on u.id=te.executor_id
|
|
left join department d on d.department_id=u.department_id
|
|
left join department d on d.department_id=u.department_id
|
|
@@ -1838,18 +1844,18 @@
|
|
|
|
|
|
<select id="groupExpendProcessList" resultType="java.util.Map">
|
|
<select id="groupExpendProcessList" resultType="java.util.Map">
|
|
select d.department_name,d.corpwx_deptid as corpwxDeptId,tg.name as groupName,IFNULL(SUM(te.plan_hours),0) as planHour,
|
|
select d.department_name,d.corpwx_deptid as corpwxDeptId,tg.name as groupName,IFNULL(SUM(te.plan_hours),0) as planHour,
|
|
- IFNULL(IFNULL((select SUM(working_time) from report where task_id=te.task_id <if test="startDate!=null and endDate!=null">
|
|
|
|
|
|
+ IFNULL(IFNULL((select SUM(working_time) from report where group_id=tg.id and state=1 <if test="startDate!=null and endDate!=null">
|
|
and create_date between #{startDate} and #{endDate}
|
|
and create_date between #{startDate} and #{endDate}
|
|
- </if> ),0)-IFNULL((select SUM(overtime_hours) from report where task_id=te.task_id <if test="startDate!=null and endDate!=null">
|
|
|
|
|
|
+ </if> ),0)-IFNULL((select SUM(overtime_hours) from report where group_id=tg.id and state=1 <if test="startDate!=null and endDate!=null">
|
|
and create_date between #{startDate} and #{endDate}
|
|
and create_date between #{startDate} and #{endDate}
|
|
</if>),0),0) as normalHour,
|
|
</if>),0),0) as normalHour,
|
|
- IFNULL((select SUM(overtime_hours) from report where task_id=te.task_id <if test="startDate!=null and endDate!=null">
|
|
|
|
|
|
+ IFNULL((select SUM(overtime_hours) from report where group_id=tg.id and state=1 <if test="startDate!=null and endDate!=null">
|
|
and create_date between #{startDate} and #{endDate}
|
|
and create_date between #{startDate} and #{endDate}
|
|
</if>),0) as overHour,
|
|
</if>),0) as overHour,
|
|
- IFNULL((select SUM(working_time) from report where task_id=te.task_id <if test="startDate!=null and endDate!=null">
|
|
|
|
|
|
+ IFNULL((select SUM(working_time) from report where group_id=tg.id and state=1 <if test="startDate!=null and endDate!=null">
|
|
and create_date between #{startDate} and #{endDate}
|
|
and create_date between #{startDate} and #{endDate}
|
|
</if>),0) as realHour,
|
|
</if>),0) as realHour,
|
|
- IFNULL((select SUM(cost) from report where task_id=te.task_id <if test="startDate!=null and endDate!=null">
|
|
|
|
|
|
+ IFNULL((select SUM(cost) from report where group_id=tg.id and state=1 <if test="startDate!=null and endDate!=null">
|
|
and create_date between #{startDate} and #{endDate}
|
|
and create_date between #{startDate} and #{endDate}
|
|
</if>),0) as realCost
|
|
</if>),0) as realCost
|
|
from task_executor te
|
|
from task_executor te
|
|
@@ -1898,9 +1904,9 @@
|
|
|
|
|
|
<select id="projectExpendProcessList" resultType="java.util.Map">
|
|
<select id="projectExpendProcessList" resultType="java.util.Map">
|
|
select p.project_name as projectName,pc.name as categoryName,p.project_code as projectCode,IFNULL(SUM(te.plan_hours),0) as planHour,
|
|
select p.project_name as projectName,pc.name as categoryName,p.project_code as projectCode,IFNULL(SUM(te.plan_hours),0) as planHour,
|
|
- IFNULL((select SUM(working_time) from report where project_id=p.id),0) as realHour, IFNULL((select SUM(cost) from report where project_id=p.id),0) as realCost,
|
|
|
|
- IFNULL(IFNULL(SUM(te.plan_hours),0)-IFNULL((select SUM(working_time) from report where project_id=p.id),0),0) as residueHour,
|
|
|
|
- GROUP_CONCAT(CONCAT_WS('|',te.executor_name,IFNULL((select SUM(working_time) from report where creator_id=te.executor_id and project_id=p.id),0))) as executorString
|
|
|
|
|
|
+ IFNULL((select SUM(working_time) from report where project_id=p.id and state=1),0) as realHour, IFNULL((select SUM(cost) from report where project_id=p.id and state=1),0) as realCost,
|
|
|
|
+ IFNULL(IFNULL(SUM(te.plan_hours),0)-IFNULL((select SUM(working_time) from report where project_id=p.id and state=1),0),0) as residueHour,
|
|
|
|
+ GROUP_CONCAT(CONCAT_WS('|',te.executor_name,IFNULL((select SUM(working_time) from report where creator_id=te.executor_id and project_id=p.id and state=1),0))) as executorString
|
|
from task_executor te
|
|
from task_executor te
|
|
left join user u on u.id=te.executor_id
|
|
left join user u on u.id=te.executor_id
|
|
left join department d on u.department_id=d.department_id
|
|
left join department d on u.department_id=d.department_id
|
|
@@ -1931,11 +1937,7 @@
|
|
|
|
|
|
<select id="projectExpendProcessListCount" resultType="java.lang.Long">
|
|
<select id="projectExpendProcessListCount" resultType="java.lang.Long">
|
|
select count(1) from (
|
|
select count(1) from (
|
|
- select p.project_name as projectName,pc.name as categoryName,p.project_code as projectCode,IFNULL(SUM(te.plan_hours),0) as planHour,
|
|
|
|
- IFNULL((select SUM(working_time) from report where task_id=te.task_id),0) as realHour,
|
|
|
|
- IFNULL((select SUM(cost) from report where task_id=te.task_id),0) as realCost,
|
|
|
|
- IFNULL(IFNULL(SUM(te.plan_hours),0)-IFNULL((select SUM(working_time) from report where task_id=te.task_id),0),0) as residueHour,
|
|
|
|
- GROUP_CONCAT(CONCAT_WS('|',te.executor_name,CONCAT_WS('',FORMAT(IFNULL(IFNULL((select SUM(working_time) from report where creator_id=te.executor_id and task_id=t.id),0)/(IFNULL((select SUM(working_time) from report where task_id=te.task_id),0)),0)*100,2),'%'))) as executorString
|
|
|
|
|
|
+ select p.project_name as projectName
|
|
from task_executor te
|
|
from task_executor te
|
|
left join user u on u.id=te.executor_id
|
|
left join user u on u.id=te.executor_id
|
|
left join department d on u.department_id=d.department_id
|
|
left join department d on u.department_id=d.department_id
|
|
@@ -1964,7 +1966,7 @@
|
|
|
|
|
|
<select id="userTaskProcessList" resultType="java.util.Map">
|
|
<select id="userTaskProcessList" resultType="java.util.Map">
|
|
select d.department_name as departmentName,d.corpwx_deptid as corpwxDeptId,u.corpwx_userid as corpwxUserId,t.name as taskName,IFNULL(t.plan_hours,0) as planHour,u.name as userName,u.job_number as jobNumber,p.project_name as projectName,p.project_code as projectCode,
|
|
select d.department_name as departmentName,d.corpwx_deptid as corpwxDeptId,u.corpwx_userid as corpwxUserId,t.name as taskName,IFNULL(t.plan_hours,0) as planHour,u.name as userName,u.job_number as jobNumber,p.project_name as projectName,p.project_code as projectCode,
|
|
- IFNULL((select SUM(working_time) from report where task_id=te.task_id),0)as consumeTime
|
|
|
|
|
|
+ IFNULL((select SUM(working_time) from report where task_id=te.task_id and state=1),0)as consumeTime
|
|
from task_executor te
|
|
from task_executor te
|
|
left join user u on u.id=te.executor_id
|
|
left join user u on u.id=te.executor_id
|
|
left join department d on d.department_id=u.department_id
|
|
left join department d on d.department_id=u.department_id
|
|
@@ -1998,8 +2000,7 @@
|
|
|
|
|
|
<select id="userTaskProcessListCount" resultType="java.lang.Long">
|
|
<select id="userTaskProcessListCount" resultType="java.lang.Long">
|
|
select count(1) from (
|
|
select count(1) from (
|
|
- select d.department_name as departmentName,d.corpwx_deptid as corpwxDeptId,u.corpwx_userid as corpwxUserId,t.name as taskName,IFNULL(t.plan_hours,0) as planHour,u.name as userName,u.job_number as jobNumber,p.project_name as projectName,p.project_code as projectCode,
|
|
|
|
- IFNULL((select SUM(working_time) from report where task_id=te.task_id),0)as consumeTime
|
|
|
|
|
|
+ select d.department_name as departmentName
|
|
from task_executor te
|
|
from task_executor te
|
|
left join user u on u.id=te.executor_id
|
|
left join user u on u.id=te.executor_id
|
|
left join department d on d.department_id=u.department_id
|
|
left join department d on d.department_id=u.department_id
|