|
@@ -70,7 +70,7 @@
|
|
, reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId,a.custom_data as customData
|
|
, reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId,a.custom_data as customData
|
|
,u.name as projectAuditorName,u.corpwx_userid as projectAuditorCorpwxUserId, a.project_auditor_id as projectAuditorId, department.department_name as departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText,a.project_audit_time as projectAuditTime,project_main.name as projectMainName,
|
|
,u.name as projectAuditorName,u.corpwx_userid as projectAuditorCorpwxUserId, a.project_auditor_id as projectAuditorId, department.department_name as departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText,a.project_audit_time as projectAuditTime,project_main.name as projectMainName,
|
|
a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
- ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId
|
|
|
|
|
|
+ ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId,b.current_stage_name as stageName
|
|
FROM report AS a
|
|
FROM report AS a
|
|
JOIN project AS b ON a.project_id=b.id
|
|
JOIN project AS b ON a.project_id=b.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
@@ -127,7 +127,7 @@
|
|
, reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId,a.custom_data as customData
|
|
, reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId,a.custom_data as customData
|
|
,u.name as projectAuditorName,u.corpwx_userid as projectAuditorCorpwxUserId, a.project_auditor_id as projectAuditorId, department.department_name as departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText,a.project_audit_time as projectAuditTime,project_main.name as projectMainName,
|
|
,u.name as projectAuditorName,u.corpwx_userid as projectAuditorCorpwxUserId, a.project_auditor_id as projectAuditorId, department.department_name as departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText,a.project_audit_time as projectAuditTime,project_main.name as projectMainName,
|
|
GROUP_CONCAT(rlog.operator_id,'@', rlog.operate_date,'@', rlog.msg SEPARATOR '❤') AS logMsg,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3,a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
GROUP_CONCAT(rlog.operator_id,'@', rlog.operate_date,'@', rlog.msg SEPARATOR '❤') AS logMsg,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3,a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
- ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId
|
|
|
|
|
|
+ ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId,b.current_stage_name as stageName
|
|
FROM report AS a
|
|
FROM report AS a
|
|
JOIN project AS b ON a.project_id=b.id
|
|
JOIN project AS b ON a.project_id=b.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
@@ -211,7 +211,7 @@
|
|
departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText, a.project_audit_time as
|
|
departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText, a.project_audit_time as
|
|
projectAuditTime,project_main.name as projectMainName,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,
|
|
projectAuditTime,project_main.name as projectMainName,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,
|
|
DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
- ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId
|
|
|
|
|
|
+ ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId,b.current_stage_name as stageName
|
|
FROM report AS a
|
|
FROM report AS a
|
|
JOIN project AS b ON a.project_id=b.id
|
|
JOIN project AS b ON a.project_id=b.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
@@ -279,7 +279,7 @@
|
|
departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText, a.project_audit_time as
|
|
departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText, a.project_audit_time as
|
|
projectAuditTime,project_main.name as projectMainName,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub,
|
|
projectAuditTime,project_main.name as projectMainName,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub,
|
|
GROUP_CONCAT(rlog.operator_id,'@', rlog.operate_date,'@', rlog.msg SEPARATOR '❤') AS logMsg,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3
|
|
GROUP_CONCAT(rlog.operator_id,'@', rlog.operate_date,'@', rlog.msg SEPARATOR '❤') AS logMsg,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3
|
|
- , a.batch_id as batchId,a.sap_service_id as sapServiceId,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId
|
|
|
|
|
|
+ , a.batch_id as batchId,a.sap_service_id as sapServiceId,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId,project.current_stage_name as stageName
|
|
FROM report AS a
|
|
FROM report AS a
|
|
JOIN project AS b ON a.project_id=b.id
|
|
JOIN project AS b ON a.project_id=b.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
@@ -342,7 +342,7 @@
|
|
, reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
|
|
, reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
|
|
,u.name as projectAuditorName,u.corpwx_userid as projectAuditorCorpwxUserId, a.project_auditor_id as projectAuditorId, department.department_name as departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText, a.project_audit_time as projectAuditTime,project_main.name as projectMainName
|
|
,u.name as projectAuditorName,u.corpwx_userid as projectAuditorCorpwxUserId, a.project_auditor_id as projectAuditorId, department.department_name as departmentName,dp2.department_name as buDepartmentName,department.department_id as departmentId, a.overtime_hours as overtimeHours, a.custom_text as customText, a.project_audit_time as projectAuditTime,project_main.name as projectMainName
|
|
,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
,a.extra_field1 as extraField1,a.extra_field2 as extraField2,a.extra_field3 as extraField3, a.batch_id as batchId,a.sap_service_id as sapServiceId,b.status as projectStatus,DATE_FORMAT(b.finish_date,'%Y-%m-%d') as finishDate,ps.project_category_sub as projectCategorySub
|
|
- ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId
|
|
|
|
|
|
+ ,u2.name as projectManagerName,u2.corpwx_userid as projectManagerCorpwxUserId, multi_degr_id as multiDegrId,b.current_stage_name as stageName
|
|
FROM report AS a
|
|
FROM report AS a
|
|
JOIN project AS b ON a.project_id=b.id
|
|
JOIN project AS b ON a.project_id=b.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
LEFT JOIN project_separate AS ps on b.id=ps.id
|
|
@@ -966,14 +966,16 @@
|
|
)
|
|
)
|
|
</select>
|
|
</select>
|
|
<select id="getMyOvertime" resultType="java.lang.Double">
|
|
<select id="getMyOvertime" resultType="java.lang.Double">
|
|
- select IFNULL(sum(overtime_hours),0) from report where creator_id=#{userId}
|
|
|
|
|
|
+ SELECT IFNULL(SUM(overtime_hours),0) FROM report
|
|
|
|
+ LEFT JOIN report_write_off rwo ON rwo.`report_id`=report.id
|
|
|
|
+ WHERE report.creator_id=#{userId} AND (rwo.`write_off` IS NULL OR rwo.`write_off`=0)
|
|
<if test="startDate != null">
|
|
<if test="startDate != null">
|
|
and create_date >= #{startDate}
|
|
and create_date >= #{startDate}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="getProWaitingApproveCnt" resultType="java.util.HashMap">
|
|
<select id="getProWaitingApproveCnt" resultType="java.util.HashMap">
|
|
select count(1) as num, user.dingding_userid as auditorDDId ,user.corpwx_userid as corpwxUserid from report
|
|
select count(1) as num, user.dingding_userid as auditorDDId ,user.corpwx_userid as corpwxUserid from report
|
|
- left join `user` on `user`.id = project_auditor_id
|
|
|
|
|
|
+ left join `user` on `user`.id = project_auditor_id
|
|
where state = 0 and project_audit_state = 0 and is_dept_audit = 0
|
|
where state = 0 and project_audit_state = 0 and is_dept_audit = 0
|
|
and report.company_id = #{companyId}
|
|
and report.company_id = #{companyId}
|
|
and `user`.is_active=1
|
|
and `user`.is_active=1
|
|
@@ -1287,4 +1289,55 @@
|
|
GROUP BY r.create_date,r.creator_id
|
|
GROUP BY r.create_date,r.creator_id
|
|
order by u.id,r.create_date
|
|
order by u.id,r.create_date
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="getReportListWithTransfer" resultType="java.util.Map">
|
|
|
|
+ SELECT r.id AS reportId,u.`job_number` AS jobNumber,u.name AS userName,d.`department_name` AS deptName,
|
|
|
|
+ p.`project_code` AS projectCode,p.`project_name` AS projectName,date_format(r.`create_date`,'%Y-%m-%d') AS createDate,r.`working_time` AS workingTime,
|
|
|
|
+ tg.`name` AS groupName,s.`stages_name` AS stageName FROM report r
|
|
|
|
+ LEFT JOIN `user` u ON r.`creator_id`=u.`id`
|
|
|
|
+ LEFT JOIN project p ON r.`project_id`=p.`id`
|
|
|
|
+ LEFT JOIN task_group tg ON tg.`project_id`=r.`group_id`
|
|
|
|
+ LEFT JOIN stages s ON s.`project_id`=p.id AND s.`group_id`=tg.`id`
|
|
|
|
+ LEFT JOIN department d ON d.`department_id`=u.`department_id`
|
|
|
|
+ WHERE r.company_id=#{companyId}
|
|
|
|
+ <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
|
|
+ AND r.create_date BETWEEN #{startDate} AND #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="list!=null and list.size()>0">
|
|
|
|
+ AND r.creator_id in
|
|
|
|
+ <foreach collection="list" separator="," open="(" close="" item="item">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectId!=null">
|
|
|
|
+ AND p.id=#{projectId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="start!=null and size!=null">
|
|
|
|
+ limit #{start},#{size}
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getReportListWithTransferCount" resultType="java.lang.Integer">
|
|
|
|
+ select count(1) from (
|
|
|
|
+ SELECT r.id AS reportId FROM report r
|
|
|
|
+ LEFT JOIN `user` u ON r.`creator_id`=u.`id`
|
|
|
|
+ LEFT JOIN project p ON r.`project_id`=p.`id`
|
|
|
|
+ LEFT JOIN task_group tg ON tg.`project_id`=r.`group_id`
|
|
|
|
+ LEFT JOIN stages s ON s.`project_id`=p.id AND s.`group_id`=tg.`id`
|
|
|
|
+ LEFT JOIN department d ON d.`department_id`=u.`department_id`
|
|
|
|
+ WHERE r.company_id=#{companyId}
|
|
|
|
+ <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
|
|
+ AND r.create_date BETWEEN #{startDate} AND #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="list!=null and list.size()>0">
|
|
|
|
+ AND r.creator_id in
|
|
|
|
+ <foreach collection="list" separator="," open="(" close="" item="item">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectId!=null">
|
|
|
|
+ AND p.id=#{projectId}
|
|
|
|
+ </if>
|
|
|
|
+ ) as total
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|