|
|
@ -175,6 +175,13 @@ RecordVersion,OutWorkOrderFlag,ProjectID,OrderType,AuthRuleID,bu) |
|
|
left join sys_user b on a.UserName=b.username |
|
|
left join sys_user b on a.UserName=b.username |
|
|
left join eam_WorkShop c on b.workShopId=c.workShopId |
|
|
left join eam_WorkShop c on b.workShopId=c.workShopId |
|
|
LEFT JOIN SOIssueNotifyOrderList d on a.site=d.site and a.NotifyNo=d.NotifyNo and d.ItemNo = '1' |
|
|
LEFT JOIN SOIssueNotifyOrderList d on a.site=d.site and a.NotifyNo=d.NotifyNo and d.ItemNo = '1' |
|
|
|
|
|
<if test="query.orderByMinChildNeedDate != null and query.orderByMinChildNeedDate"> |
|
|
|
|
|
LEFT JOIN ( |
|
|
|
|
|
SELECT site, NotifyNo, MIN(needDate) AS minChildNeedDate |
|
|
|
|
|
FROM SOIssueNotifyOrderList |
|
|
|
|
|
GROUP BY site, NotifyNo |
|
|
|
|
|
) ol_need ON a.site = ol_need.site AND a.NotifyNo = ol_need.NotifyNo |
|
|
|
|
|
</if> |
|
|
<where> |
|
|
<where> |
|
|
|
|
|
|
|
|
<if test="query.notifyNo != null and query.notifyNo != ''"> |
|
|
<if test="query.notifyNo != null and query.notifyNo != ''"> |
|
|
@ -215,7 +222,14 @@ RecordVersion,OutWorkOrderFlag,ProjectID,OrderType,AuthRuleID,bu) |
|
|
AND b.workShopId in ${query.workShopId} |
|
|
AND b.workShopId in ${query.workShopId} |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
order by a.NotifyNo |
|
|
|
|
|
|
|
|
<choose> |
|
|
|
|
|
<when test="query.orderByMinChildNeedDate != null and query.orderByMinChildNeedDate"> |
|
|
|
|
|
order by case when ol_need.minChildNeedDate is null then 1 else 0 end, ol_need.minChildNeedDate asc, a.NotifyNo |
|
|
|
|
|
</when> |
|
|
|
|
|
<otherwise> |
|
|
|
|
|
order by a.NotifyNo |
|
|
|
|
|
</otherwise> |
|
|
|
|
|
</choose> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="searchNotifyOrderList" resultType="SOIssueNotifyOrderListData"> |
|
|
<select id="searchNotifyOrderList" resultType="SOIssueNotifyOrderListData"> |
|
|
|