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.

84 lines
3.7 KiB

5 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.xjfast.mapper.CodelTrackMapper">
  4. <resultMap id="BaseResultMap" type="com.xjfast.entity.CodelTrack">
  5. <result column="id" jdbcType="INTEGER" property="id"/>
  6. <result column="target_country" jdbcType="VARCHAR" property="targetCountry"/>
  7. <result column="delivery_method" jdbcType="VARCHAR" property="deliveryMethod"/>
  8. <result column="weight" jdbcType="FLOAT" property="weight"/>
  9. <result column="payment_status" jdbcType="VARCHAR" property="paymentStatus"/>
  10. <result column="payment_amount" jdbcType="FLOAT" property="paymentAmount"/>
  11. <result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
  12. <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
  13. <result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
  14. <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
  15. <result column="status" jdbcType="VARCHAR" property="status"/>
  16. <result column="logistics_billing" jdbcType="FLOAT" property="logisticsBilling"/>
  17. <result column="pickup_method" jdbcType="VARCHAR" property="pickupMethod"/>
  18. <result column="tax" jdbcType="VARCHAR" property="tax"/>
  19. <result column="del_no" jdbcType="VARCHAR" property="delNo"/>
  20. </resultMap>
  21. <select id="CodelTrackList" resultType="com.xjfast.entity.vo.CodelTrackVo">
  22. SELECT DISTINCT
  23. ch.DelNo,
  24. ch.Active,
  25. ch.DeliveryDate,
  26. ch.DelDate,
  27. ch.Receiver,
  28. ch.BillAirwayNo,
  29. ch.relatedInfo,
  30. f.ForwarderName,
  31. f.ForwarderNo,
  32. -- dbo.Get_CODelivery_Total_Weight(ch.Site,ch.delno) as weight,
  33. ct.weight,
  34. ct.operation,
  35. ct.payment_status,
  36. ct.payment_amount,
  37. ct.arrived_flag,
  38. ct.act_arrived_date,
  39. ct.created_by,
  40. ct.created_date,
  41. ct.logistics_billing,
  42. ct.pickup_method,
  43. ct.tax,
  44. ct.del_no,
  45. ca.AddressName AS WareHouseName,
  46. ca.DelCountry AS target_country,
  47. sot.TypeDesc as delivery_method,
  48. dbo.Get_CustomerDesc ( ch.Site, ch.CustomerID ) AS customer_name
  49. FROM
  50. CODelHeader ch
  51. LEFT JOIN CustomerAddress ca ON ( ca.Site= ch.Site AND ca.CustomerID= ch.CustomerID AND ca.AddressID=
  52. ch.DelAddID )
  53. LEFT JOIN Forwarder f ON ( ch.ForwarderID = f.ForwarderNo AND ch.site= f.site )
  54. LEFT JOIN codel_track ct ON ( ct.del_no = ch.DelNo AND ct.site = ch.site )
  55. LEFT JOIN SalesOrderType as SOT on (SOT.Site=ch.Site and SOT.OrderType=CH.ShipVia )
  56. <where>
  57. <if test="site != null and site != ''">
  58. ch.site = #{site}
  59. </if>
  60. <if test="delNo != null and delNo != ''">
  61. ch.DelNo like '%'+#{delNo}+'%'
  62. </if>
  63. <if test="active != null and active != ''">
  64. and ch.Active = #{active}
  65. </if>
  66. <if test=" paymentStatus != null and paymentStatus != ''">
  67. and ct.payment_status = #{paymentStatus}
  68. </if>
  69. <if test="wareHouseName != null and wareHouseName != ''">
  70. and wh.WareHouseName = #{wareHouseName}
  71. </if>
  72. </where>
  73. </select>
  74. <select id="getPartOtherGroup2" resultType="java.lang.String">
  75. SELECT p.OtherGroup2
  76. FROM CODelDetail cd
  77. LEFT JOIN Part p ON (p.PartNo = cd.PartNo)
  78. <where>
  79. <if test="delNo != null and delNo != ''">
  80. cd.DelNo = #{delNo}
  81. </if>
  82. </where>
  83. </select>
  84. </mapper>