|
|
<?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, a.part_description as partDesc, CASE WHEN a.modifyFlag = 1 THEN '改单' + CASE WHEN h.modify_count IS NOT NULL THEN '(' + CAST(h.modify_count AS VARCHAR(10)) + ')' ELSE '' END ELSE '否' END AS modifyFlagString from ecss_CoDelNotifydetail a LEFT JOIN ecss_CoDelNotifyHeader h ON a.site = h.site and a.bu_no = h.bu_no AND a.delNo = h.delNo <where> AND a.site = #{site} AND a.delNo = #{delNo} </where> order by a.item_no </select>
<select id="searchCoDelPalletData" resultType="java.util.Map"> SELECT t.salesOrder, t.customerPO, t.part_no, t.qty, CASE WHEN t.rn = 1 THEN t.box_qty ELSE NULL END AS boxQty, CASE WHEN t.rn = 1 THEN t.allRolls ELSE 0 END AS rolls, t.pn, CASE WHEN t.rn = 1 THEN t.grossWeight ELSE NULL END AS grossWeight, CASE WHEN t.rn = 1 THEN t.netWeight ELSE NULL END AS netWeight, t.cmcInvoice, t.shippingMode, t.destination, t.cmc_comment, t.readyDate, t.modifyFlagString, t.partDesc, t.notify_detail_item_no as item_no FROM ( SELECT b.notify_detail_item_no, c.salesOrder AS salesOrder, c.part_description as partDesc, b.po_no AS customerPO, b.part_no, b.qty, a.box_qty, b.rolls, a.rolls as allRolls, 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 '改单' + CASE WHEN h.modify_count IS NOT NULL THEN '(' + CAST(h.modify_count AS VARCHAR(10)) + ')' ELSE '' END ELSE '否' END AS modifyFlagString,
ROW_NUMBER() OVER ( PARTITION BY a.site, a.bu_no, a.delNo, a.item_no ORDER BY b.notify_detail_item_no ) AS rn 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 LEFT JOIN ecss_CoDelNotifyHeader h ON c.site = h.site and c.bu_no = h.bu_no AND c.delNo = h.delNo WHERE a.site = #{site} AND a.bu_no = #{buNo} AND a.delNo = #{delNo} AND b.site IS NOT NULL ) t </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, 6), a.qty) as qty,CONVERT(DECIMAL(20, 5), a.tp) as unitPrice,b.hsCode, a.upc,a.salesOrder as 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 and h.brand=b.brand <where> And a.site = #{site} AND a.delNo = #{delNo} and a.status != '取消发货' </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>
|