|
|
@ -18,7 +18,7 @@ |
|
|
select td.id |
|
|
select td.id |
|
|
, tl.project |
|
|
, tl.project |
|
|
, tl.customer |
|
|
, tl.customer |
|
|
, tl.task_initiator |
|
|
|
|
|
|
|
|
, isnull(u2.username,tl.task_initiator) task_initiator |
|
|
, tl.task_description |
|
|
, tl.task_description |
|
|
, td.department |
|
|
, td.department |
|
|
, tl.required_completion_date |
|
|
, tl.required_completion_date |
|
|
@ -36,6 +36,7 @@ |
|
|
from task_detail td |
|
|
from task_detail td |
|
|
left join task_list tl on td.task_id = tl.id AND td.site = tl.site |
|
|
left join task_list tl on td.task_id = tl.id AND td.site = tl.site |
|
|
left join users u on td.site = u.site and u.userId = td.responsible_person |
|
|
left join users u on td.site = u.site and u.userId = td.responsible_person |
|
|
|
|
|
left join users u2 on td.site = u.site and u.userId = tl.task_initiator |
|
|
<where> |
|
|
<where> |
|
|
td.site = #{site} |
|
|
td.site = #{site} |
|
|
<if test="department != null and department != ''"> |
|
|
<if test="department != null and department != ''"> |
|
|
@ -44,14 +45,17 @@ |
|
|
<if test="customer != null and customer != ''"> |
|
|
<if test="customer != null and customer != ''"> |
|
|
and tl.customer like #{customer} |
|
|
and tl.customer like #{customer} |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="project != null and project != ''"> |
|
|
|
|
|
and tl.project like #{project} |
|
|
|
|
|
</if> |
|
|
<if test="status != null and status != ''"> |
|
|
<if test="status != null and status != ''"> |
|
|
and tl.status = #{status} |
|
|
|
|
|
|
|
|
and td.status = #{status} |
|
|
</if> |
|
|
</if> |
|
|
<if test="finalStatus != null and finalStatus != ''"> |
|
|
<if test="finalStatus != null and finalStatus != ''"> |
|
|
and td.final_status = #{finalStatus} |
|
|
and td.final_status = #{finalStatus} |
|
|
</if> |
|
|
</if> |
|
|
<if test="responsiblePerson != null and responsiblePerson != ''"> |
|
|
<if test="responsiblePerson != null and responsiblePerson != ''"> |
|
|
and UPPER(td.responsible_person) like UPPER(#{responsiblePerson}) |
|
|
|
|
|
|
|
|
and UPPER(u.username) like UPPER(#{responsiblePerson}) |
|
|
</if> |
|
|
</if> |
|
|
<if test="startDate !=null "> |
|
|
<if test="startDate !=null "> |
|
|
and tl.task_start_date <![CDATA[ >= ]]> #{startDate} |
|
|
and tl.task_start_date <![CDATA[ >= ]]> #{startDate} |
|
|
|