|
@@ -70,24 +70,24 @@
|
|
|
AND OD.SUPPLY_COMP_CD = #{supplyCompCd}
|
|
AND OD.SUPPLY_COMP_CD = #{supplyCompCd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="multiBrand != null and multiBrand != ''">
|
|
<if test="multiBrand != null and multiBrand != ''">
|
|
|
- AND G.BRAND_CD IN
|
|
|
|
|
|
|
+ AND G.BRAND_CD IN
|
|
|
<foreach collection="multiBrand" item="item" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="multiBrand" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="multiOrdDtlStat != null and multiOrdDtlStat != ''">
|
|
|
|
|
- AND OD.ORD_DTL_STAT IN
|
|
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="multiOrdDtlStat != null and multiOrdDtlStat != ''">
|
|
|
|
|
+ AND OD.ORD_DTL_STAT IN
|
|
|
<foreach collection="multiOrdDtlStat" item="item" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="multiOrdDtlStat" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test='search != null and search == "searchOrdNo"'>
|
|
|
|
|
- <if test="condition != null and condition != ''">
|
|
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test='search != null and search == "searchOrdNo"'>
|
|
|
|
|
+ <if test="condition != null and condition != ''">
|
|
|
AND O.ORD_NO = #{condition}
|
|
AND O.ORD_NO = #{condition}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test='search != null and search == "searchExtmallOrderId"'>
|
|
<if test='search != null and search == "searchExtmallOrderId"'>
|
|
|
- <if test="condition != null and condition != ''">
|
|
|
|
|
|
|
+ <if test="condition != null and condition != ''">
|
|
|
AND O.ORD_NO = #{condition}
|
|
AND O.ORD_NO = #{condition}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
@@ -154,105 +154,105 @@
|
|
|
, SUM(ORD_QTY) AS SUM_ORD_QTY
|
|
, SUM(ORD_QTY) AS SUM_ORD_QTY
|
|
|
, SUM(ORD_QTY - CNCL_RTN_QTY) AS SUM_ORD_CNCL_QTY
|
|
, SUM(ORD_QTY - CNCL_RTN_QTY) AS SUM_ORD_CNCL_QTY
|
|
|
FROM (
|
|
FROM (
|
|
|
- SELECT O.ORD_NO
|
|
|
|
|
- , OD.GOODS_CD
|
|
|
|
|
- , OD.ORD_AMT
|
|
|
|
|
- , OD.CNCL_RTN_AMT
|
|
|
|
|
- , OD.CNCL_RTN_QTY
|
|
|
|
|
- , OD.ORD_QTY
|
|
|
|
|
- , OD.REAL_ORD_AMT
|
|
|
|
|
- FROM TB_ORDER O
|
|
|
|
|
- INNER JOIN TB_ORDER_DETAIL OD
|
|
|
|
|
- ON O.ORD_NO = OD.ORD_NO
|
|
|
|
|
- INNER JOIN TB_ORDER_DETAIL_ITEM ODI
|
|
|
|
|
- ON OD.ORD_NO = ODI.ORD_NO
|
|
|
|
|
- AND OD.ORD_DTL_NO = ODI.ORD_DTL_NO
|
|
|
|
|
- INNER JOIN TB_GOODS G
|
|
|
|
|
- ON OD.GOODS_CD = G.GOODS_CD
|
|
|
|
|
- INNER JOIN TB_GOODS_IMG GI
|
|
|
|
|
- ON OD.GOODS_CD = GI.GOODS_CD
|
|
|
|
|
- AND ODI.OPT_CD1 = GI.COLOR_CD
|
|
|
|
|
- INNER JOIN TB_PAYMENT P
|
|
|
|
|
- ON O.ORD_NO = P.ORD_NO
|
|
|
|
|
- AND P.PAY_GB = 'O'
|
|
|
|
|
- INNER JOIN TB_DELIVERY_ADDR DA
|
|
|
|
|
- ON OD.DELV_ADDR_SQ = DA.DELV_ADDR_SQ
|
|
|
|
|
- WHERE 1=1
|
|
|
|
|
|
|
+ SELECT O.ORD_NO
|
|
|
|
|
+ , OD.GOODS_CD
|
|
|
|
|
+ , OD.ORD_AMT
|
|
|
|
|
+ , OD.CNCL_RTN_AMT
|
|
|
|
|
+ , OD.CNCL_RTN_QTY
|
|
|
|
|
+ , OD.ORD_QTY
|
|
|
|
|
+ , OD.REAL_ORD_AMT
|
|
|
|
|
+ FROM TB_ORDER O
|
|
|
|
|
+ INNER JOIN TB_ORDER_DETAIL OD
|
|
|
|
|
+ ON O.ORD_NO = OD.ORD_NO
|
|
|
|
|
+ INNER JOIN TB_ORDER_DETAIL_ITEM ODI
|
|
|
|
|
+ ON OD.ORD_NO = ODI.ORD_NO
|
|
|
|
|
+ AND OD.ORD_DTL_NO = ODI.ORD_DTL_NO
|
|
|
|
|
+ INNER JOIN TB_GOODS G
|
|
|
|
|
+ ON OD.GOODS_CD = G.GOODS_CD
|
|
|
|
|
+ INNER JOIN TB_GOODS_IMG GI
|
|
|
|
|
+ ON OD.GOODS_CD = GI.GOODS_CD
|
|
|
|
|
+ AND ODI.OPT_CD1 = GI.COLOR_CD
|
|
|
|
|
+ INNER JOIN TB_PAYMENT P
|
|
|
|
|
+ ON O.ORD_NO = P.ORD_NO
|
|
|
|
|
+ AND P.PAY_GB = 'O'
|
|
|
|
|
+ INNER JOIN TB_DELIVERY_ADDR DA
|
|
|
|
|
+ ON OD.DELV_ADDR_SQ = DA.DELV_ADDR_SQ
|
|
|
|
|
+ WHERE 1=1
|
|
|
<if test='siteCd != null and siteCd != ""'>
|
|
<if test='siteCd != null and siteCd != ""'>
|
|
|
- AND O.SITE_CD = #{siteCd}
|
|
|
|
|
|
|
+ AND O.SITE_CD = #{siteCd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='mallCd != null and mallCd != ""'>
|
|
<if test='mallCd != null and mallCd != ""'>
|
|
|
- AND O.MALL_GB = #{mallCd}
|
|
|
|
|
|
|
+ AND O.MALL_GB = #{mallCd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='supplyCompCd != null and supplyCompCd != ""'>
|
|
<if test='supplyCompCd != null and supplyCompCd != ""'>
|
|
|
- AND OD.SUPPLY_COMP_CD = #{supplyCompCd}
|
|
|
|
|
|
|
+ AND OD.SUPPLY_COMP_CD = #{supplyCompCd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="multiBrand != null and multiBrand != ''">
|
|
<if test="multiBrand != null and multiBrand != ''">
|
|
|
- AND G.BRAND_CD IN
|
|
|
|
|
|
|
+ AND G.BRAND_CD IN
|
|
|
<foreach collection="multiBrand" item="item" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="multiBrand" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="multiOrdDtlStat != null and multiOrdDtlStat != ''">
|
|
|
|
|
- AND OD.ORD_DTL_STAT IN
|
|
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="multiOrdDtlStat != null and multiOrdDtlStat != ''">
|
|
|
|
|
+ AND OD.ORD_DTL_STAT IN
|
|
|
<foreach collection="multiOrdDtlStat" item="item" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="multiOrdDtlStat" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
|
|
- </foreach>
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test='search != null and search == "searchOrdNo"'>
|
|
|
|
|
- <if test="condition != null and condition != ''">
|
|
|
|
|
- AND O.ORD_NO = #{condition}
|
|
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test='search != null and search == "searchOrdNo"'>
|
|
|
|
|
+ <if test="condition != null and condition != ''">
|
|
|
|
|
+ AND O.ORD_NO = #{condition}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test='search != null and search == "searchExtmallOrderId"'>
|
|
<if test='search != null and search == "searchExtmallOrderId"'>
|
|
|
- <if test="condition != null and condition != ''">
|
|
|
|
|
- AND O.ORD_NO = #{condition}
|
|
|
|
|
|
|
+ <if test="condition != null and condition != ''">
|
|
|
|
|
+ AND O.ORD_NO = #{condition}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test='payMeans != null and payMeans != ""'>
|
|
<if test='payMeans != null and payMeans != ""'>
|
|
|
- AND P.PAY_MEANS = #{payMeans}
|
|
|
|
|
|
|
+ AND P.PAY_MEANS = #{payMeans}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='orderNm != null and orderNm != ""'>
|
|
<if test='orderNm != null and orderNm != ""'>
|
|
|
- AND O.ORD_NM = #{orderNm}
|
|
|
|
|
|
|
+ AND O.ORD_NM = #{orderNm}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='custId != null and custId != ""'>
|
|
<if test='custId != null and custId != ""'>
|
|
|
- AND O.CUST_NO = #{custId}
|
|
|
|
|
|
|
+ AND O.CUST_NO = #{custId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='orderPhnno != null and orderPhnno != ""'>
|
|
<if test='orderPhnno != null and orderPhnno != ""'>
|
|
|
- AND O.ORD_PHNNO = #{orderPhnno}
|
|
|
|
|
|
|
+ AND O.ORD_PHNNO = #{orderPhnno}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='goodsCd != null and goodsCd != ""'>
|
|
<if test='goodsCd != null and goodsCd != ""'>
|
|
|
- AND G.GOODS_CD = #{goodsCd}
|
|
|
|
|
|
|
+ AND G.GOODS_CD = #{goodsCd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='sizeCd != null and sizeCd != ""'>
|
|
<if test='sizeCd != null and sizeCd != ""'>
|
|
|
- AND ODI.OPT_CD2 = #{sizeCd}
|
|
|
|
|
|
|
+ AND ODI.OPT_CD2 = #{sizeCd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='goodsNm != null and goodsNm != ""'>
|
|
<if test='goodsNm != null and goodsNm != ""'>
|
|
|
- AND G.GOODS_NM = #{goodsNm}
|
|
|
|
|
|
|
+ AND G.GOODS_NM = #{goodsNm}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='recipNm != null and recipNm != ""'>
|
|
<if test='recipNm != null and recipNm != ""'>
|
|
|
- AND DA.RECIP_NM = #{recipNm}
|
|
|
|
|
|
|
+ AND DA.RECIP_NM = #{recipNm}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='invoiceNo != null and invoiceNo != ""'>
|
|
<if test='invoiceNo != null and invoiceNo != ""'>
|
|
|
- AND OD.INVOICE_NO = #{invoiceNo}
|
|
|
|
|
|
|
+ AND OD.INVOICE_NO = #{invoiceNo}
|
|
|
</if>
|
|
</if>
|
|
|
<if test='wdInvoiceSendYn != null and wdInvoiceSendYn == "Y"'>
|
|
<if test='wdInvoiceSendYn != null and wdInvoiceSendYn == "Y"'>
|
|
|
- AND OD.INVOICE_SEND_YN = 'Y'
|
|
|
|
|
|
|
+ AND OD.INVOICE_SEND_YN = 'Y'
|
|
|
</if>
|
|
</if>
|
|
|
<if test='wdInvoiceSendYn != null and wdInvoiceSendYn == "N"'>
|
|
<if test='wdInvoiceSendYn != null and wdInvoiceSendYn == "N"'>
|
|
|
- AND OD.INVOICE_SEND_YN = 'N'
|
|
|
|
|
|
|
+ AND OD.INVOICE_SEND_YN = 'N'
|
|
|
</if>
|
|
</if>
|
|
|
<if test='searchDateGb != null and searchDateGb == "ordDt"'>
|
|
<if test='searchDateGb != null and searchDateGb == "ordDt"'>
|
|
|
- AND O.ORD_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
- AND O.ORD_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
|
|
+ AND O.ORD_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
+ AND O.ORD_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
</if>
|
|
</if>
|
|
|
<if test='searchDateGb != null and searchDateGb == "delvStdt"'>
|
|
<if test='searchDateGb != null and searchDateGb == "delvStdt"'>
|
|
|
- AND OD.DELV_STDT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
- AND OD.DELV_STDT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
|
|
+ AND OD.DELV_STDT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
+ AND OD.DELV_STDT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
</if>
|
|
</if>
|
|
|
<if test='searchDateGb != null and searchDateGb == "soldoutDt"'>
|
|
<if test='searchDateGb != null and searchDateGb == "soldoutDt"'>
|
|
|
- AND OD.SOLDOUT_REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
- AND OD.SOLDOUT_REG_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
|
|
+ AND OD.SOLDOUT_REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
+ AND OD.SOLDOUT_REG_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
</if>
|
|
</if>
|
|
|
) X
|
|
) X
|
|
|
</select>
|
|
</select>
|