|
|
@@ -20,6 +20,7 @@
|
|
|
, PD_GB
|
|
|
, AVAIL_STDT
|
|
|
, AVAIL_EDDT
|
|
|
+ , AVAIL_DAYS
|
|
|
, FN_GET_USER_NM(REG_NO) AS REG_NM
|
|
|
, REG_DT
|
|
|
FROM TB_COUPON
|
|
|
@@ -118,16 +119,11 @@
|
|
|
, DC_PVAL
|
|
|
, DC_MVAL
|
|
|
, DC_AVAL
|
|
|
+ , MAX_DC_AMT
|
|
|
, PD_GB
|
|
|
- <choose>
|
|
|
- <when test='pdGb != null and pdGb == "P"'>
|
|
|
, AVAIL_STDT
|
|
|
, AVAIL_EDDT
|
|
|
- </when>
|
|
|
- <when test='pdGb != null and pdGb == "D"'>
|
|
|
, AVAIL_DAYS
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
, CUST_PUB_LIMIT_QTY
|
|
|
, TOT_PUB_LIMIT_QTY
|
|
|
, ONE_PUB_QTY
|
|
|
@@ -145,14 +141,10 @@
|
|
|
, UPD_DT
|
|
|
, FIRST_YN
|
|
|
, DOWN_YN
|
|
|
- <if test='custJoinYn != null and custJoinYn == "Y"'>
|
|
|
, CUST_JOIN_STDT
|
|
|
, CUST_JOIN_EDDT
|
|
|
- </if>
|
|
|
- <if test='firstYn != null and firstYn == "Y"'>
|
|
|
, BUY_STDT
|
|
|
, BUY_EDDT
|
|
|
- </if>
|
|
|
<if test='cpnType != null and cpnType == "G230_20"'>
|
|
|
, PAY_TYPE
|
|
|
</if>
|
|
|
@@ -162,6 +154,7 @@
|
|
|
, #{cpnNm}
|
|
|
, #{siteCd}
|
|
|
, #{afLinkCd}
|
|
|
+ , #{afLinkCd}
|
|
|
, #{usableCustGb}
|
|
|
, #{usableCustGrade}
|
|
|
, #{cpnType}
|
|
|
@@ -170,13 +163,17 @@
|
|
|
, #{dcPval}
|
|
|
, #{dcMval}
|
|
|
, #{dcAval}
|
|
|
+ , #{maxDcAmt}
|
|
|
, #{pdGb}
|
|
|
<choose>
|
|
|
<when test='pdGb != null and pdGb == "P"'>
|
|
|
, DATE_FORMAT(#{availStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
, DATE_FORMAT(#{availEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ , null
|
|
|
</when>
|
|
|
<when test='pdGb != null and pdGb == "D"' >
|
|
|
+ , null
|
|
|
+ , null
|
|
|
, #{availDays}
|
|
|
</when>
|
|
|
</choose>
|
|
|
@@ -197,14 +194,26 @@
|
|
|
, now()
|
|
|
, #{firstYn}
|
|
|
, #{downYn}
|
|
|
- <if test='custJoinYn != null and custJoinYn == "Y"'>
|
|
|
+ <choose>
|
|
|
+ <when test='custJoinYn != null and custJoinYn == "Y"'>
|
|
|
, DATE_FORMAT(#{custJoinStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
, DATE_FORMAT(#{custJoinEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
- </if>
|
|
|
- <if test='firstYn != null and firstYn == "Y"'>
|
|
|
+ </when>
|
|
|
+ <when test='custJoinYn != null and custJoinYn == "N"'>
|
|
|
+ , null
|
|
|
+ , null
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <choose>
|
|
|
+ <when test='firstYn != null and firstYn == "Y"'>
|
|
|
, DATE_FORMAT(#{buyStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
, DATE_FORMAT(#{buyEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
- </if>
|
|
|
+ </when>
|
|
|
+ <when test='firstYn != null and firstYn == "N"'>
|
|
|
+ , DATE_FORMAT(#{buyStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ , DATE_FORMAT(#{buyEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
<if test='cpnType != null and cpnType == "G230_20"'>
|
|
|
, #{payType}
|
|
|
</if>
|
|
|
@@ -223,14 +232,23 @@
|
|
|
, DC_AVAL = #{dcAval}
|
|
|
, MAX_DC_AMT = #{maxDcAmt}
|
|
|
, PD_GB = #{pdGb}
|
|
|
- , AVAIL_STDT = #{availStdt}
|
|
|
- , AVAIL_EDDT = #{availEddt}
|
|
|
- , AVAIL_DAYS = #{availDays}
|
|
|
+ <choose>
|
|
|
+ <when test='pdGb != null and pdGb == "P"'>
|
|
|
+ , AVAIL_STDT = DATE_FORMAT(#{availStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ , AVAIL_EDDT = DATE_FORMAT(#{availEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ , AVAIL_DAYS = null
|
|
|
+ </when>
|
|
|
+ <when test='pdGb != null and pdGb == "D"' >
|
|
|
+ , AVAIL_STDT = null
|
|
|
+ , AVAIL_EDDT = null
|
|
|
+ , AVAIL_DAYS = #{availDays}
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
, CUST_PUB_LIMIT_QTY = #{custPubLimitQty}
|
|
|
, TOT_PUB_LIMIT_QTY = #{totPubLimitQty}
|
|
|
, ONE_PUB_QTY = #{onePubQty}
|
|
|
- , DOWN_STDT = #{downStdt}
|
|
|
- , DOWN_EDDT = #{downEddt}
|
|
|
+ , DOWN_STDT = DATE_FORMAT(#{downStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ , DOWN_EDDT = DATE_FORMAT(#{downEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
, BUY_LIMIT_AMT = #{buyLimitAmt}
|
|
|
, PLAN_SQ = #{planSq}
|
|
|
, REISSUANCE = #{reissuance}
|
|
|
@@ -240,10 +258,26 @@
|
|
|
, UPD_DT = now()
|
|
|
, FIRST_YN = #{firstYn}
|
|
|
, DOWN_YN = #{downYn}
|
|
|
- , CUST_JOIN_STDT = #{custJoinStdt}
|
|
|
- , CUST_JOIN_EDDT = #{custJoinEddt}
|
|
|
- , BUY_STDT = #{buyStdt}
|
|
|
- , BUY_EDDT = #{buyEddt}
|
|
|
+ <choose>
|
|
|
+ <when test='custJoinYn != null and custJoinYn == "Y"'>
|
|
|
+ , CUST_JOIN_STDT = DATE_FORMAT(#{custJoinStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ , CUST_JOIN_EDDT = DATE_FORMAT(#{custJoinEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ </when>
|
|
|
+ <when test='custJoinYn != null and custJoinYn == "N"'>
|
|
|
+ , CUST_JOIN_STDT = null
|
|
|
+ , CUST_JOIN_EDDT = null
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <choose>
|
|
|
+ <when test='firstYn != null and firstYn == "Y"'>
|
|
|
+ , BUY_STDT = DATE_FORMAT(#{buyStdt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ , BUY_EDDT = DATE_FORMAT(#{buyEddt} , '%Y-%m-%d %H:%i:%s')
|
|
|
+ </when>
|
|
|
+ <when test='firstYn != null and firstYn == "N"'>
|
|
|
+ , BUY_STDT = null
|
|
|
+ , BUY_EDDT = null
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
, PAY_TYPE = #{payType}
|
|
|
, CUST_JOIN_YN = #{custJoinYn}
|
|
|
</insert>
|
|
|
@@ -544,4 +578,30 @@
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
|
+ <!-- 특정 쿠폰 발급받은 회원 조회-->
|
|
|
+ <select id="getCouponIssueCustList" parameterType="CustCoupon" resultType="CustCoupon">
|
|
|
+ /* TsaCoupon.getCouponIssueCustList */
|
|
|
+ SELECT CUST_CPN_SQ
|
|
|
+ , CUST_NO
|
|
|
+ , CPN_ID
|
|
|
+ , AVAIL_STDT
|
|
|
+ , AVAIL_EDDT
|
|
|
+ FROM TB_CUST_COUPON
|
|
|
+ WHERE CPN_ID = #{cpnId}
|
|
|
+ AND USED_DT IS NOT NULL
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 특정 쿠폰 발급받은 고객 유효기간 수정-->
|
|
|
+ <update id="updateCustCouponAvailEddt" parameterType="CustCoupon">
|
|
|
+ /* TsaCoupon.updateCustCouponAvailEddt */
|
|
|
+ UPDATE TB_CUST_COUPON
|
|
|
+ SET AVAIL_EDDT = DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
|
|
|
+ , UPD_NO = #{updNo}
|
|
|
+ , UPD_DT = now()
|
|
|
+ WHERE CPN_ID = #{cpnId}
|
|
|
+ AND USED_DT IS NOT NULL
|
|
|
+ AND CUST_NO = #{custNo}
|
|
|
+ AND CUST_CPN_SQ = #{custCpnSq}
|
|
|
+ </update>
|
|
|
+
|
|
|
</mapper>
|