
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<?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="com.takensoft.taken_bi_manager.host.dao.HostDAO">
<select id="hostCount" parameterType="SearchVO" resultType="int">
SELECT
COUNT(*)
FROM
host_info
WHERE
use_yn = 'Y'
<!-- 검색영역 -->
<foreach item="item" index="index" collection="searchObjectList">
<choose>
<when test="item.type != null and item.type !='' and item.type == 'dates'">
AND
#{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp
AND
${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY
</when>
<when test="item.type != null and item.type !='' and item.value != null and item.value !='' and item.type == 'eq'">
AND
${item.key} = #{item.value}
</when>
<when test="item.type != null and item.type !='' and item.value != null and item.value !=''">
AND
${item.key} LIKE CONCAT('%', #{item.value}, '%')
</when>
</choose>
</foreach>
<!-- 검색영역 끝 -->
</select>
<select id="selectHost" parameterType="SearchVO" resultType="HostVO">
SELECT
host_code,
host_protocol,
host_ip,
host_id,
host_nm,
host_port,
host_pw,
rgtr_id,
reg_dt
FROM
host_info
WHERE
use_yn = 'Y'
<!-- 검색영역 -->
<foreach item="item" index="index" collection="searchObjectList">
<choose>
<when test="item.type != null and item.type !='' and item.type == 'dates'">
AND
#{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp
AND
${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY
</when>
<when test="item.type != null and item.type !='' and item.value != null and item.value !='' and item.type == 'eq'">
AND
${item.key} = #{item.value}
</when>
<when test="item.type != null and item.type !='' and item.value != null and item.value !=''">
AND
${item.key} LIKE CONCAT('%', #{item.value}, '%')
</when>
</choose>
</foreach>
<!-- 검색영역 끝 -->
ORDER BY reg_dt DESC
LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage})
</select>
<!--
작성자 : 김성훈
작성일 : 2024.02.01
내용 : Host 단건 조회 SQL
-->
<select id="hostSelectOne" parameterType="String" resultType="HostVO">
SELECT
host_code
, host_protocol
, host_ip
, host_id
, host_pw
, host_port
, host_nm
FROM
host_info
WHERE
host_code = #{host_code}
</select>
<insert id="insertHost" parameterType="HostVO">
INSERT INTO host_info
(
host_code,
host_protocol,
host_ip,
host_id,
host_nm,
host_port,
host_pw,
rgtr_id,
reg_dt
) VALUES (
#{host_code},
#{host_protocol},
#{host_ip},
#{host_id},
#{host_nm},
#{host_port},
#{host_pw},
#{rgtr_id},
CURRENT_TIMESTAMP
)
</insert>
<update id="updateHost" parameterType="HostVO">
UPDATE host_info
SET
host_protocol = #{host_protocol}
, host_ip = #{host_ip}
, host_id = #{host_id}
, host_pw = #{host_pw}
, host_nm = #{host_nm}
, host_port = #{host_port}
, mdfr_id = #{mdfr_id}
, mdfcn_dt = CURRENT_TIMESTAMP
WHERE
host_code = #{host_code}
</update>
<delete id="deleteHost" parameterType="HostVO">
UPDATE host_info
SET
use_yn = 'N'
WHERE
host_code = #{host_code}
</delete>
</mapper>