|
@@ -38,15 +38,14 @@
|
|
<result column="project_audit_state" property="projectAuditState" />
|
|
<result column="project_audit_state" property="projectAuditState" />
|
|
<result column="group_id" property="groupId" />
|
|
<result column="group_id" property="groupId" />
|
|
<result column="custom_data" property="customData" />
|
|
<result column="custom_data" property="customData" />
|
|
|
|
+ <result column="project_auditor_id" property="projectAuditorId" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
<sql id="Base_Column_List">
|
|
- id, creator_id, project_id, create_date, working_time, content, state, create_time, time_type, cost, start_time, end_time, report_time_type, sub_project_id, task_id, is_overtime, progress, department_audit_state, stage, pic_str, multi_worktime, reject_reason, reject_username, reject_userid, degree_id, company_id, fill_userid, audit_deptid, is_dept_audit, audit_dept_managerid, is_final_audit, project_audit_state, group_id, custom_data
|
|
|
|
|
|
+ id, creator_id, project_id, create_date, working_time, content, state, create_time, time_type, cost, start_time, end_time, report_time_type, sub_project_id, task_id, is_overtime, progress, department_audit_state, stage, pic_str, multi_worktime, reject_reason, reject_username, reject_userid, degree_id, company_id, fill_userid, audit_deptid, is_dept_audit, audit_dept_managerid, is_final_audit, project_audit_state, group_id, custom_data, project_auditor_id
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
<!--根据日期获取全部报告信息-->
|
|
<!--根据日期获取全部报告信息-->
|
|
<select id="getAllReportByDate" resultType="java.util.Map">
|
|
<select id="getAllReportByDate" resultType="java.util.Map">
|
|
SELECT c.name, b.project_name AS project, a.working_time AS duration, a.content, a.create_time AS time, a.create_date as createDate,
|
|
SELECT c.name, b.project_name AS project, a.working_time AS duration, a.content, a.create_time AS time, a.create_date as createDate,
|
|
@@ -54,6 +53,7 @@
|
|
a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
|
|
a.end_time as endTime, 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.pic_str as picStr, multi_worktime as multiWorktime
|
|
a.department_audit_state as departmentAuditState, 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,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, a.project_auditor_id as projectAuditorId
|
|
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 user AS c ON a.creator_id=c.id
|
|
LEFT JOIN user AS c ON a.creator_id=c.id
|
|
@@ -61,6 +61,7 @@
|
|
left join task on task.id = a.task_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 report_extra_degree on report_extra_degree.id = a.degree_id
|
|
left join task_group on task_group.id = a.group_id
|
|
left join task_group on task_group.id = a.group_id
|
|
|
|
+ left join user u on u.id = a.project_auditor_id
|
|
WHERE a.state = 1
|
|
WHERE a.state = 1
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
@@ -83,6 +84,7 @@
|
|
a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
|
|
a.end_time as endTime, 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.pic_str as picStr, multi_worktime as multiWorktime
|
|
a.department_audit_state as departmentAuditState, 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,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, a.project_auditor_id as projectAuditorId
|
|
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 user AS c ON a.creator_id=c.id
|
|
LEFT JOIN user AS c ON a.creator_id=c.id
|
|
@@ -90,6 +92,7 @@
|
|
left join task on task.id = a.task_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 report_extra_degree on report_extra_degree.id = a.degree_id
|
|
left join task_group on task_group.id = a.group_id
|
|
left join task_group on task_group.id = a.group_id
|
|
|
|
+ left join user u on u.id = a.project_auditor_id
|
|
WHERE a.state = 1
|
|
WHERE a.state = 1
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
@@ -109,6 +112,7 @@
|
|
a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
|
|
a.end_time as endTime, 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.pic_str as picStr, multi_worktime as multiWorktime
|
|
a.department_audit_state as departmentAuditState, 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,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, a.project_auditor_id as projectAuditorId
|
|
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 user AS c ON a.creator_id=c.id
|
|
LEFT JOIN user AS c ON a.creator_id=c.id
|
|
@@ -116,6 +120,7 @@
|
|
left join task on task.id = a.task_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 report_extra_degree on report_extra_degree.id = a.degree_id
|
|
left join task_group on task_group.id = a.group_id
|
|
left join task_group on task_group.id = a.group_id
|
|
|
|
+ left join user u on u.id = a.project_auditor_id
|
|
WHERE a.state = 1
|
|
WHERE a.state = 1
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
@@ -135,6 +140,7 @@
|
|
a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
|
|
a.end_time as endTime, 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.pic_str as picStr, multi_worktime as multiWorktime
|
|
a.department_audit_state as departmentAuditState, 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,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, a.project_auditor_id as projectAuditorId
|
|
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 user AS c ON a.creator_id=c.id
|
|
LEFT JOIN user AS c ON a.creator_id=c.id
|
|
@@ -142,6 +148,7 @@
|
|
left join task on task.id = a.task_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 report_extra_degree on report_extra_degree.id = a.degree_id
|
|
left join task_group on task_group.id = a.group_id
|
|
left join task_group on task_group.id = a.group_id
|
|
|
|
+ left join user u on u.id = a.project_auditor_id
|
|
WHERE a.state = 1
|
|
WHERE a.state = 1
|
|
<if test="startDate != null and startDate != ''">
|
|
<if test="startDate != null and startDate != ''">
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
AND a.create_date between #{startDate} and #{endDate}
|
|
@@ -168,6 +175,7 @@
|
|
a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
|
|
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,
|
|
, 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
|
|
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
|
|
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 sub_project as d on d.id = a.sub_project_id
|
|
left join sub_project as d on d.id = a.sub_project_id
|
|
@@ -175,6 +183,7 @@
|
|
left join report_extra_degree on report_extra_degree.id = a.degree_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 department on department.department_id = a.audit_deptid
|
|
left join task_group on task_group.id = a.group_id
|
|
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
|
|
WHERE 1=1
|
|
<if test="date != null and date != ''">
|
|
<if test="date != null and date != ''">
|
|
AND a.create_date=#{date}
|
|
AND a.create_date=#{date}
|
|
@@ -192,6 +201,7 @@
|
|
a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
|
|
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,
|
|
, 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
|
|
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
|
|
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 sub_project as d on d.id = a.sub_project_id
|
|
left join sub_project as d on d.id = a.sub_project_id
|
|
@@ -199,6 +209,7 @@
|
|
left join report_extra_degree on report_extra_degree.id = a.degree_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 department on department.department_id = a.audit_deptid
|
|
left join task_group on task_group.id = a.group_id
|
|
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
|
|
WHERE 1=1
|
|
<if test="date != null and date != ''">
|
|
<if test="date != null and date != ''">
|
|
AND a.create_date=#{date}
|
|
AND a.create_date=#{date}
|
|
@@ -219,6 +230,7 @@
|
|
a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
|
|
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,
|
|
, 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
|
|
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
|
|
FROM report AS a
|
|
FROM report AS a
|
|
left join user on user.id = a.creator_id
|
|
left join user on user.id = a.creator_id
|
|
JOIN project AS b ON a.project_id=b.id
|
|
JOIN project AS b ON a.project_id=b.id
|
|
@@ -227,6 +239,7 @@
|
|
left join report_extra_degree on report_extra_degree.id = a.degree_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 department on department.department_id = a.audit_deptid
|
|
left join task_group on task_group.id = a.group_id
|
|
left join task_group on task_group.id = a.group_id
|
|
|
|
+ left join user u on u.id = a.project_auditor_id
|
|
WHERE a.company_id = #{companyId}
|
|
WHERE a.company_id = #{companyId}
|
|
and a.state = 0
|
|
and a.state = 0
|
|
<if test="date != null and date != ''">
|
|
<if test="date != null and date != ''">
|
|
@@ -244,9 +257,9 @@
|
|
<if test="projectId != null">
|
|
<if test="projectId != null">
|
|
AND a.project_id=#{projectId}
|
|
AND a.project_id=#{projectId}
|
|
</if>
|
|
</if>
|
|
- <if test="inchargerId != null">
|
|
|
|
- AND ((a.is_dept_audit = 0 and b.incharger_id = #{inchargerId} and a.project_audit_state = 0)
|
|
|
|
- or (a.is_dept_audit = 1 and a.audit_dept_managerid = #{inchargerId}))
|
|
|
|
|
|
+ <if test="auditorId != null">
|
|
|
|
+ AND ((a.is_dept_audit = 0 and a.project_auditor_id = #{auditorId} and a.project_audit_state = 0)
|
|
|
|
+ or (a.is_dept_audit = 1 and a.audit_dept_managerid = #{auditorId}))
|
|
</if>
|
|
</if>
|
|
<if test="isEngeering == 1">
|
|
<if test="isEngeering == 1">
|
|
AND a.department_audit_state = 1
|
|
AND a.department_audit_state = 1
|
|
@@ -269,6 +282,7 @@
|
|
left join task on task.id = a.task_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 report_extra_degree on report_extra_degree.id = a.degree_id
|
|
left join task_group on task_group.id = a.group_id
|
|
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
|
|
WHERE 1=1
|
|
<if test="date != null and date != ''">
|
|
<if test="date != null and date != ''">
|
|
AND a.create_date=#{date}
|
|
AND a.create_date=#{date}
|
|
@@ -289,6 +303,7 @@
|
|
a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
|
|
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,
|
|
, 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
|
|
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
|
|
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 sub_project as d on d.id = a.sub_project_id
|
|
left join sub_project as d on d.id = a.sub_project_id
|
|
@@ -296,6 +311,7 @@
|
|
left join report_extra_degree on report_extra_degree.id = a.degree_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 department on department.department_id = a.audit_deptid
|
|
left join task_group on task_group.id = a.group_id
|
|
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
|
|
WHERE 1=1
|
|
<if test="date != null and date != ''">
|
|
<if test="date != null and date != ''">
|
|
AND a.create_date=#{date}
|
|
AND a.create_date=#{date}
|
|
@@ -320,7 +336,7 @@
|
|
AND b.company_id=#{companyId}
|
|
AND b.company_id=#{companyId}
|
|
</if>
|
|
</if>
|
|
<if test="leaderId != null and leaderId != ''">
|
|
<if test="leaderId != null and leaderId != ''">
|
|
- AND a.project_id in (select id from project where incharger_id = #{leaderId})
|
|
|
|
|
|
+ AND a.project_auditor_id = #{leaderId}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -347,23 +363,6 @@
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <!--报告列表-->
|
|
|
|
- <select id="getDetailByState" resultType="java.util.Map">
|
|
|
|
- SELECT DISTINCT b.id, b.name, cast(b.department_id as SIGNED) as departmentId,a.create_date AS date
|
|
|
|
- FROM report AS a
|
|
|
|
- JOIN user AS b ON a.creator_id=b.id
|
|
|
|
- WHERE a.state = #{state} AND b.company_id=#{companyId}
|
|
|
|
- <if test="leaderId != null">
|
|
|
|
- AND a.creator_id in (select user_id from participation where project_id in(select id from project where incharger_id = #{leaderId}))
|
|
|
|
- AND a.project_id in (select id from project where incharger_id = #{leaderId})
|
|
|
|
- </if>
|
|
|
|
- <if test="isEngeering == 1">
|
|
|
|
- AND a.department_audit_state = 1
|
|
|
|
- </if>
|
|
|
|
-
|
|
|
|
- ORDER BY a.create_date DESC
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
<!--专业待审核的报告列表-->
|
|
<!--专业待审核的报告列表-->
|
|
<select id="getDetailByStateInMyProfession" resultType="java.util.Map">
|
|
<select id="getDetailByStateInMyProfession" resultType="java.util.Map">
|
|
SELECT DISTINCT b.id, b.name, cast(b.department_id as SIGNED) as departmentId,a.create_date AS date
|
|
SELECT DISTINCT b.id, b.name, cast(b.department_id as SIGNED) as departmentId,a.create_date AS date
|
|
@@ -488,4 +487,13 @@
|
|
left join project on project.id = report.project_id
|
|
left join project on project.id = report.project_id
|
|
where report.company_id = #{companyId} and report.create_date between #{startDate} and #{endDate}
|
|
where report.company_id = #{companyId} and report.create_date between #{startDate} and #{endDate}
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteUserSameDayReport" >
|
|
|
|
+ delete from report where company_id = #{companyId}
|
|
|
|
+ and state <> 1 and (
|
|
|
|
+ <foreach collection="dateReportList" index="index" open="(" close=")" separator=" ) or (" item="item">
|
|
|
|
+ create_date = #{item.createDate} and creator_id = #{item.creatorId}
|
|
|
|
+ </foreach>
|
|
|
|
+ )
|
|
|
|
+ </delete>
|
|
</mapper>
|
|
</mapper>
|