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.
 
 
 
 
 
 

85 lines
3.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.xjfast.mapper.CodelTrackMapper">
<resultMap id="BaseResultMap" type="com.xjfast.entity.CodelTrack">
<result column="id" jdbcType="INTEGER" property="id"/>
<result column="target_country" jdbcType="VARCHAR" property="targetCountry"/>
<result column="delivery_method" jdbcType="VARCHAR" property="deliveryMethod"/>
<result column="weight" jdbcType="FLOAT" property="weight"/>
<result column="payment_status" jdbcType="VARCHAR" property="paymentStatus"/>
<result column="payment_amount" jdbcType="FLOAT" property="paymentAmount"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="logistics_billing" jdbcType="FLOAT" property="logisticsBilling"/>
<result column="pickup_method" jdbcType="VARCHAR" property="pickupMethod"/>
<result column="tax" jdbcType="VARCHAR" property="tax"/>
<result column="del_no" jdbcType="VARCHAR" property="delNo"/>
</resultMap>
<select id="CodelTrackList" resultType="com.xjfast.entity.vo.CodelTrackVo">
SELECT DISTINCT
ch.DelNo,
ch.Active,
ch.DeliveryDate,
ch.DelDate,
ch.Receiver,
ch.BillAirwayNo,
ch.relatedInfo,
f.ForwarderName,
f.ForwarderNo,
-- dbo.Get_CODelivery_Total_Weight(ch.Site,ch.delno) as weight,
ct.weight,
ct.operation,
ct.payment_status,
ct.payment_amount,
ct.arrived_flag,
ct.act_arrived_date,
ct.created_by,
ct.created_date,
ct.logistics_billing,
ct.pickup_method,
ct.tax,
ct.del_no,
ca.AddressName AS WareHouseName,
ca.DelCountry AS target_country,
sot.TypeDesc as delivery_method,
dbo.Get_CustomerDesc ( ch.Site, ch.CustomerID ) AS customer_name
FROM
CODelHeader ch
LEFT JOIN CustomerAddress ca ON ( ca.Site= ch.Site AND ca.CustomerID= ch.CustomerID AND ca.AddressID=
ch.DelAddID )
LEFT JOIN Forwarder f ON ( ch.ForwarderID = f.ForwarderNo AND ch.site= f.site )
LEFT JOIN codel_track ct ON ( ct.del_no = ch.DelNo AND ct.site = ch.site )
LEFT JOIN SalesOrderType as SOT on (SOT.Site=ch.Site and SOT.OrderType=CH.ShipVia )
<where>
<if test="site != null and site != ''">
ch.site = #{site}
</if>
<if test="delNo != null and delNo != ''">
ch.DelNo like '%'+#{delNo}+'%'
</if>
<if test="active != null and active != ''">
and ch.Active = #{active}
</if>
<if test=" paymentStatus != null and paymentStatus != ''">
and ct.payment_status = #{paymentStatus}
</if>
<if test="wareHouseName != null and wareHouseName != ''">
and wh.WareHouseName = #{wareHouseName}
</if>
</where>
</select>
<select id="getPartOtherGroup2" resultType="java.lang.String">
SELECT p.OtherGroup2
FROM CODelDetail cd
LEFT JOIN Part p ON (p.PartNo = cd.PartNo)
<where>
<if test="delNo != null and delNo != ''">
cd.DelNo = #{delNo}
</if>
</where>
</select>
</mapper>