|
@@ -463,6 +463,37 @@
|
|
|
ORDER BY a.creator_id ASC
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 根据抄送人id,日期获取相关项目的全部报告信息 -->
|
|
|
+ <select id="getCcReportByDate" resultType="java.util.Map">
|
|
|
+ SELECT a.id, a.project_id as projectId, b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType,
|
|
|
+ a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
|
|
|
+ a.end_time as endTime, b.incharger_id as inchargerId,
|
|
|
+ a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
|
|
|
+ a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
|
|
|
+ , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
|
|
|
+ department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
|
|
|
+ ,u.name as projectAuditorName, a.project_auditor_id as projectAuditorId, a.overtime_hours as overtimeHours, a.custom_text as customText, dept_manager.name as deptAuditorName,a.evaluate as evaluate
|
|
|
+ FROM report AS a
|
|
|
+ JOIN project AS b ON a.project_id=b.id
|
|
|
+ left join project_auditor on project_auditor.project_id = a.project_id
|
|
|
+ left join sub_project as d on d.id = a.sub_project_id
|
|
|
+ left join task on task.id = a.task_id
|
|
|
+ left join report_extra_degree on report_extra_degree.id = a.degree_id
|
|
|
+ left join department on department.department_id = a.audit_deptid
|
|
|
+ left join user dept_manager on dept_manager.id = a.audit_dept_managerid
|
|
|
+ left join task_group on task_group.id = a.group_id
|
|
|
+ left join user u on u.id = a.project_auditor_id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="date != null and date != ''">
|
|
|
+ AND a.create_date=#{date}
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ AND a.state=#{state}
|
|
|
+ </if>
|
|
|
+ AND (project_auditor.auditor_id = #{id})
|
|
|
+ ORDER BY a.creator_id ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
<!--新版获取待审核的列表,一次性获取全部 -->
|
|
|
<select id="getAuditReportList" resultType="java.util.Map">
|
|
|
SELECT a.id, user.id as userId,user.corpwx_userid as corpwxUserid, user.name, DATE_FORMAT(a.create_date, '%Y-%m-%d') as date, a.project_id as projectId, b.project_code AS projectCode, b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType,
|
|
@@ -593,6 +624,24 @@
|
|
|
group by a.creator_id
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getCcReportNameByDate" resultType="java.util.Map">
|
|
|
+ SELECT DISTINCT b.id, b.name, IF (MAX(state) = 1, MIN(state), MAX(state)) AS state, a.department_audit_state as departmentAuditState, IFNULL(sum(a.working_time),0) as workingTime,a.evaluate as evaluate
|
|
|
+ FROM report AS a
|
|
|
+ JOIN user AS b ON a.creator_id=b.id
|
|
|
+ LEFT JOIN project_auditor ON a.project_id = project_auditor.project_id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="date != null and date != ''">
|
|
|
+ AND a.create_date=#{date}
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null and companyId != ''">
|
|
|
+ AND b.company_id=#{companyId}
|
|
|
+ </if>
|
|
|
+ <if test="leaderId != null and leaderId != ''">
|
|
|
+ AND project_auditor.`auditor_id` = #{leaderId}
|
|
|
+ </if>
|
|
|
+ group by a.creator_id
|
|
|
+ </select>
|
|
|
+
|
|
|
<!--根据日期,部门,指定人员获取报告上传人-->
|
|
|
<select id="getReportNameByDateAndDept" resultType="java.util.Map">
|
|
|
SELECT DISTINCT b.id, b.name ,a.evaluate as evaluate
|