
--- src/main/java/com/takensoft/taken_bi_manager/common/connection/db/dao/DatabaseDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/common/connection/db/dao/DatabaseDAO.java
... | ... | @@ -202,15 +202,15 @@ |
202 | 202 |
* 데이터 셋의 비우기 (데이터 셋 내용삭제) |
203 | 203 |
*/ |
204 | 204 |
public abstract int emptyDataset (DataTable dataTable) throws Exception; |
205 |
- |
|
205 |
+ |
|
206 | 206 |
/** |
207 | 207 |
* @author 김성원 |
208 | 208 |
* @since 2022.1.20 |
209 |
- * |
|
209 |
+ * |
|
210 | 210 |
* 실제 생성된 컬럼 변경 |
211 | 211 |
*/ |
212 | 212 |
public abstract int tableColumnChange (TableBasicInfo tableBasicInfo) throws Exception; |
213 |
- |
|
213 |
+ |
|
214 | 214 |
/** |
215 | 215 |
* @author 김성원 |
216 | 216 |
* @since 2022.1.20 |
--- src/main/java/com/takensoft/taken_bi_manager/custom/dao/CustomDAO.java
+++ src/main/java/com/takensoft/taken_bi_manager/custom/dao/CustomDAO.java
... | ... | @@ -206,7 +206,7 @@ |
206 | 206 |
* |
207 | 207 |
* 커스텀 페이지에 적용된 타이틀 데이터 삭제 |
208 | 208 |
*/ |
209 |
- void componentTitleDelete(CustomComponentVO customComponentVO); |
|
209 |
+ void componentTitleDelete(String splitterId); |
|
210 | 210 |
|
211 | 211 |
/** |
212 | 212 |
* @author 방선주 |
... | ... | @@ -214,7 +214,7 @@ |
214 | 214 |
* |
215 | 215 |
* 커스텀 페이지에 적용된 컴포넌트의 데이터 정보 삭제 |
216 | 216 |
*/ |
217 |
- void componentJobGroupDelete(ComponentJobGroupVO componentJobgroup); |
|
217 |
+ void componentJobGroupDelete(String groupId); |
|
218 | 218 |
|
219 | 219 |
/** |
220 | 220 |
* @author 방선주 |
--- src/main/java/com/takensoft/taken_bi_manager/custom/service/impl/CustomServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/custom/service/impl/CustomServiceImpl.java
... | ... | @@ -548,7 +548,6 @@ |
548 | 548 |
// 페이지 아이디로 컴포넌트 정보 가져오기 |
549 | 549 |
List<CustomComponentVO> componentList = customDAO.componentListSelect(customPageVO); |
550 | 550 |
for(CustomComponentVO component : componentList) { |
551 |
- |
|
552 | 551 |
// 컴포넌트에 적용된 컬럼 값들 삭제 |
553 | 552 |
HashMap<String, Object> xAixs = new HashMap<>(); |
554 | 553 |
xAixs.put("component_id", component.getComponent_id()); |
... | ... | @@ -561,7 +560,7 @@ |
561 | 560 |
customDAO.componentColumnDelete(yAixs); |
562 | 561 |
|
563 | 562 |
// 컴포넌트에 적용된 타이틀 정보 삭제 |
564 |
- customDAO.componentTitleDelete(component); |
|
563 |
+ customDAO.componentTitleDelete(customPageVO.getSplitInfo().getSplitter_id()); |
|
565 | 564 |
|
566 | 565 |
// 컴포넌트 잡그룹 정보 가져오기 |
567 | 566 |
HashMap<String, Object> componentJobGroupList = customDAO.componentJobGroupSelect(component.getComponent_itm().getComponentJobgroup()); |
... | ... | @@ -573,7 +572,9 @@ |
573 | 572 |
jobDAO.jobGroupDelete(jobGroup); |
574 | 573 |
|
575 | 574 |
// 컴포넌트에 적용된 잡 그룹 삭제 |
576 |
- customDAO.componentJobGroupDelete(component.getComponent_itm().getComponentJobgroup()); |
|
575 |
+ if (component.getJobInfo() != null && !component.getJobInfo().isEmpty()) { |
|
576 |
+ customDAO.componentJobGroupDelete(component.getJobInfo().get(0).getGroup_id()); |
|
577 |
+ } |
|
577 | 578 |
} |
578 | 579 |
// 컴포넌트 삭제 |
579 | 580 |
customDAO.componentDelete(customPageVO); |
--- src/main/java/com/takensoft/taken_bi_manager/custom/vo/ComponentJobGroupVO.java
+++ src/main/java/com/takensoft/taken_bi_manager/custom/vo/ComponentJobGroupVO.java
... | ... | @@ -10,7 +10,6 @@ |
10 | 10 |
@Setter |
11 | 11 |
public class ComponentJobGroupVO { |
12 | 12 |
private String component_jobgroup_id; // component jobgroup 아이디 |
13 |
-// private String group_id; // job_group 아이디 |
|
14 | 13 |
private List<JobGroup> group_id; // job_group 아이디(석형) |
15 | 14 |
private int indx; // 순서 |
16 |
-} |
|
15 |
+}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/custom/vo/CustomComponentVO.java
+++ src/main/java/com/takensoft/taken_bi_manager/custom/vo/CustomComponentVO.java
... | ... | @@ -11,8 +11,6 @@ |
11 | 11 |
@Setter |
12 | 12 |
public class CustomComponentVO { |
13 | 13 |
private String component_id; |
14 |
- |
|
15 | 14 |
private List<JobGroup> jobInfo = new ArrayList<>(); |
16 |
- |
|
17 | 15 |
private ComponentData Component_itm = new ComponentData(); |
18 | 16 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/custom/vo/CustomPageVO.java
+++ src/main/java/com/takensoft/taken_bi_manager/custom/vo/CustomPageVO.java
... | ... | @@ -46,7 +46,6 @@ |
46 | 46 |
|
47 | 47 |
private CustomSplitterVO splitInfo; |
48 | 48 |
|
49 |
- |
|
50 | 49 |
private String job_flow_id; |
51 | 50 |
|
52 | 51 |
// 페이지 URL |
--- src/main/resources/application.properties
+++ src/main/resources/application.properties
... | ... | @@ -30,12 +30,12 @@ |
30 | 30 |
|
31 | 31 |
spring.web.resources.static-locations=file:///C:/Taken_BI_Manager/imgDir/,classpath:/static/,file:///home/Taken_BI_Manager/imgDir/ |
32 | 32 |
|
33 |
-# ??? ?? - ?? ?? |
|
33 |
+# ??? |
|
34 | 34 |
dev.path=C:\\Taken_BI_Manager |
35 | 35 |
dev.path.custom=\\imgDir\\ |
36 | 36 |
dev.url=http://localhost |
37 | 37 |
|
38 |
-# ??? ?? - ?? ?? |
|
38 |
+# ??? |
|
39 | 39 |
prod.path=/home/Taken_BI_Manager |
40 | 40 |
prod.path.custom=/imgDir/ |
41 |
-prod.url = http://192.168.220.131(파일 끝에 줄바꿈 문자 없음) |
|
41 |
+prod.url = http://111.8.5.136(파일 끝에 줄바꿈 문자 없음) |
--- src/main/resources/spring/mapper/custom/custom-SQL.xml
+++ src/main/resources/spring/mapper/custom/custom-SQL.xml
... | ... | @@ -387,16 +387,15 @@ |
387 | 387 |
WHERE component_id = #{component_id} |
388 | 388 |
</delete> |
389 | 389 |
|
390 |
- <delete id="componentTitleDelete" parameterType="CustomSplitterVO" > |
|
390 |
+ <delete id="componentTitleDelete" parameterType="String" > |
|
391 | 391 |
<!-- 컴포넌트 제목 삭제 --> |
392 | 392 |
DELETE FROM title_info |
393 |
- WHERE splitter_id = #{splitter_id} |
|
393 |
+ WHERE splitter_id = #{splitterId} |
|
394 | 394 |
</delete> |
395 | 395 |
|
396 |
- <delete id="componentJobGroupDelete" parameterType="ComponentJobGroupVO" > |
|
397 |
- <!-- 컴포넌트 잡그룹 삭제 --> |
|
396 |
+ <delete id="componentJobGroupDelete" parameterType="String" > |
|
398 | 397 |
DELETE FROM bi_manager.component_jobgroup |
399 |
- WHERE component_jobgroup_id = #{component_jobgroup_id} |
|
398 |
+ WHERE component_jobgroup_id = #{groupId} |
|
400 | 399 |
</delete> |
401 | 400 |
|
402 | 401 |
<delete id="componentDelete" parameterType="CustomPageVO" > |
... | ... | @@ -418,9 +417,7 @@ |
418 | 417 |
</delete> |
419 | 418 |
|
420 | 419 |
<select id="componentListSelect" parameterType="CustomPageVO" resultMap="customSplitterResultMap"> |
421 |
- <!-- componentListSelect --> |
|
422 |
- SELECT |
|
423 |
- component_id |
|
420 |
+ SELECT component_id |
|
424 | 421 |
, component_type |
425 | 422 |
, chart_knd |
426 | 423 |
, component_nm |
--- src/main/resources/spring/mapper/sql/postgre-SQL.xml
+++ src/main/resources/spring/mapper/sql/postgre-SQL.xml
... | ... | @@ -406,7 +406,7 @@ |
406 | 406 |
<update id="datasetDataUpdate" parameterType="DataTable"> |
407 | 407 |
INSERT INTO ${databaseNm}.${tableNm} |
408 | 408 |
<foreach item="item" index="index" collection="columnDatas" open="(" separator="," close=")"> |
409 |
- ${item.columnNm} |
|
409 |
+ '${item.columnNm}' |
|
410 | 410 |
</foreach> |
411 | 411 |
VALUES |
412 | 412 |
<foreach item="row" collection="rowData" separator=","> |
... | ... | @@ -419,7 +419,7 @@ |
419 | 419 |
<otherwise> |
420 | 420 |
<choose> |
421 | 421 |
<when test="columnDatas[index].pkAt == true"> |
422 |
- ${cell} |
|
422 |
+ #{cell} |
|
423 | 423 |
</when> |
424 | 424 |
<when test="columnDatas[index].dbDataType == 'varchar' or |
425 | 425 |
columnDatas[index].dbDataType == 'datetime' or |
... | ... | @@ -431,7 +431,7 @@ |
431 | 431 |
#{cell} |
432 | 432 |
</when> |
433 | 433 |
<otherwise> |
434 |
- ${cell} |
|
434 |
+ #{cell} |
|
435 | 435 |
</otherwise> |
436 | 436 |
</choose> |
437 | 437 |
</otherwise> |
... | ... | @@ -444,7 +444,7 @@ |
444 | 444 |
SET |
445 | 445 |
<foreach item="item" index="index" collection="columnDatas" separator=","> |
446 | 446 |
<if test="columnDatas[index].pkAt != null and columnDatas[index].pkAt == false"> |
447 |
- ${item.columnNm} = ExCLUDED.${item.columnNm} |
|
447 |
+ '${item.columnNm}' = ExCLUDED.'${item.columnNm}' |
|
448 | 448 |
</if> |
449 | 449 |
</foreach> |
450 | 450 |
</update> |
... | ... | @@ -576,18 +576,40 @@ |
576 | 576 |
내용 : 실제 생성된 컬럼 변경 |
577 | 577 |
--> |
578 | 578 |
<update id="tableColumnChange" parameterType="TableBasicInfo"> |
579 |
- ALTER TABLE ${tableName} |
|
580 |
- |
|
581 |
- |
|
582 |
- ${process} |
|
583 | 579 |
<if test="process == 'RENAME'"> |
584 |
- COLUMN |
|
580 |
+ ALTER TABLE ${databaseName}.${tableName} RENAME COLUMN ${columnName} TO ${tobeColumnName} |
|
585 | 581 |
</if> |
586 |
- ${columnName} |
|
587 |
- <if test="process == 'RENAME'"> |
|
588 |
- TO ${tobeColumnName} |
|
582 |
+ <if test="process == 'ADD'"> |
|
583 |
+ ALTER TABLE ${databaseName}.${tableName} ADD COLUMN ${columnName} |
|
584 |
+ <choose> |
|
585 |
+ <when test="dataType == 'datetime'">timestamp</when> |
|
586 |
+ <otherwise>${dataType}<if test="dataType == 'varchar'">(${size})</if></otherwise> |
|
587 |
+ </choose> |
|
589 | 588 |
</if> |
590 |
- <if test="process == 'MODIFY' || process == 'ADD' ">${dataType}<if test="dataType == 'varchar' and process != 'DROP'">(${size})</if></if> |
|
589 |
+ <if test="process == 'MODIFY'"> |
|
590 |
+ <!-- 임시 컬럼 생성 --> |
|
591 |
+ ALTER TABLE ${databaseName}.${tableName} ADD COLUMN temp_${columnName} |
|
592 |
+ <choose> |
|
593 |
+ <when test="dataType == 'datetime'">timestamp</when> |
|
594 |
+ <otherwise>${dataType}<if test="dataType == 'varchar'">(${size})</if></otherwise> |
|
595 |
+ </choose>; |
|
596 |
+ |
|
597 |
+ <!-- 데이터 복사 --> |
|
598 |
+ UPDATE ${databaseName}.${tableName} SET temp_${columnName} = ${columnName}:: |
|
599 |
+ <choose> |
|
600 |
+ <when test="dataType == 'datetime'">timestamp</when> |
|
601 |
+ <otherwise>${dataType}<if test="dataType == 'varchar'">(${size})</if></otherwise> |
|
602 |
+ </choose>; |
|
603 |
+ |
|
604 |
+ <!-- 기존 컬럼 삭제 --> |
|
605 |
+ ALTER TABLE ${databaseName}.${tableName} DROP COLUMN ${columnName}; |
|
606 |
+ |
|
607 |
+ <!-- 임시 컬럼 이름 변경 --> |
|
608 |
+ ALTER TABLE ${databaseName}.${tableName} RENAME COLUMN temp_${columnName} TO ${columnName} |
|
609 |
+ </if> |
|
610 |
+ <if test="process == 'DROP'"> |
|
611 |
+ ALTER TABLE ${databaseName}.${tableName} DROP COLUMN ${columnName} |
|
612 |
+ </if> |
|
591 | 613 |
</update> |
592 | 614 |
|
593 | 615 |
|
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?