|
|
@@ -2,9 +2,84 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.style24.admin.biz.dao.TsaCustomerDao">
|
|
|
|
|
|
+ <sql id="getListPaging_Header">
|
|
|
+ SELECT T.*
|
|
|
+ FROM (
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="getListPaging_Footer">
|
|
|
+ ) T
|
|
|
+ LIMIT #{pageable.startRow}, #{pageable.pageSize}
|
|
|
+ </sql>
|
|
|
+ <!-- 활동회원목록 건수-->
|
|
|
+
|
|
|
+ <!-- 활동회원목록 -->
|
|
|
+ <select id="getCustomerActiveListCount" parameterType="CustomerSearch" resultType="int">
|
|
|
+ /* TsaCustomer.getCustomerActiveListCount */
|
|
|
+ SELECT COUNT(*) AS CNT
|
|
|
+ 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="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(#{eamil}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="custId != null and custId != ''">
|
|
|
+ AND CUST_ID = #{custId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 활동회원목록 -->
|
|
|
<select id="getCustomerActiveList" parameterType="CustomerSearch" resultType="Customer">
|
|
|
/* TsaCustomer.getCustomerActiveList */
|
|
|
+ <include refid="getListPaging_Header"/>
|
|
|
SELECT CUST_NO
|
|
|
, CUST_ID
|
|
|
, CUST_NM
|
|
|
@@ -112,6 +187,7 @@
|
|
|
<if test="custId != null and custId != ''">
|
|
|
AND CUST_ID = #{custId}
|
|
|
</if>
|
|
|
+ <include refid="getListPaging_Footer"/>
|
|
|
</select>
|
|
|
|
|
|
<!--회원정보 수정-->
|
|
|
@@ -657,8 +733,43 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 탈퇴회원목록 -->
|
|
|
+ <select id="getCustomerSecedeListCount" parameterType="CustomerSearch" resultType="int">
|
|
|
+ /* TsaCustomer.getCustomerSecedeListCount */
|
|
|
+ SELECT COUNT(*) AS CNT
|
|
|
+ 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 == 'custNo'">
|
|
|
+ AND LOWER(CUST_NO) 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="getCustomerSecedeList" parameterType="CustomerSearch" resultType="Customer">
|
|
|
/* TsaCustomer.getSecedeCustomerList */
|
|
|
+ <include refid="getListPaging_Header"/>
|
|
|
SELECT CUST_NO
|
|
|
, CUST_ID
|
|
|
, CUST_NM
|
|
|
@@ -738,10 +849,44 @@
|
|
|
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>
|
|
|
+ <include refid="getListPaging_Footer"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 휴면회원목록 -->
|
|
|
+ <select id="getCustomerDormantListCount" parameterType="CustomerSearch" resultType="int">
|
|
|
+ /* TsaCustomer.getCustomerDormantListCount */
|
|
|
+ SELECT COUNT(*) AS CNT
|
|
|
+ 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 == 'custNo'">
|
|
|
+ AND LOWER(CUST_NO) 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>
|
|
|
|
|
|
<!-- 휴면회원목록 -->
|
|
|
<select id="getCustomerDormantList" parameterType="CustomerSearch" resultType="Customer">
|
|
|
+ <include refid="getListPaging_Header"/>
|
|
|
/* TsaCustomer.getDormantCustomerList */
|
|
|
SELECT CUST_NO
|
|
|
, CUST_ID
|
|
|
@@ -820,6 +965,7 @@
|
|
|
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>
|
|
|
+ <include refid="getListPaging_Footer"/>
|
|
|
</select>
|
|
|
|
|
|
<insert id="createException">
|