박정하 박정하 03-31
250331 박정하 이슈 내역 수정
@02ff0cb6dc5fc51656df21997bf098fc72ea0734
src/main/java/com/takensoft/taken_bi_manager/host/service/impl/HostServiceImpl.java
--- src/main/java/com/takensoft/taken_bi_manager/host/service/impl/HostServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/host/service/impl/HostServiceImpl.java
@@ -75,7 +75,9 @@
     @Transactional(rollbackFor = Exception.class)
     public int insertHost(HostVO hostVO) throws Exception {
         int result = 0;
-        hostVO.setHost_code(CommonUtil.getRandKey("host"));
+
+        String hostId = CommonUtil.getRandKey("host");
+        hostVO.setHost_code(hostId);
         hostVO.setRgtr_id(AuthUtil.getLoginUserId());
         result += hostDAO.insertHost(hostVO);
 
@@ -97,6 +99,7 @@
         deptHostVO.setDeptCode(selectDeptList.get(0).getDept_code());
         deptHostVO.setHostCode(hostVO.getHost_code());
         deptHostVO.setHostNm(hostVO.getHost_nm());
+        deptHostVO.setDeptHostId(hostId);
 
         result += deptHostDAO.insertDeptHost(deptHostVO);
 
src/main/resources/log4j2.xml
--- src/main/resources/log4j2.xml
+++ src/main/resources/log4j2.xml
@@ -28,11 +28,11 @@
         </DefaultRolloverStrategy>
     </Appenders>
     <Loggers>
-        <Logger name="consolelog" level="WARN" additivity="false">
+        <Logger name="consolelog" level="INFO" additivity="false">
             <AppenderRef ref="console"/>
             <AppenderRef ref="file"/>
         </Logger>
-        <Root level="WARN">
+        <Root level="INFO">
             <AppenderRef ref="console"/>
             <AppenderRef ref="file"/>
         </Root>
src/main/resources/spring/mapper/data/data-SQL.xml
--- src/main/resources/spring/mapper/data/data-SQL.xml
+++ src/main/resources/spring/mapper/data/data-SQL.xml
@@ -1,9 +1,6 @@
 <?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.data.dao.DataDAO">
-	
 	<resultMap id="ConnectionDBResult" type="ConnectionDB">
 		<result property="dbConectId" column="db_conect_id"/>
 		<result property="conectNm" column="conect_nm"/>
@@ -25,7 +22,24 @@
 		<result property="updtId" column="updt_id"/>
 		<result property="dataset_post_id" column="data_post_id"/>
 	</resultMap>
-	
+
+	<sql id="searchSQL">
+		<foreach item="item" index="index" collection="searchObjectList">
+			<choose>
+				<when test="item.type != null and item.type !='' and  item.type == 'dates' and item.value != null and item.value !=''">
+					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>
+	</sql>
+
 	<!-- 데이터 베이스 커넥션 정보 저장 및 업데이트  -->
     <update id="conflictInsertDbConnection" parameterType="ConnectionDB">
 		INSERT INTO db_conect_info
@@ -110,89 +124,55 @@
 			, group_database_at
 			, data_post_id
 		FROM db_conect_info
-		WHERE true
+		WHERE use_at = true
 		<!-- 검색영역 -->
-			<foreach item="item" index="index" collection="searchObjectList">
-                <choose>
-					<when test="item.type != null and item.type !='' and  item.type == 'dates' and item.value != null and item.value !=''">
-						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>
+		<include refid="searchSQL" />
 		<!-- 검색영역 끝 -->
 		LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage})
-        </select>
+	</select>
 
-		<!-- 데이터 베이스 커넥션 셀렉트 리스트 카운트  -->
-		<select id="selectDbConnectionListCount" parameterType="SearchVO" resultType="Integer">
-			SELECT count(*)
-			FROM db_conect_info
-			WHERE true
-			<!-- 검색영역 -->
-			<foreach item="item" index="index" collection="searchObjectList">
-				<choose>
-					<when test="item.type != null and item.type !='' and  item.type == 'dates' and item.value != null and item.value !=''">
-						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="selectDbConnectionListCount" parameterType="SearchVO" resultType="Integer">
+		SELECT count(*)
+		FROM db_conect_info
+		WHERE use_at = true
+		<!-- 검색영역 -->
+		<include refid="searchSQL" />
+		<!-- 검색영역 끝 -->
+	</select>
 
-		<!-- 데이터 베이스 커넥션 셀렉트 단건 -->
-		<select id="selectDbConnectionOne" parameterType="String" resultMap="ConnectionDBResult">
-			SELECT
-				db_conect_id
-				, conect_dc
-				, database_nm
-				, schema_nm
-				, database_type
-				, conect_ip
-				, conect_port
-				, user_id
-				, user_password
-				, "option"
-				, creat_dt
-				, creat_id
-				, updt_dt
-				, updt_id
-				, use_type
-				, use_at
-				, conect_nm
-				, group_database_at
-				, data_post_id
-			FROM db_conect_info
-			WHERE db_conect_id = #{db_conect_id}
-		</select>
-<!--	추가 24.04.11 하관우  API 수집-->
-
+	<!-- 데이터 베이스 커넥션 셀렉트 단건 -->
+	<select id="selectDbConnectionOne" parameterType="String" resultMap="ConnectionDBResult">
+		SELECT
+			db_conect_id
+			, conect_dc
+			, database_nm
+			, schema_nm
+			, database_type
+			, conect_ip
+			, conect_port
+			, user_id
+			, user_password
+			, "option"
+			, creat_dt
+			, creat_id
+			, updt_dt
+			, updt_id
+			, use_type
+			, use_at
+			, conect_nm
+			, group_database_at
+			, data_post_id
+		FROM db_conect_info
+		WHERE  use_at = true
+		AND db_conect_id = #{db_conect_id}
+	</select>
+	<!--	추가 24.04.11 하관우  API 수집-->
 
 	<!-- DB 연계정보 삭제 -->
-	<delete  id="deleteConnectionDb" parameterType="String" >
-		DELETE FROM db_conect_info
+	<update id="deleteConnectionDb" parameterType="String">
+		UPDATE db_conect_info
+		SET use_at = false
 		WHERE db_conect_id = #{db_conect_id}
-	</delete>
-
+	</update>
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
src/main/resources/spring/mapper/openAPI/openApi-SQL.xml
--- src/main/resources/spring/mapper/openAPI/openApi-SQL.xml
+++ src/main/resources/spring/mapper/openAPI/openApi-SQL.xml
@@ -3,6 +3,26 @@
 
 
 <mapper namespace="com.takensoft.taken_bi_manager.openAPI.dao.OpenApiDAO">
+    <sql id="searchSQL">
+        <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.key == 'public_at' and item.type == 'bool' and item.value != null and item.value !=''">
+                    AND public_at = #{item.value}
+                </when>
+                <when test="item.type != null and item.type !='' and  item.type == 'int' and item.value != null and item.value !=''">
+                    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>
+    </sql>
+
     <!--
         작성자 : 방선주
         작성일 : 2024.05.03
@@ -364,24 +384,7 @@
         FROM bi_manager.gis_info g
         WHERE  true
         <!-- 검색영역 -->
-        <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.type == 'int' and item.value != null and item.value !=''">
-                    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>
+        <include refid="searchSQL" />
         <!-- 검색영역 끝 -->
         ORDER BY gis_creat_dt DESC
         LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage})
@@ -397,24 +400,8 @@
         FROM bi_manager.gis_info
         WHERE true
         <!-- 검색영역 -->
-        <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.type == 'int' and item.value != null and item.value !=''">
-                    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>
+
+        <include refid="searchSQL" />
         <!-- 검색영역 끝 -->
         LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage})
     </select>
Add a comment
List