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.portal.entInfo.dao.EntInfoDAO">
<!-- 기업정보 resultMap -->
<resultMap id="entInfoMap" type="HashMap">
<result property="entId" column="ent_id" />
<result property="entNm" column="ent_nm" />
<result property="brno" column="brno" />
<result property="rprsvNm" column="rprsv_nm" />
<result property="ksicNm" column="ksic_nm" />
<result property="mainPrdct" column="main_prdct" />
<result property="rmrk" column="rmrk" />
<result property="clsbizYn" column="clsbiz_yn" />
<result property="useYn" column="use_yn" />
<result property="rgtr" column="rgtr" />
<result property="regDt" column="reg_dt" />
<result property="mdfr" column="mdfr" />
<result property="mdfcnDt" column="mdfcn_dt" />
<result property="mvnInten" column="mvn_inten" />
</resultMap>
<!--
작 성 자 : 박정하
작 성 일 : 2024.03.20
내 용 : 기업정보 등록
-->
<insert id="entInfoInsert" parameterType="HashMap" useGeneratedKeys="true" keyProperty="entId">
INSERT INTO ent_info (
ent_id
, ent_nm
, brno
, rprsv_nm
, ksic_nm
, main_prdct
, rmrk
, clsbiz_yn
, use_yn
, rgtr
, reg_dt
) VALUES (
#{entId}
, #{entNm}
, #{brno}
, #{rprsvNm}
, #{ksicNm}
, #{mainPrdct}
, #{rmrk}
, #{clsbizYn}
, 'Y'
, #{rgtr}
, now()::timestamp
)
</insert>
<!--
작성자 : 박정하
작성일자 : 2024-03-21
내용 : 사업자등록번호 중복 검사
-->
<select id="isBrnoCheck" resultType="int">
SELECT count(brno)
FROM ent_info
WHERE use_yn = 'Y'
AND brno = #{brno}
</select>
<!-- 검색 조건 -->
<sql id="selectRequirement">
<!-- 검색 -->
<if test="searchText != null and searchText != ''">
<choose>
<when test="searchType != null and searchType != ''">
<if test="searchType == 'ent_nm'">
AND ent_nm LIKE CONCAT('%', #{searchText}, '%')
</if>
<if test="searchType == 'rprsv_nm'">
AND rprsv_nm LIKE CONCAT('%', #{searchText}, '%')
</if>
</when>
<otherwise>
AND (
ent_nm LIKE CONCAT('%', #{searchText}, '%')
OR
rprsv_nm LIKE CONCAT('%', #{searchText}, '%')
)
</otherwise>
</choose>
</if>
</sql>
<!--
작성자 : 박정하
작성일자 : 2024-03-21
내용 : 기업정보 목록 조회
-->
<select id="entInfoSelectList" resultMap="entInfoMap">
SELECT ent_id
, ent_nm
, brno
, rprsv_nm
, ksic_nm
, main_prdct
, rmrk
, clsbiz_yn
, use_yn
, rgtr
, reg_dt
, mdfr
, mdfcn_dt
, (SELECT mvn_inten
FROM ivst_dscsn
WHERE use_yn = 'Y'
AND ent_info.ent_id = ivst_dscsn.ent_id
ORDER BY reg_dt DESC
LIMIT 1 ) AS mvn_inten
FROM ent_info
WHERE use_yn = 'Y'
<include refid="selectRequirement" />
ORDER BY ent_id DESC
OFFSET #{limitStart} LIMIT #{recordSize}
</select>
<!--
작성자 : 박정하
작성일자 : 2024-03-21
내용 : 기업정보 목록 총 개수 조회
-->
<select id="entInfoSelectListCount" resultType="int">
SELECT count(*)
FROM ent_info
WHERE use_yn = 'Y'
<include refid="selectRequirement" />
</select>
<!--
작성자 : 박정하
작성일자 : 2024-03-21
내용 : 기업정보 상세 조회
-->
<select id="entInfoSelectOne" parameterType="HashMap" resultMap="entInfoMap">
SELECT ei.ent_id
, ei.ent_nm
, ei.brno
, ei.rprsv_nm
, ei.ksic_nm
, ei.main_prdct
, ei.rmrk
, ei.clsbiz_yn
, ei.use_yn
, ei.rgtr
, to_char(ei.reg_dt, 'YYYY-MM-DD HH24:MI') AS reg_dt
, ei.mdfr
, to_char(ei.mdfcn_dt, 'YYYY-MM-DD HH24:MI') AS mdfcn_dt
FROM ent_info AS ei
WHERE ei.use_yn = 'Y'
AND ei.ent_id = #{entId}
</select>
<!--
작성자 : 박정하
작성일자 : 2024-03-22
내용 : 기업정보 수정
-->
<update id="entInfoUpdate" parameterType="HashMap">
UPDATE ent_info
SET ent_nm = #{entNm}
, brno = #{brno}
, rprsv_nm = #{rprsvNm}
, ksic_nm = #{ksicNm}
, main_prdct = #{mainPrdct}
, rmrk = #{rmrk}
, clsbiz_yn = #{clsbizYn}
, mdfr = #{mdfr}
, mdfcn_dt = now()
WHERE ent_id = #{entId}
</update>
<!--
작성자 : 박정하
작성일자 : 2024-03-22
내용 : 기업정보 삭제
-->
<update id="entInfoDelete" parameterType="HashMap">
UPDATE ent_info
SET use_yn = 'N',
mdfr = #{mdfr},
mdfcn_dt = now()
WHERE ent_id = #{entId}
</update>
<!--
작성자 : 박정하
작성일자 : 2024-03-26
내용 : 기업아이디 조회
-->
<select id="entIdSelectOne" parameterType="HashMap" resultType="HashMap">
SELECT ent_id
FROM ent_info
WHERE use_yn = 'Y'
AND ent_nm = #{entNm}
</select>
</mapper>