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.

58 lines
2.7 KiB

3 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.xujie.sys.modules.pms.mapper.RepairTransdetailMapper">
  4. <select id="queryPage" resultType="com.xujie.sys.modules.pms.entity.vo.RepairTransdetailVo">
  5. select A.TransNo Trans_No ,A.site,A.WarehouseID Warehouse_ID ,A.TransType Trans_Type
  6. ,A.UserName User_Name,A.TransDate Trans_Date
  7. ,B.PartNo Part_No ,B.LocationID Location_ID,B.TransQty Trans_Qty,
  8. B.BatchNo Batch_No,B.ItemNo Item_No,B.id ,C.spec
  9. ,C.part_description,A.remark
  10. ,A.PartnerID as supplier_id,vcmv.supplier_name
  11. , A.OrderRef1 as order_ref1
  12. from repair_TransHeader A
  13. left join repair_TransDetail B on A.site = B.site and A.TransNo = B.TransNo
  14. left join part_spare C on A.site = C.site and C.part_no = B.PartNo
  15. LEFT JOIN view_custdev_mes_vendor vcmv on vcmv.supplier_id = A.PartnerID
  16. <where>
  17. A.site = #{query.site}
  18. and B.BatchNo is not null
  19. <if test="query.direction != null and query.direction != ''">
  20. and B.Direction = #{query.direction}
  21. </if>
  22. <if test="query.partNo != null and query.partNo != ''">
  23. and B.PartNo like '%'+#{query.partNo}+'%'
  24. </if>
  25. <if test="query.batchNo != null and query.batchNo != ''">
  26. and B.BatchNo like '%' + #{query.batchNo}+ '%'
  27. </if>
  28. <if test="query.warehouseId != null and query.warehouseId != ''">
  29. and A.WarehouseID like '%' + #{query.warehouseId}+ '%'
  30. </if>
  31. <if test="query.locationId != null and query.locationId != ''">
  32. and B.LocationID like '%'+#{query.locationId}+'%'
  33. </if>
  34. <if test="query.startTransDate!= null and query.startTransDate!= ''">
  35. and A.TransDate >= #{query.startTransDate}
  36. </if>
  37. <if test="query.endTransDate != null and query.endTransDate!= '' ">
  38. and A.TransDate <![CDATA[<=]]> #{query.endTransDate}
  39. </if>
  40. <if test="query.userName != null and query.userName !='' ">
  41. and A.UserName like '%'+#{query.userName}+'%'
  42. </if>
  43. <if test="query.supplierName != null and query.supplierName != ''">
  44. and vcmv.supplier_name like '%'+#{query.supplierName}+'%'
  45. </if>
  46. <if test="query.orderRef1 != null and query.orderRef1 != ''">
  47. and A.orderRef1 like '$'+#{query.orderRef1}+'%'
  48. </if>
  49. </where>
  50. order By A.TransNo ,B.ItemNo ,A.TransDate desc
  51. </select>
  52. </mapper>