|
|
@@ -920,4 +920,226 @@
|
|
|
WHERE CUST_NO = #{custNo}
|
|
|
</update>
|
|
|
|
|
|
+ <!-- 활동회원목록 엑셀 -->
|
|
|
+ <select id="getCustomerActiveExcelList" parameterType="CustomerSearch" resultType="Customer">
|
|
|
+ /* TsaCustomer.getCustomerActiveExcelList */
|
|
|
+ SELECT CUST_NO
|
|
|
+ , CUST_ID
|
|
|
+ , CUST_NM
|
|
|
+ , PASSWD
|
|
|
+ , BIRTH_YMD
|
|
|
+ , SEX_GB
|
|
|
+ , CELL_PHNNO
|
|
|
+ , APP_AGREE_YN
|
|
|
+ , DATE_FORMAT(APP_AGREE_DT, '%Y-%m-%d') AS APP_AGREE_DT
|
|
|
+ , SMS_AGREE_YN
|
|
|
+ , DATE_FORMAT(SMS_AGREE_DT, '%Y-%m-%d') AS SMS_AGREE_DT
|
|
|
+ , EMAIL
|
|
|
+ , EMAIL_AGREE_YN
|
|
|
+ , DATE_FORMAT(EMAIL_AGREE_DT, '%Y-%m-%d') AS EMAIL_AGREE_DT
|
|
|
+ , MK_AGREE_YN
|
|
|
+ , DATE_FORMAT(MK_AGREE_DT, '%Y-%m-%d') AS MK_AGREE_DT
|
|
|
+ , HOME_ZIPCODE
|
|
|
+ , HOME_BASE_ADDR
|
|
|
+ , HOME_DTL_ADDR
|
|
|
+ , FN_GET_CODE_NM('G000', SITE_CD) AS SITE_CD
|
|
|
+ , FRONT_GB
|
|
|
+ , AF_LINK_CD
|
|
|
+ , FN_GET_CODE_NM('G100', CUST_GB) AS CUST_GB
|
|
|
+ , FN_GET_CODE_NM('G110', CUST_GRADE) AS CUST_GRADE
|
|
|
+ , DATE_FORMAT(JOIN_DT, '%Y-%m-%d') AS JOIN_DT
|
|
|
+ , FOREIGNER_YN
|
|
|
+ , CUST_STAT
|
|
|
+ , DATE_FORMAT(PASSWD_CHG_DT, '%Y-%m-%d') AS PASSWD_CHG_DT
|
|
|
+ , TEMP_PASSWD_YN
|
|
|
+ , DATE_FORMAT(LOGIN_LDT, '%Y-%m-%d') AS LOGIN_LDT
|
|
|
+ , CI
|
|
|
+ , DATE_FORMAT(AUTH_DT, '%Y-%m-%d') AS AUTH_DT
|
|
|
+ , MANAGED_RSN
|
|
|
+ , MANAGED_DTL_RSN
|
|
|
+ , DATE_FORMAT(MANAGED_DT, '%Y-%m-%d') AS MANAGED_DT
|
|
|
+ , SECEDE_RSN
|
|
|
+ , SECEDE_DTL_RSN
|
|
|
+ , DATE_FORMAT(SECEDE_DT, '%Y-%m-%d') AS SECEDE_DT
|
|
|
+ <if test="searchDateGb == 'joinDt'">
|
|
|
+ , ROW_NUMBER() OVER(ORDER BY JOIN_DT DESC) AS NUMB
|
|
|
+ </if>
|
|
|
+ <if test="searchDateGb == 'loginLdt'">
|
|
|
+ , ROW_NUMBER() OVER(ORDER BY LOGIN_LDT DESC) AS NUMB
|
|
|
+ </if>
|
|
|
+ FROM TB_CUSTOMER
|
|
|
+ WHERE CUST_STAT = 'G104_10'
|
|
|
+ <if test="searchGb == 'custNo'">
|
|
|
+ AND CUST_NO = #{searchTxt}
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'custNm'">
|
|
|
+ AND LOWER(CUST_NM) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'email'">
|
|
|
+ AND LOWER(EMAIL) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'custId'">
|
|
|
+ AND LOWER(CUST_ID) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="siteCd != null and siteCd != ''">
|
|
|
+ AND SITE_CD = #{siteCd}
|
|
|
+ </if>
|
|
|
+ <if test="cellPhnno != null and cellPhnno != ''">
|
|
|
+ AND CELL_PHNNO = #{cellPhnno}
|
|
|
+ </if>
|
|
|
+ <if test="custGb != null and custGb != ''">
|
|
|
+ AND CUST_GB = #{custGb}
|
|
|
+ </if>
|
|
|
+ <if test="custGrade != null and custGrade != ''">
|
|
|
+ AND CUST_GRADE = #{custGrade}
|
|
|
+ </if>
|
|
|
+ <if test="managedRsn != null and managedRsn != ''">
|
|
|
+ AND MANAGED_RSN = #{managedRsn}
|
|
|
+ </if>
|
|
|
+ <if test="smsAgreeYn != null and smsAgreeYn != ''">
|
|
|
+ AND SMS_AGREE_YN = #{smsAgreeYn}
|
|
|
+ </if>
|
|
|
+ <if test="emailAgreeYn != null and emailAgreeYn != ''">
|
|
|
+ AND EMAIL_AGREE_YN = #{emailAgreeYn}
|
|
|
+ </if>
|
|
|
+ <if test="appAgreeYn != null and appAgreeYn != ''">
|
|
|
+ AND APP_AGREE_YN = #{appAgreeYn}
|
|
|
+ </if>
|
|
|
+ <if test="mkAgreeYn != null and mkAgreeYn != ''">
|
|
|
+ AND MK_AGREE_YN = #{mkAgreeYn}
|
|
|
+ </if>
|
|
|
+ <if test="snsType != null and snsType != ''">
|
|
|
+ AND SNS_TYPE = #{snsType}
|
|
|
+ </if>
|
|
|
+ <if test="stDate != null and edDate != '' and stDate != null and edDate != ''">
|
|
|
+ <if test="searchDateGb == 'joinDt'">
|
|
|
+ AND JOIN_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
+ AND JOIN_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
+ </if>
|
|
|
+ <if test="searchDateGb == 'loginLdt'">
|
|
|
+ AND LOGIN_LDT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
+ AND LOGIN_LDT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="custNm != null and custNm != ''">
|
|
|
+ AND LOWER(CUST_NM) LIKE CONCAT('%',LOWER(#{custNm}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != ''">
|
|
|
+ AND LOWER(EMAIL) LIKE CONCAT('%',LOWER(#{email}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="custId != null and custId != ''">
|
|
|
+ AND CUST_ID = #{custId}
|
|
|
+ </if>
|
|
|
+ <if test="condition != null and condition != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="search != null and search == 'custId'">
|
|
|
+ AND
|
|
|
+ <foreach collection="conditions" item="item" index="index" separator="or">
|
|
|
+ UPPER(CUST_ID) LIKE CONCAT('%',UPPER(#{item}),'%')
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <when test="search != null and search == 'custNm'">
|
|
|
+ AND
|
|
|
+ <foreach collection="conditions" item="item" index="index" separator="or">
|
|
|
+ UPPER(CUST_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <when test="search != null and search == 'email'">
|
|
|
+ AND
|
|
|
+ <foreach collection="conditions" item="item" index="index" separator="or">
|
|
|
+ UPPER(EMAIL) LIKE CONCAT('%',UPPER(#{item}),'%')
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 탈퇴회원목록 엑셀 -->
|
|
|
+ <select id="getCustomerSecedeExcelList" parameterType="CustomerSearch" resultType="Customer">
|
|
|
+ /* TsaCustomer.getCustomerSecedeExcelList */
|
|
|
+ SELECT CUST_NO
|
|
|
+ , CUST_ID
|
|
|
+ , CUST_NM
|
|
|
+ , BIRTH_YMD
|
|
|
+ , CELL_PHNNO
|
|
|
+ , EMAIL
|
|
|
+ , SEX_GB
|
|
|
+ , FN_GET_CODE_NM('G000', SITE_CD) AS SITE_CD
|
|
|
+ , SECEDE_RSN
|
|
|
+ , SECEDE_DTL_RSN
|
|
|
+ , DATE_FORMAT(SECEDE_DT, '%Y-%m-%d') AS SECEDE_DT
|
|
|
+ , ROW_NUMBER() OVER(ORDER BY SECEDE_DT DESC) AS NUMB
|
|
|
+ FROM TB_SECEDE_CUST
|
|
|
+ WHERE CUST_STAT = 'G104_30'
|
|
|
+ <if test="searchTxt != null and searchTxt != ''">
|
|
|
+ <if test="searchGb == 'custNo'">
|
|
|
+ AND CUST_NO = #{searchTxt}
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'custNm'">
|
|
|
+ AND LOWER(CUST_NM) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'email'">
|
|
|
+ AND LOWER(EMAIL) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'custId'">
|
|
|
+ AND LOWER(CUST_ID) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="siteCd != null and siteCd != ''">
|
|
|
+ AND SITE_CD = #{siteCd}
|
|
|
+ </if>
|
|
|
+ <if test="cellPhnno != null and cellPhnno != ''">
|
|
|
+ AND CELL_PHNNO = #{cellPhnno}
|
|
|
+ </if>
|
|
|
+ <if test="secedeRsn != null and secedeRsn != ''">
|
|
|
+ AND SECEDE_RSN = #{secedeRsn}
|
|
|
+ </if>
|
|
|
+ <if test="stDate != null and stDate != '' and edDate != null and edDate != ''">
|
|
|
+ AND SECEDE_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
+ AND SECEDE_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 휴면회원목록 엑셀-->
|
|
|
+ <select id="getCustomerDormantExcelList" parameterType="CustomerSearch" resultType="Customer">
|
|
|
+ /* TsaCustomer.getCustomerDormantExcelList */
|
|
|
+ SELECT CUST_NO
|
|
|
+ , FN_GET_CODE_NM('G000', SITE_CD) AS SITE_CD
|
|
|
+ , CUST_ID
|
|
|
+ , CUST_NM
|
|
|
+ , CELL_PHNNO
|
|
|
+ , EMAIL
|
|
|
+ , BIRTH_YMD
|
|
|
+ , SEX_GB
|
|
|
+ , DATE_FORMAT(DORMANT_DT, '%Y-%m-%d') AS DORMANT_DT
|
|
|
+ , ROW_NUMBER() OVER(ORDER BY DORMANT_DT DESC) AS NUMB
|
|
|
+ FROM TB_DORMANT_CUST
|
|
|
+ WHERE CUST_STAT = 'G104_20'
|
|
|
+ <if test="searchTxt != null and searchTxt != ''">
|
|
|
+ <if test="searchGb == 'custNo'">
|
|
|
+ AND CUST_NO = #{searchTxt}
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'custNm'">
|
|
|
+ AND LOWER(CUST_NM) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'email'">
|
|
|
+ AND LOWER(EMAIL) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="searchGb == 'custId'">
|
|
|
+ AND LOWER(CUST_ID) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="siteCd != null and siteCd != ''">
|
|
|
+ AND SITE_CD = #{siteCd}
|
|
|
+ </if>
|
|
|
+ <if test="cellPhnno != null and cellPhnno != ''">
|
|
|
+ AND CELL_PHNNO = #{cellPhnno}
|
|
|
+ </if>
|
|
|
+ <if test="stDate != null and stDate != '' and edDate != null and edDate != ''">
|
|
|
+ AND DORMANT_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
|
|
|
+ AND DORMANT_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|