mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 23:04:44 +09:00
105 lines
3.7 KiB
XML
105 lines
3.7 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="kr.co.uplus.ez.api.channelMgt.ChannelMgtMapper">
|
|
|
|
<select id="selectTmpltTotalCnt" parameterType="kr.co.uplus.ez.api.channelMgt.dto.TmpltListReqDto" resultType="int">
|
|
SELECT
|
|
COUNT(*)
|
|
from ${HUBEZ_COMMON}.EZ_ATLK_TMPLT eat
|
|
inner join ${HUBEZ_COMMON}.EZ_SUBS_INFO esi
|
|
on esi.USER_SEQ = eat.USER_SEQ
|
|
and esi.SUBS_STTUS_CD in ('02','03','04','99')
|
|
inner join ${HUBEZ_COMMON}.EZ_CUST_INFO eci
|
|
on eci.CUST_SEQ = esi.CUST_SEQ
|
|
|
|
|
|
<include refid="tmpltListCondition"></include>
|
|
</select>
|
|
<select id="selectTmpltList" parameterType="kr.co.uplus.ez.api.channelMgt.dto.TmpltListReqDto" resultType="kr.co.uplus.ez.api.channelMgt.dto.TmpltInfo">
|
|
SELECT
|
|
@ROWNUM := @ROWNUM + 1 AS NO,
|
|
A.*
|
|
FROM
|
|
(
|
|
SELECT
|
|
(eci.CUST_NM)AS custNm,
|
|
(eci.BIZRNO)AS bRegNo,
|
|
eat.TMPLT_CD AS tmpltCd,
|
|
eat.TMPLT_NM AS tmpltNm,
|
|
(eat.TMPLT_TP_CD) AS tmpltType,
|
|
eat.TMPLT_STTUS_CD AS stat,
|
|
eat.REJCT_RSN AS returnReason,
|
|
eat.SNDRPROF_KEY AS sendProfile,
|
|
<!-- (select CHNL_ID from ${HUBEZ_COMMON}.EZ_KKO_CHNL ekc WHERE eat.SNDRPROF_KEY = ekc.SNDRPROF_KEY) AS sendProfile, -->
|
|
DATE_FORMAT(eat.CHG_DT, '%Y-%m-%d') As lastChgDt
|
|
from ${HUBEZ_COMMON}.EZ_ATLK_TMPLT eat
|
|
inner join ${HUBEZ_COMMON}.EZ_SUBS_INFO esi
|
|
on esi.USER_SEQ = eat.USER_SEQ
|
|
and esi.SUBS_STTUS_CD in ('02','03','04','99')
|
|
inner join ${HUBEZ_COMMON}.EZ_CUST_INFO eci
|
|
on eci.CUST_SEQ = esi.CUST_SEQ
|
|
<include refid="tmpltListCondition"></include>
|
|
LIMIT #{page}, #{pagePerRows}) A,
|
|
( SELECT @ROWNUM := #{page} ) AS R
|
|
</select>
|
|
|
|
<sql id="tmpltListCondition">
|
|
<if test='searchType1 != null and searchType1 != ""'>
|
|
<choose>
|
|
<when test='searchType1 == "N"'> <!-- 상태 - 중지 -->
|
|
AND esi.SUBS_STTUS_CD = '99'
|
|
</when>
|
|
<otherwise><!-- 상태 - 사용 -->
|
|
AND esi.SUBS_STTUS_CD != '99'
|
|
</otherwise>
|
|
</choose>
|
|
</if>
|
|
<if test='searchText1 != null and searchText1 != ""'>
|
|
<if test='searchType2 != null and searchType2 != ""'>
|
|
<choose>
|
|
<when test='searchType2 == "custNm"'><!-- 검색조건 - 고객사명 -->
|
|
and UPPER(eci.CUST_NM) LIKE CONCAT('%' , UPPER(#{searchText1}) , '%')
|
|
</when>
|
|
<when test='searchType2 == "bizNo"'><!-- 검색조건 - 사업자번호 -->
|
|
and eci.BIZRNO = #{searchText1}
|
|
</when>
|
|
<when test='searchType2 == "tmpltNm"'><!-- 검색조건 - 인증코드 -->
|
|
and UPPER(eat.TMPLT_NM) LIKE CONCAT('%' , UPPER(#{searchText1}) , '%')
|
|
</when>
|
|
</choose>
|
|
</if>
|
|
</if>
|
|
</sql>
|
|
<select id="selectTmpltListExcel" parameterType="kr.co.uplus.ez.api.channelMgt.dto.TmpltListReqDto" resultType="kr.co.uplus.ez.api.channelMgt.dto.TmpltInfo">
|
|
SELECT
|
|
@ROWNUM := @ROWNUM + 1 AS NO,
|
|
A.*
|
|
FROM
|
|
(
|
|
SELECT
|
|
(eci.CUST_NM)AS custNm,
|
|
(eci.BIZRNO)AS bRegNo,
|
|
eat.TMPLT_CD AS tmpltCd,
|
|
eat.TMPLT_NM AS tmpltNm,
|
|
(eat.TMPLT_TP_CD) AS tmpltType,
|
|
eat.TMPLT_STTUS_CD AS stat,
|
|
eat.REJCT_RSN AS returnReason,
|
|
eat.SNDRPROF_KEY AS sendProfile,
|
|
DATE_FORMAT(eat.CHG_DT, '%Y-%m-%d') As lastChgDt
|
|
from
|
|
${HUBEZ_COMMON}.EZ_ATLK_TMPLT eat
|
|
inner join ${HUBEZ_COMMON}.EZ_SUBS_INFO esi
|
|
on
|
|
esi.USER_SEQ = eat.USER_SEQ
|
|
and esi.SUBS_STTUS_CD in ('02', '03', '04', '99')
|
|
inner join ${HUBEZ_COMMON}.EZ_CUST_INFO eci
|
|
on
|
|
eci.CUST_SEQ = esi.CUST_SEQ
|
|
<include refid="tmpltListCondition"></include>
|
|
) A,
|
|
(
|
|
SELECT
|
|
@ROWNUM := 0 ) AS R
|
|
</select>
|
|
</mapper> |