|
|
|
@ -38,4 +38,31 @@ |
|
|
|
</where> |
|
|
|
ORDER BY trans_no ASC, id ASC |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 工具实例出入库记录明细(按工具实例编码,关联单头取类型/状态/经手人,时间倒排) --> |
|
|
|
<select id="selectToolInstanceTransDetailPage" resultType="map"> |
|
|
|
SELECT |
|
|
|
d.trans_no AS transNo, |
|
|
|
h.trans_type AS transType, |
|
|
|
CONVERT(varchar(19), d.created_date, 120) AS createdDate, |
|
|
|
d.remark AS remark, |
|
|
|
h.status AS status, |
|
|
|
h.receiver AS receiver, |
|
|
|
d.ware_house_id AS wareHouseId, |
|
|
|
d.location_id AS locationId, |
|
|
|
d.orderRef1 AS orderRef1, |
|
|
|
d.orderRef2 AS orderRef2, |
|
|
|
d.orderRef3 AS orderRef3 |
|
|
|
FROM tool_trans_detail d WITH (NOLOCK) |
|
|
|
LEFT JOIN tool_trans_header h WITH (NOLOCK) ON d.site = h.site AND d.trans_no = h.trans_no |
|
|
|
<where> |
|
|
|
<if test="query.site != null and query.site != ''"> |
|
|
|
AND d.site = #{query.site} |
|
|
|
</if> |
|
|
|
<if test="query.toolInstanceId != null and query.toolInstanceId != ''"> |
|
|
|
AND d.tool_instance_id = #{query.toolInstanceId} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY d.created_date DESC, d.id DESC |
|
|
|
</select> |
|
|
|
</mapper> |