
--- 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 @@ |
75 | 75 |
@Transactional(rollbackFor = Exception.class) |
76 | 76 |
public int insertHost(HostVO hostVO) throws Exception { |
77 | 77 |
int result = 0; |
78 |
- hostVO.setHost_code(CommonUtil.getRandKey("host")); |
|
78 |
+ |
|
79 |
+ String hostId = CommonUtil.getRandKey("host"); |
|
80 |
+ hostVO.setHost_code(hostId); |
|
79 | 81 |
hostVO.setRgtr_id(AuthUtil.getLoginUserId()); |
80 | 82 |
result += hostDAO.insertHost(hostVO); |
81 | 83 |
|
... | ... | @@ -97,6 +99,7 @@ |
97 | 99 |
deptHostVO.setDeptCode(selectDeptList.get(0).getDept_code()); |
98 | 100 |
deptHostVO.setHostCode(hostVO.getHost_code()); |
99 | 101 |
deptHostVO.setHostNm(hostVO.getHost_nm()); |
102 |
+ deptHostVO.setDeptHostId(hostId); |
|
100 | 103 |
|
101 | 104 |
result += deptHostDAO.insertDeptHost(deptHostVO); |
102 | 105 |
|
--- src/main/resources/log4j2.xml
+++ src/main/resources/log4j2.xml
... | ... | @@ -28,11 +28,11 @@ |
28 | 28 |
</DefaultRolloverStrategy> |
29 | 29 |
</Appenders> |
30 | 30 |
<Loggers> |
31 |
- <Logger name="consolelog" level="WARN" additivity="false"> |
|
31 |
+ <Logger name="consolelog" level="INFO" additivity="false"> |
|
32 | 32 |
<AppenderRef ref="console"/> |
33 | 33 |
<AppenderRef ref="file"/> |
34 | 34 |
</Logger> |
35 |
- <Root level="WARN"> |
|
35 |
+ <Root level="INFO"> |
|
36 | 36 |
<AppenderRef ref="console"/> |
37 | 37 |
<AppenderRef ref="file"/> |
38 | 38 |
</Root> |
--- src/main/resources/spring/mapper/data/data-SQL.xml
+++ src/main/resources/spring/mapper/data/data-SQL.xml
... | ... | @@ -1,9 +1,6 @@ |
1 | 1 |
<?xml version="1.0" encoding="UTF-8" ?> |
2 | 2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 |
- |
|
4 |
- |
|
5 | 3 |
<mapper namespace="com.takensoft.taken_bi_manager.data.dao.DataDAO"> |
6 |
- |
|
7 | 4 |
<resultMap id="ConnectionDBResult" type="ConnectionDB"> |
8 | 5 |
<result property="dbConectId" column="db_conect_id"/> |
9 | 6 |
<result property="conectNm" column="conect_nm"/> |
... | ... | @@ -25,7 +22,24 @@ |
25 | 22 |
<result property="updtId" column="updt_id"/> |
26 | 23 |
<result property="dataset_post_id" column="data_post_id"/> |
27 | 24 |
</resultMap> |
28 |
- |
|
25 |
+ |
|
26 |
+ <sql id="searchSQL"> |
|
27 |
+ <foreach item="item" index="index" collection="searchObjectList"> |
|
28 |
+ <choose> |
|
29 |
+ <when test="item.type != null and item.type !='' and item.type == 'dates' and item.value != null and item.value !=''"> |
|
30 |
+ AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp |
|
31 |
+ AND ${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY |
|
32 |
+ </when> |
|
33 |
+ <when test="item.type != null and item.type !='' and item.value != null and item.value !='' and item.type == 'eq'"> |
|
34 |
+ AND ${item.key} = #{item.value} |
|
35 |
+ </when> |
|
36 |
+ <when test="item.type != null and item.type !='' and item.value != null and item.value !=''"> |
|
37 |
+ AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') |
|
38 |
+ </when> |
|
39 |
+ </choose> |
|
40 |
+ </foreach> |
|
41 |
+ </sql> |
|
42 |
+ |
|
29 | 43 |
<!-- 데이터 베이스 커넥션 정보 저장 및 업데이트 --> |
30 | 44 |
<update id="conflictInsertDbConnection" parameterType="ConnectionDB"> |
31 | 45 |
INSERT INTO db_conect_info |
... | ... | @@ -110,89 +124,55 @@ |
110 | 124 |
, group_database_at |
111 | 125 |
, data_post_id |
112 | 126 |
FROM db_conect_info |
113 |
- WHERE true |
|
127 |
+ WHERE use_at = true |
|
114 | 128 |
<!-- 검색영역 --> |
115 |
- <foreach item="item" index="index" collection="searchObjectList"> |
|
116 |
- <choose> |
|
117 |
- <when test="item.type != null and item.type !='' and item.type == 'dates' and item.value != null and item.value !=''"> |
|
118 |
- AND |
|
119 |
- #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp |
|
120 |
- AND |
|
121 |
- ${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY |
|
122 |
- </when> |
|
123 |
- <when test="item.type != null and item.type !='' and item.value != null and item.value !='' and item.type == 'eq'"> |
|
124 |
- AND |
|
125 |
- ${item.key} = #{item.value} |
|
126 |
- </when> |
|
127 |
- <when test="item.type != null and item.type !='' and item.value != null and item.value !=''"> |
|
128 |
- AND |
|
129 |
- ${item.key} LIKE CONCAT('%', #{item.value}, '%') |
|
130 |
- </when> |
|
131 |
- </choose> |
|
132 |
- </foreach> |
|
129 |
+ <include refid="searchSQL" /> |
|
133 | 130 |
<!-- 검색영역 끝 --> |
134 | 131 |
LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) |
135 |
- </select> |
|
132 |
+ </select> |
|
136 | 133 |
|
137 |
- <!-- 데이터 베이스 커넥션 셀렉트 리스트 카운트 --> |
|
138 |
- <select id="selectDbConnectionListCount" parameterType="SearchVO" resultType="Integer"> |
|
139 |
- SELECT count(*) |
|
140 |
- FROM db_conect_info |
|
141 |
- WHERE true |
|
142 |
- <!-- 검색영역 --> |
|
143 |
- <foreach item="item" index="index" collection="searchObjectList"> |
|
144 |
- <choose> |
|
145 |
- <when test="item.type != null and item.type !='' and item.type == 'dates' and item.value != null and item.value !=''"> |
|
146 |
- AND |
|
147 |
- #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp |
|
148 |
- AND |
|
149 |
- ${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY |
|
150 |
- </when> |
|
151 |
- <when test="item.type != null and item.type !='' and item.value != null and item.value !='' and item.type == 'eq'"> |
|
152 |
- AND |
|
153 |
- ${item.key} = #{item.value} |
|
154 |
- </when> |
|
155 |
- <when test="item.type != null and item.type !='' and item.value != null and item.value !=''"> |
|
156 |
- AND |
|
157 |
- ${item.key} LIKE CONCAT('%', #{item.value}, '%') |
|
158 |
- </when> |
|
159 |
- </choose> |
|
160 |
- </foreach> |
|
161 |
- <!-- 검색영역 끝 --> |
|
162 |
- </select> |
|
134 |
+ <!-- 데이터 베이스 커넥션 셀렉트 리스트 카운트 --> |
|
135 |
+ <select id="selectDbConnectionListCount" parameterType="SearchVO" resultType="Integer"> |
|
136 |
+ SELECT count(*) |
|
137 |
+ FROM db_conect_info |
|
138 |
+ WHERE use_at = true |
|
139 |
+ <!-- 검색영역 --> |
|
140 |
+ <include refid="searchSQL" /> |
|
141 |
+ <!-- 검색영역 끝 --> |
|
142 |
+ </select> |
|
163 | 143 |
|
164 |
- <!-- 데이터 베이스 커넥션 셀렉트 단건 --> |
|
165 |
- <select id="selectDbConnectionOne" parameterType="String" resultMap="ConnectionDBResult"> |
|
166 |
- SELECT |
|
167 |
- db_conect_id |
|
168 |
- , conect_dc |
|
169 |
- , database_nm |
|
170 |
- , schema_nm |
|
171 |
- , database_type |
|
172 |
- , conect_ip |
|
173 |
- , conect_port |
|
174 |
- , user_id |
|
175 |
- , user_password |
|
176 |
- , "option" |
|
177 |
- , creat_dt |
|
178 |
- , creat_id |
|
179 |
- , updt_dt |
|
180 |
- , updt_id |
|
181 |
- , use_type |
|
182 |
- , use_at |
|
183 |
- , conect_nm |
|
184 |
- , group_database_at |
|
185 |
- , data_post_id |
|
186 |
- FROM db_conect_info |
|
187 |
- WHERE db_conect_id = #{db_conect_id} |
|
188 |
- </select> |
|
189 |
-<!-- 추가 24.04.11 하관우 API 수집--> |
|
190 |
- |
|
144 |
+ <!-- 데이터 베이스 커넥션 셀렉트 단건 --> |
|
145 |
+ <select id="selectDbConnectionOne" parameterType="String" resultMap="ConnectionDBResult"> |
|
146 |
+ SELECT |
|
147 |
+ db_conect_id |
|
148 |
+ , conect_dc |
|
149 |
+ , database_nm |
|
150 |
+ , schema_nm |
|
151 |
+ , database_type |
|
152 |
+ , conect_ip |
|
153 |
+ , conect_port |
|
154 |
+ , user_id |
|
155 |
+ , user_password |
|
156 |
+ , "option" |
|
157 |
+ , creat_dt |
|
158 |
+ , creat_id |
|
159 |
+ , updt_dt |
|
160 |
+ , updt_id |
|
161 |
+ , use_type |
|
162 |
+ , use_at |
|
163 |
+ , conect_nm |
|
164 |
+ , group_database_at |
|
165 |
+ , data_post_id |
|
166 |
+ FROM db_conect_info |
|
167 |
+ WHERE use_at = true |
|
168 |
+ AND db_conect_id = #{db_conect_id} |
|
169 |
+ </select> |
|
170 |
+ <!-- 추가 24.04.11 하관우 API 수집--> |
|
191 | 171 |
|
192 | 172 |
<!-- DB 연계정보 삭제 --> |
193 |
- <delete id="deleteConnectionDb" parameterType="String" > |
|
194 |
- DELETE FROM db_conect_info |
|
173 |
+ <update id="deleteConnectionDb" parameterType="String"> |
|
174 |
+ UPDATE db_conect_info |
|
175 |
+ SET use_at = false |
|
195 | 176 |
WHERE db_conect_id = #{db_conect_id} |
196 |
- </delete> |
|
197 |
- |
|
177 |
+ </update> |
|
198 | 178 |
</mapper>(파일 끝에 줄바꿈 문자 없음) |
--- src/main/resources/spring/mapper/openAPI/openApi-SQL.xml
+++ src/main/resources/spring/mapper/openAPI/openApi-SQL.xml
... | ... | @@ -3,6 +3,26 @@ |
3 | 3 |
|
4 | 4 |
|
5 | 5 |
<mapper namespace="com.takensoft.taken_bi_manager.openAPI.dao.OpenApiDAO"> |
6 |
+ <sql id="searchSQL"> |
|
7 |
+ <foreach item="item" index="index" collection="searchObjectList"> |
|
8 |
+ <choose> |
|
9 |
+ <when test="item.type != null and item.type !='' and item.type == 'dates'"> |
|
10 |
+ AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp |
|
11 |
+ AND ${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY |
|
12 |
+ </when> |
|
13 |
+ <when test="item.key == 'public_at' and item.type == 'bool' and item.value != null and item.value !=''"> |
|
14 |
+ AND public_at = #{item.value} |
|
15 |
+ </when> |
|
16 |
+ <when test="item.type != null and item.type !='' and item.type == 'int' and item.value != null and item.value !=''"> |
|
17 |
+ AND ${item.key} = #{item.value} |
|
18 |
+ </when> |
|
19 |
+ <when test="item.type != null and item.type !='' and item.value != null and item.value !=''"> |
|
20 |
+ AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') |
|
21 |
+ </when> |
|
22 |
+ </choose> |
|
23 |
+ </foreach> |
|
24 |
+ </sql> |
|
25 |
+ |
|
6 | 26 |
<!-- |
7 | 27 |
작성자 : 방선주 |
8 | 28 |
작성일 : 2024.05.03 |
... | ... | @@ -364,24 +384,7 @@ |
364 | 384 |
FROM bi_manager.gis_info g |
365 | 385 |
WHERE true |
366 | 386 |
<!-- 검색영역 --> |
367 |
- <foreach item="item" index="index" collection="searchObjectList"> |
|
368 |
- <choose> |
|
369 |
- <when test="item.type != null and item.type !='' and item.type == 'dates'"> |
|
370 |
- AND |
|
371 |
- #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp |
|
372 |
- AND |
|
373 |
- ${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY |
|
374 |
- </when> |
|
375 |
- <when test="item.type != null and item.type !='' and item.type == 'int' and item.value != null and item.value !=''"> |
|
376 |
- AND |
|
377 |
- ${item.key} = #{item.value} |
|
378 |
- </when> |
|
379 |
- <when test="item.type != null and item.type !='' and item.value != null and item.value !=''"> |
|
380 |
- AND |
|
381 |
- ${item.key} LIKE CONCAT('%', #{item.value}, '%') |
|
382 |
- </when> |
|
383 |
- </choose> |
|
384 |
- </foreach> |
|
387 |
+ <include refid="searchSQL" /> |
|
385 | 388 |
<!-- 검색영역 끝 --> |
386 | 389 |
ORDER BY gis_creat_dt DESC |
387 | 390 |
LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) |
... | ... | @@ -397,24 +400,8 @@ |
397 | 400 |
FROM bi_manager.gis_info |
398 | 401 |
WHERE true |
399 | 402 |
<!-- 검색영역 --> |
400 |
- <foreach item="item" index="index" collection="searchObjectList"> |
|
401 |
- <choose> |
|
402 |
- <when test="item.type != null and item.type !='' and item.type == 'dates'"> |
|
403 |
- AND |
|
404 |
- #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp |
|
405 |
- AND |
|
406 |
- ${item.key}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY |
|
407 |
- </when> |
|
408 |
- <when test="item.type != null and item.type !='' and item.type == 'int' and item.value != null and item.value !=''"> |
|
409 |
- AND |
|
410 |
- ${item.key} = #{item.value} |
|
411 |
- </when> |
|
412 |
- <when test="item.type != null and item.type !='' and item.value != null and item.value !=''"> |
|
413 |
- AND |
|
414 |
- ${item.key} LIKE CONCAT('%', #{item.value}, '%') |
|
415 |
- </when> |
|
416 |
- </choose> |
|
417 |
- </foreach> |
|
403 |
+ |
|
404 |
+ <include refid="searchSQL" /> |
|
418 | 405 |
<!-- 검색영역 끝 --> |
419 | 406 |
LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) |
420 | 407 |
</select> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?