admin_chrg 등록/조회

This commit is contained in:
2023-03-16 13:20:41 +09:00
parent 20f6b0c44d
commit bd4e8d1f6d
11 changed files with 545 additions and 23 deletions

View File

@@ -1144,8 +1144,124 @@
ENTR_NO = #{entrNo}
</update>
<select id="selectBLNCLists" resultType="kr.co.uplus.ez.api.custMgt.dto.UserLmtDto" parameterType="Map" >
/* custMgt-mapper.xml(selectSubsLists) */
<!-- 충전관리 목록 조회 -->
<select id="selectChrgList">
SELECT
@ROWNUM := @ROWNUM + 1 AS NO
, eci.CUST_NM
, esu.USER_ID
, ecm.CHRG_DIV
, ecm.STRT_YM
, ecm.END_YM
, ecm.CHRG_AMT
, ecm.USE_YN
, eci.BIZRNO
FROM hubez_admin.EZ_CHARGE_MNG ecm
INNER JOIN hubez_common.EZ_SVC_USER esu on esu.USER_SEQ = ecm.USER_SEQ
INNER JOIN hubez_common.EZ_CUST_INFO eci on eci.CUST_SEQ = esu.CUST_SEQ
WHERE ecm.USE_YN ='Y' AND 1 =1
<if test="startDt != null and startDt != ''">
AND esi.SUBS_DT <![CDATA[ >= ]]> STR_TO_DATE(concat(REPLACE(#{startDt}, '-', '' ),'000000') , '%Y%m%')
</if>
<if test="endDt != null and endDt != ''">
AND esi.SUBS_DT <![CDATA[ <= ]]> STR_TO_DATE(concat(REPLACE(#{endDt}, '-', '' ),'235959'), '%Y%m%')
</if>
<if test="searchType3 != null and searchType3 != ''">
<if test="searchType3 == '01' and searchText1 != null and searchText1 != ''">
AND UPPER(eci.CUST_NM) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
<if test="searchType3 == '02' and searchText1 != null and searchText1 != ''">
AND UPPER(eci.BIZRNO) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
<if test="searchType3 == '03' and searchText1 != null and searchText1 != ''">
AND UPPER(esu.USER_ID) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
</if>
ORDER BY esu.USER_ID DESC
</select>
<!-- 이용자 충전번호 조회(채번) -->
<select id="getChrgSeq" resultType="String">
/* custMgt-mapper.xml(getChrgSeq) */
SELECT hubez_common.FUN_NEXT_SEQ('CHRG_SEQ')
</select>
<!-- 충전관리 등록 -->
<insert id="insertChrgInfo">
INSERT INTO hubez_admin.EZ_CHARGE_MNG (
CHRG_SEQ
, USER_SEQ
, CHRG_DIV
, STRT_YM
, END_YM
, CHRG_AMT
, USE_YN
, REG_ID
, REG_DT
, CHG_ID
, CHG_DT
)
) VALUES(
#{chrgSeq}
, #{userSeq}
, 'Y'
, #{startDt}
, #{endDt}
, #{chrgAmt}
, #{regId}
, NOW()
, #{regId}
, NOW()
)
</insert>
<update id="updateChrg">
hubez_admin.EZ_CHARGE_MNG
set
ecm.USE_YN ='N'
WHERE USER_SEQ = (SELECT USER_SEQ FROM hubez_common.EZ_SVC_USER WHERE USER_ID = #{userId})
</update>
<insert id="addChrg">
INSERT INTO hubez_admin.EZ_CHARGE_MNG (
CHRG_SEQ
, USER_SEQ
, CHRG_DIV
, STRT_YM
, END_YM
, CHRG_AMT
, USE_YN
, REG_ID
, REG_DT
, CHG_ID
, CHG_DT
)
) VALUES(
#{chrgSeq}
, #{userSeq}
, 'Y'
, #{startDt}
, #{endDt}
, #{chrgAmt}
, #{regId}
, NOW()
, #{regId}
, NOW()
)
</insert>
<update id="deleteChrg">
UPDATE
hubez_admin.EZ_CHARGE_MNG
set
ecm.USE_YN ='N'
WHERE USER_SEQ = (SELECT USER_SEQ FROM hubez_common.EZ_SVC_USER WHERE USER_ID = #{userId})
</update>
<!-- 2023-03-07 add request 부분
<select id="selectBLNCLists" parameterType="kr.co.uplus.ez.api.custMgt.dto.UserLmtListReqDto" resultType="kr.co.uplus.ez.api.custMgt.dto.UserLmtList" >
/* custMgt-mapper.xml(selectBLNCLists) */
SELECT
@ROWNUM := @ROWNUM + 1 AS NO
, eci.CUST_SEQ
@@ -1211,15 +1327,88 @@
</if>
<if test="searchType3 != null and searchType3 != ''">
<if test="searchType3 == '01' and searchText1 != null and searchText1 != ''">
AND UPPER(eci.CUST_SEQ) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
<if test="searchType3 == '02' and searchText1 != null and searchText1 != ''">
AND UPPER(esi.ENTR_NO) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
<if test="searchType3 == '03' and searchText1 != null and searchText1 != ''">
<if test="searchType3 == '02' and searchText1 != null and searchText1 != ''">
AND UPPER(eci.BIZRNO) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
</if>
ORDER BY eci.CUST_SEQ DESC
</select>
<select id="selectBLNCListsExcel" parameterType="kr.co.uplus.ez.api.custMgt.dto.UserLmtListReqDto" resultType="kr.co.uplus.ez.api.custMgt.dto.UserLmtList">
SELECT
@ROWNUM := @ROWNUM + 1 AS NO
, eci.CUST_SEQ
, eul.LMT_YM
, eul.FX_LMT_AMT
, eul.CFWD_AMT
, eul.FX_LMT_AMT + eul.CFWD_AMT AS TOTAL_AMT
, eul.SMS_USE_AMT + eul.MMS_USE_AMT + eul.LMS_USE_AMT + eul.MMS_USE_AMT AS YM_USE_AMT
, CASE WHEN (eul.FX_LMT_AMT + eul.CFWD_AMT)-(eul.SMS_USE_AMT + eul.MMS_USE_AMT+ eul.LMS_USE_AMT + eul.MMS_USE_AMT) <![CDATA[<]]>0 THEN '-'
ELSE (eul.FX_LMT_AMT + eul.CFWD_AMT)-(eul.SMS_USE_AMT + eul.MMS_USE_AMT + eul.LMS_USE_AMT + eul.MMS_USE_AMT)
END AS YM_BLNC
FROM hubez_admin.EZ_USER_LMT eul
INNER JOIN hubez_common.EZ_SUBS_INFO esi on eul.USER_SEQ = esi.USER_SEQ
INNER JOIN hubez_common.EZ_CUST_INFO eci on esi.CUST_SEQ =eci.CUST_SEQ
LEFT JOIN hubez_imdb.EZ_IM_USER eiu on eiu.LOGIN_ID = esi.ATTRCTOR_ID
WHERE 1 = 1
<if test="startDt != null and startDt != ''">
AND eul.REG_DT <![CDATA[ >= ]]> STR_TO_DATE(concat(REPLACE(#{startDt}, '-', '' ),'000000') , '%Y%m%d%H%i%s')
</if>
<if test="endDt != null and endDt != ''">
AND esi.SUBS_STTUS_CD <![CDATA[ <= ]]> STR_TO_DATE(concat(REPLACE(#{endDt}, '-', '' ),'235959'), '%Y%m%d%H%i%s')
</if>
<if test="searchType1 != null and searchType1 != ''">
AND esi.SUBS_STTUS_CD = #{searchType1}
</if>
<if test="searchType2 != null and searchType2 != ''">
<if test="searchType2 == '01'">
AND eiu.EX_PROVUSERTYPE is null
</if>
<if test="searchType2 == '02' ">
AND eiu.EX_PROVUSERTYPE = 'DEALER'
</if>
<if test="searchType2 == '03' ">
AND eiu.EX_PROVUSERTYPE in ( 'CCS-CS1'
, 'CCS-CB1'
, 'CCS-CB2'
, 'CCS-CJ'
, 'CCS-LS2'
, 'CCS-LS3'
, 'CCS-M'
, 'CCS-MJ'
, 'CCS-P'
, 'CCS-P2'
, 'CCS-D'
, 'CCS-G'
, 'CCS-S')
</if>
<if test="searchType2 == '04' ">
AND eiu.EX_PROVUSERTYPE not in ( 'CCS-CS1'
, 'CCS-CB1'
, 'CCS-CB2'
, 'CCS-CJ'
, 'CCS-LS2'
, 'CCS-LS3'
, 'CCS-M'
, 'CCS-MJ'
, 'CCS-P'
, 'CCS-P2'
, 'CCS-D'
, 'CCS-G'
, 'CCS-S', 'DEALER')
</if>
</if>
<if test="searchType3 != null and searchType3 != ''">
<if test="searchType3 == '01' and searchText1 != null and searchText1 != ''">
AND UPPER(esi.ENTR_NO) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
<if test="searchType3 == '02' and searchText1 != null and searchText1 != ''">
AND UPPER(eci.BIZRNO) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
</if>
</if>
ORDER BY eci.CUST_SEQ DESC
</select>
-->
</mapper>