115 lines
2.7 KiB
XML
115 lines
2.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="sgis.com.mapper.ComUserMapper">
|
|
<select id="selectUserInfo" resultType="egovMap">
|
|
<![CDATA[
|
|
select
|
|
user_id
|
|
,pswd
|
|
,login_count
|
|
,pswd_err_cnt
|
|
,user_nm
|
|
,user_group
|
|
,hp_number
|
|
,email
|
|
,company_nm
|
|
,company_zip_no
|
|
,company_addr
|
|
,company_addr_dtl
|
|
,dept_nm
|
|
]]>
|
|
<if test='pswd != null and pswd != ""'>
|
|
, #{pswd} as input_pswd
|
|
</if>
|
|
<![CDATA[
|
|
from comtb_user01
|
|
where 1=1
|
|
]]>
|
|
<if test='userId != null and userId != ""'>
|
|
<![CDATA[
|
|
and user_id = #{userId}
|
|
]]>
|
|
</if>
|
|
<if test='email != null and email != ""'>
|
|
<![CDATA[
|
|
and email = #{email}
|
|
]]>
|
|
</if>
|
|
</select>
|
|
|
|
<update id="updateUserLoginCnt">
|
|
<![CDATA[
|
|
UPDATE COMTB_USER01 SET LOGIN_COUNT = LOGIN_COUNT + 1
|
|
WHERE USER_ID = #{userId}
|
|
]]>
|
|
</update>
|
|
|
|
<!-- 사용자 접속 실패 카운트 증가 -->
|
|
<update id="updatePswdErrCnt">
|
|
<![CDATA[
|
|
UPDATE COMTB_USER01 SET PSWD_ERR_CNT = PSWD_ERR_CNT + 1
|
|
WHERE USER_ID = #{userId}
|
|
]]>
|
|
</update>
|
|
|
|
<!-- 시스템 접속 로그 리스트 -->
|
|
<select id="selectSystbClog01List" parameterType="map" resultType="egovMap">
|
|
<![CDATA[
|
|
SELECT TO_CHAR(A.SYS_REG_DT, 'YYYY-MM-DD HH24:MI:SS') AS SYS_REG_DT
|
|
,A.OPERATION_NM
|
|
,CASE WHEN RTCODE = '0' THEN '성공' ELSE '실패' END AS RTCODE
|
|
,A.RTMSG
|
|
,A.REQPARAMS
|
|
,replace(A.REQPARAMS, CHR(10), 'N') AS chgreqparams
|
|
FROM SYSTB_CLOG01 A
|
|
WHERE 1 = 1
|
|
]]>
|
|
<if test="searchFrDate != null and searchFrDate != '' ">
|
|
<![CDATA[
|
|
AND A.SYS_REG_DATE >= TO_TIMESTAMP(REPLACE(#{searchFrDate}, '-','') || '000000', 'YYYYMMDDHH24MISS')
|
|
]]>
|
|
</if>
|
|
<if test="searchToDate != null and searchToDate != '' ">
|
|
<![CDATA[
|
|
AND A.SYS_REG_DATE <= TO_TIMESTAMP(TO_CHAR((TO_DATE(REPLACE(#{searchToDate}, '-',''), 'YYYYMMDD')+1), 'YYYYMMDD'), 'YYYYMMDDHH24MISS')
|
|
]]>
|
|
</if>
|
|
<if test="operationNm != null and operationNm != '' ">
|
|
<![CDATA[
|
|
AND A.OPERATION_NM LIKE '%' || #{operationNm} || '%'
|
|
]]>
|
|
</if>
|
|
<if test="rtcode != null and rtcode != '' ">
|
|
<![CDATA[
|
|
AND A.RTCODE = #{rtcode}
|
|
]]>
|
|
</if>
|
|
<![CDATA[
|
|
ORDER BY A.SYS_REG_DT DESC
|
|
]]>
|
|
</select>
|
|
|
|
<!-- API 로그 저장 -->
|
|
<insert id="insertSystbClog01" parameterType="hashmap" useGeneratedKeys="true" keyProperty="IDX">
|
|
<![CDATA[
|
|
INSERT INTO SYSTB_CLOG01
|
|
(
|
|
SYS_REG_DT,
|
|
OPERATION_NM,
|
|
RTCODE,
|
|
RTMSG,
|
|
REQPARAMS,
|
|
userIp
|
|
)
|
|
VALUES
|
|
(
|
|
NOW(),
|
|
#{operationNm},
|
|
#{rtCode},
|
|
#{rtMsg},
|
|
#{reqParams},
|
|
#{userIp}
|
|
)
|
|
]]>
|
|
</insert>
|
|
</mapper> |