|
|
@ -423,24 +423,24 @@ |
|
|
LEFT JOIN Location l ON l.LocationID =td.LocationID AND td.Site = l.Site |
|
|
LEFT JOIN Location l ON l.LocationID =td.LocationID AND td.Site = l.Site |
|
|
<where> |
|
|
<where> |
|
|
<if test="toolDetailQuery.supplierId != '' and toolDetailQuery.supplierId != null"> |
|
|
<if test="toolDetailQuery.supplierId != '' and toolDetailQuery.supplierId != null"> |
|
|
td.SupplierID = #{toolDetailQuery.supplierId} |
|
|
|
|
|
|
|
|
td.SupplierID = #{toolDetailQuery.supplierId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="toolDetailQuery.toolId != '' and toolDetailQuery.toolId != null"> |
|
|
<if test="toolDetailQuery.toolId != '' and toolDetailQuery.toolId != null"> |
|
|
AND td.ToolID like #{toolDetailQuery.toolId} |
|
|
|
|
|
|
|
|
AND td.ToolID like '%' + #{toolDetailQuery.toolId} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="toolDetailQuery.toolDescription != '' and toolDetailQuery.toolDescription != null"> |
|
|
<if test="toolDetailQuery.toolDescription != '' and toolDetailQuery.toolDescription != null"> |
|
|
AND th.ToolDescription like #{toolDetailQuery.toolDescription} |
|
|
|
|
|
|
|
|
AND th.ToolDescription like '%' + #{toolDetailQuery.toolDescription} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="toolDetailQuery.toolInstanceId != '' and toolDetailQuery.toolInstanceId != null"> |
|
|
<if test="toolDetailQuery.toolInstanceId != '' and toolDetailQuery.toolInstanceId != null"> |
|
|
AND ToolInstanceID like #{toolDetailQuery.toolInstanceId} |
|
|
|
|
|
|
|
|
AND ToolInstanceID like '%' + #{toolDetailQuery.toolInstanceId} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test=" toolDetailQuery.startDate != null"> |
|
|
|
|
|
AND td.CreateDate <![CDATA[ >= ]]> #{toolDetailQuery.startDate} |
|
|
|
|
|
|
|
|
<if test="toolDetailQuery.startDate != null"> |
|
|
|
|
|
AND td.CreateDate <![CDATA[ >= ]]> #{toolDetailQuery.startDate} |
|
|
</if> |
|
|
</if> |
|
|
<if test=" toolDetailQuery.endDate != null"> |
|
|
|
|
|
AND td.CreateDate <![CDATA[ <= ]]> #{toolDetailQuery.endDate} |
|
|
|
|
|
|
|
|
<if test="toolDetailQuery.endDate != null"> |
|
|
|
|
|
AND td.CreateDate <![CDATA[ <= ]]> #{toolDetailQuery.endDate} |
|
|
</if> |
|
|
</if> |
|
|
<if test=" toolDetailQuery.startProp != null"> |
|
|
|
|
|
|
|
|
<if test="toolDetailQuery.startProp != null"> |
|
|
AND (CASE |
|
|
AND (CASE |
|
|
WHEN EstUseQty IS NULL OR EstUseQty = 0 THEN 999 |
|
|
WHEN EstUseQty IS NULL OR EstUseQty = 0 THEN 999 |
|
|
WHEN actualUseQty IS NULL OR actualUseQty = 0 THEN 0 |
|
|
WHEN actualUseQty IS NULL OR actualUseQty = 0 THEN 0 |
|
|
@ -483,13 +483,13 @@ |
|
|
LEFT JOIN ToolHeader h ON d.ToolID = h.ToolID |
|
|
LEFT JOIN ToolHeader h ON d.ToolID = h.ToolID |
|
|
<where> |
|
|
<where> |
|
|
<if test="query.transNo != '' and query.transNo != null"> |
|
|
<if test="query.transNo != '' and query.transNo != null"> |
|
|
th.trans_no like #{query.transNo} |
|
|
|
|
|
|
|
|
th.trans_no like '%' + #{query.transNo} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.toolId != '' and query.toolId != null"> |
|
|
<if test="query.toolId != '' and query.toolId != null"> |
|
|
AND d.ToolID like #{query.toolId} |
|
|
|
|
|
|
|
|
AND d.ToolID like '%' + #{query.toolId} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.toolDescription != '' and query.toolDescription != null"> |
|
|
<if test="query.toolDescription != '' and query.toolDescription != null"> |
|
|
AND h.ToolDescription like #{query.toolDescription} |
|
|
|
|
|
|
|
|
AND h.ToolDescription like '%' + #{query.toolDescription} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test=" query.transTypes != null"> |
|
|
<if test=" query.transTypes != null"> |
|
|
<foreach collection="query.transTypes" item="transType"> |
|
|
<foreach collection="query.transTypes" item="transType"> |
|
|
@ -500,7 +500,7 @@ |
|
|
and td.supplier_id = #{query.supplierId} |
|
|
and td.supplier_id = #{query.supplierId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.toolInstanceId != '' and query.toolInstanceId != null"> |
|
|
<if test="query.toolInstanceId != '' and query.toolInstanceId != null"> |
|
|
AND td.tool_instance_id like #{query.toolInstanceId} |
|
|
|
|
|
|
|
|
AND td.tool_instance_id like '%' + #{query.toolInstanceId} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test=" query.startDate != null"> |
|
|
<if test=" query.startDate != null"> |
|
|
AND th.trans_date <![CDATA[ >= ]]> #{query.startDate} |
|
|
AND th.trans_date <![CDATA[ >= ]]> #{query.startDate} |
|
|
@ -546,10 +546,10 @@ |
|
|
from tool_use_qty_assess |
|
|
from tool_use_qty_assess |
|
|
<where> |
|
|
<where> |
|
|
<if test="query.toolId != '' and query.toolId != null"> |
|
|
<if test="query.toolId != '' and query.toolId != null"> |
|
|
AND tool_id like #{query.toolId} |
|
|
|
|
|
|
|
|
AND tool_id like '%' + #{query.toolId} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.toolInstanceId != '' and query.toolInstanceId != null"> |
|
|
<if test="query.toolInstanceId != '' and query.toolInstanceId != null"> |
|
|
AND tool_instance_id like #{query.toolInstanceId} |
|
|
|
|
|
|
|
|
AND tool_instance_id like '%' + #{query.toolInstanceId} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.startDate != null"> |
|
|
<if test="query.startDate != null"> |
|
|
AND create_date <![CDATA[ >= ]]> #{query.startDate} |
|
|
AND create_date <![CDATA[ >= ]]> #{query.startDate} |
|
|
|