|
|
@@ -484,38 +484,7 @@
|
|
|
</if>
|
|
|
</delete>
|
|
|
|
|
|
- <select id="getMorebetterDuplicateList" parameterType="MoreBetter" resultType="MoreBetter">
|
|
|
- /* TsaMarketing.getMorebetterDuplicateList */
|
|
|
- SELECT B.TMTB_SQ
|
|
|
- , SUM(CASE WHEN B.GOODS_GB = 'G800_30' THEN -1 ELSE 1 END) USE_YN
|
|
|
- FROM TB_TMTB A
|
|
|
- INNER JOIN TB_TMTB_APPLY_GOODS B
|
|
|
- ON A.TMTB_SQ = B.TMTB_SQ
|
|
|
- WHERE 1=1
|
|
|
- AND NOW() BETWEEN DATE_FORMAT(A.TMTB_ST_DT, '%Y-%m-%d %H:%i:%S') AND DATE_FORMAT(A.TMTB_ED_DT, '%Y-%m-%d %H:%i:%S') -- 적용날짜에 속하고
|
|
|
- AND A.TMTB_STAT = 'G232_11'
|
|
|
- AND B.DEL_YN = 'N'
|
|
|
- AND EXISTS (SELECT 1
|
|
|
- FROM TB_GOODS G
|
|
|
- WHERE 1=1
|
|
|
- AND B.GOODS_CD = G.GOODS_CD
|
|
|
- <if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
|
|
|
- AND G.SUPPLY_COMP_CD IN
|
|
|
- <foreach collection="multiSupplyCompCd" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="multiBrand != null and multiBrand != ''">
|
|
|
- AND G.BRAND_CD IN
|
|
|
- <foreach collection="multiBrand" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- )
|
|
|
- GROUP BY B.TMTB_SQ
|
|
|
- </select>
|
|
|
-
|
|
|
- <delete id="deleteTmtbGoodsTemp">
|
|
|
+ <delete id="deleteTmtbGoodsTemp" timeout="300">
|
|
|
/* TsaMarketing.deleteTmtbGoodsTemp */
|
|
|
TRUNCATE TABLE TB_TMTB_GOODS_TEMP
|
|
|
</delete>
|
|
|
@@ -540,5 +509,29 @@
|
|
|
AND C.GOODS_GB = 'G800_30'
|
|
|
)
|
|
|
</insert>
|
|
|
+
|
|
|
+ <select id="getMorebetterDuplicateList" parameterType="MoreBetterGoods" resultType="MoreBetterGoods">
|
|
|
+ /* TsaMarketing.getMorebetterDuplicateList */
|
|
|
+ SELECT TMP.GOODS_CD
|
|
|
+ FROM TB_TMTB_GOODS_TEMP TMP
|
|
|
+ WHERE 1=1
|
|
|
+ AND TMP.GOODS_CD IN (
|
|
|
+ SELECT G.GOODS_CD
|
|
|
+ FROM TB_GOODS G
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
|
|
|
+ AND G.SUPPLY_COMP_CD IN
|
|
|
+ <foreach collection="multiSupplyCompCd" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="multiBrand != null and multiBrand != ''">
|
|
|
+ AND G.BRAND_CD IN
|
|
|
+ <foreach collection="multiBrand" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </select>
|
|
|
<!--// CSB 진행 -->
|
|
|
</mapper>
|