You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.7 KiB
59 lines
2.7 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.xujie.sys.modules.pms.mapper.RepairTransdetailMapper">
|
|
|
|
<select id="queryPage" resultType="com.xujie.sys.modules.pms.entity.vo.RepairTransdetailVo">
|
|
|
|
select A.TransNo Trans_No ,A.site,A.WarehouseID Warehouse_ID ,A.TransType Trans_Type
|
|
,A.UserName User_Name,A.TransDate Trans_Date
|
|
,B.PartNo Part_No ,B.LocationID Location_ID,B.TransQty Trans_Qty,
|
|
B.BatchNo Batch_No,B.ItemNo Item_No,B.id ,C.spec
|
|
,C.part_description,A.remark
|
|
,A.PartnerID as supplier_id,vcmv.supplier_name
|
|
, A.OrderRef1 as order_ref1
|
|
from repair_TransHeader A
|
|
left join repair_TransDetail B on A.site = B.site and A.TransNo = B.TransNo
|
|
left join part_spare C on A.site = C.site and C.part_no = B.PartNo
|
|
LEFT JOIN view_custdev_mes_vendor vcmv on vcmv.supplier_id = A.PartnerID
|
|
<where>
|
|
A.site = #{query.site}
|
|
and B.BatchNo is not null
|
|
<if test="query.direction != null and query.direction != ''">
|
|
and B.Direction = #{query.direction}
|
|
</if>
|
|
<if test="query.partNo != null and query.partNo != ''">
|
|
and B.PartNo like '%'+#{query.partNo}+'%'
|
|
</if>
|
|
<if test="query.batchNo != null and query.batchNo != ''">
|
|
and B.BatchNo like '%' + #{query.batchNo}+ '%'
|
|
</if>
|
|
|
|
<if test="query.warehouseId != null and query.warehouseId != ''">
|
|
and A.WarehouseID like '%' + #{query.warehouseId}+ '%'
|
|
</if>
|
|
<if test="query.locationId != null and query.locationId != ''">
|
|
and B.LocationID like '%'+#{query.locationId}+'%'
|
|
</if>
|
|
<if test="query.startTransDate!= null and query.startTransDate!= ''">
|
|
and A.TransDate >= #{query.startTransDate}
|
|
</if>
|
|
<if test="query.endTransDate != null and query.endTransDate!= '' ">
|
|
and A.TransDate <![CDATA[<=]]> #{query.endTransDate}
|
|
</if>
|
|
<if test="query.userName != null and query.userName !='' ">
|
|
and A.UserName like '%'+#{query.userName}+'%'
|
|
</if>
|
|
<if test="query.supplierName != null and query.supplierName != ''">
|
|
and vcmv.supplier_name like '%'+#{query.supplierName}+'%'
|
|
</if>
|
|
<if test="query.orderRef1 != null and query.orderRef1 != ''">
|
|
and A.orderRef1 like '$'+#{query.orderRef1}+'%'
|
|
</if>
|
|
</where>
|
|
|
|
order By A.TransNo ,B.ItemNo ,A.TransDate desc
|
|
</select>
|
|
|
|
|
|
</mapper>
|