데이터 유무 컬럼 수정
This commit is contained in:
parent
8a50c4351e
commit
3d68e0e27d
@ -1,6 +1,7 @@
|
|||||||
package com.interplug.qcast.biz.canvasBasicSetting;
|
package com.interplug.qcast.biz.canvasBasicSetting;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -14,6 +15,7 @@ import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo;
|
|||||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||||
import com.interplug.qcast.config.Exception.QcastException;
|
import com.interplug.qcast.config.Exception.QcastException;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CanvasBasicSettingService {
|
public class CanvasBasicSettingService {
|
||||||
@ -38,6 +40,8 @@ public class CanvasBasicSettingService {
|
|||||||
// 먼저 데이터가 존재하는지 확인
|
// 먼저 데이터가 존재하는지 확인
|
||||||
CanvasBasicSettingInfo cntData = canvasBasicSettingMapper.getCanvasBasicSettingCnt(csi.getObjectNo());
|
CanvasBasicSettingInfo cntData = canvasBasicSettingMapper.getCanvasBasicSettingCnt(csi.getObjectNo());
|
||||||
|
|
||||||
|
log.debug("cntData ::::: " + cntData);
|
||||||
|
|
||||||
// 데이터가 존재하지 않으면 insert
|
// 데이터가 존재하지 않으면 insert
|
||||||
if (cntData.getRoofCnt().intValue() < 1) {
|
if (cntData.getRoofCnt().intValue() < 1) {
|
||||||
// 도면/치수/각도 정보 insert
|
// 도면/치수/각도 정보 insert
|
||||||
@ -47,7 +51,7 @@ public class CanvasBasicSettingService {
|
|||||||
for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) {
|
for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) {
|
||||||
|
|
||||||
rma.setObjectNo(csi.getObjectNo());
|
rma.setObjectNo(csi.getObjectNo());
|
||||||
|
log.debug("rma 1111 ::::: " + rma);
|
||||||
// 신규 지붕재추가 정보 insert
|
// 신규 지붕재추가 정보 insert
|
||||||
canvasBasicSettingMapper.insertRoofMaterialsAdd(rma);
|
canvasBasicSettingMapper.insertRoofMaterialsAdd(rma);
|
||||||
}
|
}
|
||||||
@ -63,7 +67,7 @@ public class CanvasBasicSettingService {
|
|||||||
for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) {
|
for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) {
|
||||||
|
|
||||||
rma.setObjectNo(csi.getObjectNo());
|
rma.setObjectNo(csi.getObjectNo());
|
||||||
|
log.debug("rma 22222 ::::: " + rma);
|
||||||
// 신규 지붕재추가 정보 insert
|
// 신규 지붕재추가 정보 insert
|
||||||
canvasBasicSettingMapper.updateRoofMaterialsAdd(rma);
|
canvasBasicSettingMapper.updateRoofMaterialsAdd(rma);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<select id="getCanvasBasicSettingCnt" parameterType="string"
|
<select id="getCanvasBasicSettingCnt" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingInfo">
|
resultType="com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingInfo">
|
||||||
/* sqlid : com.interplug.qcast.canvasBasicSetting.getCanvasBasicSettingCnt Canvas Basic Setting 유무 */
|
/* sqlid : com.interplug.qcast.canvasBasicSetting.getCanvasBasicSettingCnt Canvas Basic Setting 유무 */
|
||||||
SELECT COUNT(1) AS cnt
|
SELECT COUNT(1) AS roofCnt
|
||||||
FROM TB_CANVAS_BASIC_SETUP
|
FROM TB_CANVAS_BASIC_SETUP
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
</select>
|
</select>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<select id="getRoofMaterialsCnt" parameterType="string"
|
<select id="getRoofMaterialsCnt" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo">
|
resultType="com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo">
|
||||||
/* sqlid : com.interplug.qcast.canvasBasicSetting.getRoofMaterialsCnt Canvas 지붕재추가 Setting 유무 */
|
/* sqlid : com.interplug.qcast.canvasBasicSetting.getRoofMaterialsCnt Canvas 지붕재추가 Setting 유무 */
|
||||||
SELECT COUNT(1) AS cnt
|
SELECT COUNT(1) AS roofCnt
|
||||||
FROM TB_CANVAS_BASIC_SETUP
|
FROM TB_CANVAS_BASIC_SETUP
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
AND roof_seq = #{roofSeq}
|
AND roof_seq = #{roofSeq}
|
||||||
@ -102,9 +102,14 @@
|
|||||||
|
|
||||||
<update id="updateRoofMaterialsAdd" parameterType="com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo">
|
<update id="updateRoofMaterialsAdd" parameterType="com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo">
|
||||||
/* sqlid : com.interplug.qcast.canvasBasicSetting.updateRoofMaterialsAdd Canvas 지붕재추가 Setting 수정 */
|
/* sqlid : com.interplug.qcast.canvasBasicSetting.updateRoofMaterialsAdd Canvas 지붕재추가 Setting 수정 */
|
||||||
UPDATE TB_CANVAS_ROOF_MATERIALS_ADD
|
MERGE TB_CANVAS_ROOF_MATERIALS_ADD AS target
|
||||||
SET roof_apply
|
USING (SELECT #{objectNo} AS object_no) AS source
|
||||||
, roof_seq = #{roofSeqv}
|
ON (target.object_no = source.object_no
|
||||||
|
AND target.roof_seq = #{roofSeq})
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE
|
||||||
|
SET roof_apply = #{roofApply}
|
||||||
|
, roof_seq = #{roofSeq}
|
||||||
, roof_matl_cd = #{roofMatlCd}
|
, roof_matl_cd = #{roofMatlCd}
|
||||||
, roof_width = #{roofWidth}
|
, roof_width = #{roofWidth}
|
||||||
, roof_height = #{roofHeight}
|
, roof_height = #{roofHeight}
|
||||||
@ -112,8 +117,33 @@
|
|||||||
, roof_gap = #{roofGap}
|
, roof_gap = #{roofGap}
|
||||||
, roof_layout = #{roofLayout}
|
, roof_layout = #{roofLayout}
|
||||||
, last_edit_datetime = GETDATE()
|
, last_edit_datetime = GETDATE()
|
||||||
WHERE object_no = #{objectNo}
|
WHEN NOT MATCHED THEN
|
||||||
AND roof_seq = #{roofApply}
|
INSERT
|
||||||
|
(
|
||||||
|
object_no
|
||||||
|
, roof_apply
|
||||||
|
, roof_seq
|
||||||
|
, roof_matl_cd
|
||||||
|
, roof_width
|
||||||
|
, roof_height
|
||||||
|
, roof_hajebichi
|
||||||
|
, roof_gap
|
||||||
|
, roof_layout
|
||||||
|
, regist_datetime
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
#{objectNo}
|
||||||
|
, #{roofApply}
|
||||||
|
, #{roofSeq}
|
||||||
|
, #{roofMatlCd}
|
||||||
|
, #{roofWidth}
|
||||||
|
, #{roofHeight}
|
||||||
|
, #{roofHajebichi}
|
||||||
|
, #{roofGap}
|
||||||
|
, #{roofLayout}
|
||||||
|
, GETDATE()
|
||||||
|
);
|
||||||
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteRoofMaterialsAdd" parameterType="string">
|
<delete id="deleteRoofMaterialsAdd" parameterType="string">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user