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.
 
 
 
 
 
 

104 lines
4.2 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="ecssMapper">
<select id="searchTemplateList" resultType="EcssTemplate">
select * from ecss_template
<where>
buNo=#{buNo}
<if test="name != null and name != ''">
and name like '%'+#{name}+'%'
</if>
<if test="type != null and type != ''">
AND type = #{type}
</if>
<if test="customName != null and customName != ''">
AND customName = #{customName}
</if>
<if test="shippingMode != null and shippingMode != ''">
AND shippingMode like '%'+#{shippingMode}+'%'
</if>
</where>
order by CreateDate desc
</select>
<select id="searchWalMartOrderList" resultType="EcssWalMartOrder">
select * from ecss_walMartOrder
<where>
sku=#{sku} and qty=#{qty}
<if test="so != null and so != ''">
and so like '%'+#{so}+'%'
</if>
</where>
</select>
<select id="searchEcssCoDelNotifyDetail" resultType="java.util.Map">
select a.*,#{cmcInvoice} as cmcInvoice,#{shippingMode} as shippingMode,#{destination} as destination,
CONVERT(varchar(10), #{readyDate}, 120) AS readyDate,a.salesOrder as salesOrder,
CASE WHEN a.modifyFlag = 1 THEN '是' ELSE '否' END AS modifyFlagString
from ecss_CoDelNotifydetail a
<where>
And a.site = #{site}
AND a.delNo = #{delNo}
</where>
order by a.item_no
</select>
<select id="searchCoDelPalletData" resultType="java.util.Map">
select c.salesOrder as salesOrder,b.po_no as customerPO,b.part_no,b.qty,
a.box_qty as boxQty,b.rolls,b.pn,a.gross_weight as grossWeight,a.net_weight as netWeight,
#{cmcInvoice} as cmcInvoice,#{shippingMode} as shippingMode,#{destination} as destination,
c.cmc_comment,CONVERT(varchar(10), #{readyDate}, 120) AS readyDate,
CASE WHEN c.modifyFlag = 1 THEN '是' ELSE '否' END AS modifyFlagString
from ecss_CoDelBoxList a
left join ecss_CoDelPalletDetail b on a.site=b.site and a.bu_no=b.bu_no and a.delNo=b.delNo and a.item_no=b.seq_no
left join ecss_CoDelNotifydetail c on b.site=c.site and b.bu_no=c.bu_no and b.delNo=c.delNo and b.notify_detail_item_no=c.item_no
where a.site=#{site} and a.bu_no=#{buNo} and a.delNo=#{delNo} and b.site is not null
</select>
<select id="searchEcssCoDelNotifyDetailList" resultType="java.util.Map">
select a.item_no,a.customerPO,a.part_no,a.part_description,a.currency,
CONVERT(DECIMAL(20, 0), a.qty) as qty,CONVERT(DECIMAL(20, 5), a.tp) as unitPrice,b.hsCode,
a.upc,a.so,a.ttl_amount,a.pn,h.hsCodeDesc,h.hsCodeDescEn,a.cmc_comment,
CASE WHEN a.modifyFlag = 1 THEN '是' ELSE '否' END AS modifyFlag
from ecss_CoDelNotifydetail a
left join part b on a.site=b.site and a.part_no=b.part_no
left join ecss_hsCode h on b.hsCode=h.HsCode and a.site=h.site and b.hsCodeDesc=h.hsCodeDesc
<where>
And a.site = #{site}
AND a.delNo = #{delNo}
</where>
order by a.item_no
</select>
<select id="getEcssCoDelNotifyDetailData" resultType="java.util.Map">
select b.hsCodeDesc,b.hsCode,h.hsCodeDescEn
from ecss_CoDelNotifyDetail a
left join part b on a.site=b.site and a.part_no=b.part_no
left join ecss_hsCode h on b.hsCode=h.HsCode and a.site=h.site and b.hsCodeDesc=h.hsCodeDesc
where a.site =#{site} and a.delNo=#{delNo}
GROUP BY b.hsCodeDesc,b.hsCode,h.hsCodeDescEn
</select>
<select id="getCustomerInfo" resultType="java.util.Map">
select DISTINCT vcus.ccusname,vcusp.ccontactname,vcusp.cnative
from ecss_custdev_mes_cmc_customer vcus
LEFT JOIN ecss_custdev_mes_cmc_customer_person vcusp on vcus.ccuscode=vcusp.ccuscode
where vcus.ccusname=#{ccusname}
</select>
<select id="getCustomerAdd" resultType="java.util.Map">
select DISTINCT vcus.ccusname,vcusa.cDeliverAdd,vcusa.cDeliverUnit, vcus.country,vcusa.deliverycountry
from ecss_custdev_mes_cmc_customer vcus
left join ecss_custdev_mes_cmc_customer_addr vcusa on vcus.ccuscode=vcusa.ccuscode
where vcus.ccusname=#{ccusname}
</select>
<select id="getCustomerList" resultType="java.util.Map">
select * from ecss_custdev_mes_cmc_customer
<where>
<if test="ccusname != null and ccusname != ''">
and ccusname like '%'+#{ccusname}+'%'
</if>
</where>
</select>
</mapper>