style: canvas status 패키지 내 코드 포맷터 적용
This commit is contained in:
parent
af63ec39ac
commit
646136206e
@ -19,41 +19,42 @@ public class CanvasStatusController {
|
|||||||
|
|
||||||
@Operation(description = "계정에 해당하는 전체 견적서를 조회 한다.")
|
@Operation(description = "계정에 해당하는 전체 견적서를 조회 한다.")
|
||||||
@GetMapping("/canvas-statuses/{userId}")
|
@GetMapping("/canvas-statuses/{userId}")
|
||||||
public List<CanvasStatusResponse> selectAllCanvasStatus(@PathVariable String userId) throws QcastException {
|
public List<CanvasStatusResponse> selectAllCanvasStatus(@PathVariable String userId)
|
||||||
|
throws QcastException {
|
||||||
return canvasStatusService.selectAllCanvasStatus(userId);
|
return canvasStatusService.selectAllCanvasStatus(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(description = "견적서를 조회 한다.")
|
@Operation(description = "견적서를 조회 한다.")
|
||||||
@GetMapping("/canvas-statuses/by-object/{objectNo}/{userId}")
|
@GetMapping("/canvas-statuses/by-object/{objectNo}/{userId}")
|
||||||
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(@PathVariable String objectNo, @PathVariable String userId) throws QcastException {
|
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(
|
||||||
|
@PathVariable String objectNo, @PathVariable String userId) throws QcastException {
|
||||||
return canvasStatusService.selectObjectNoCanvasStatus(objectNo, userId);
|
return canvasStatusService.selectObjectNoCanvasStatus(objectNo, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(description = "견적서를 등록 한다.")
|
@Operation(description = "견적서를 등록 한다.")
|
||||||
@PostMapping("/canvas-statuses")
|
@PostMapping("/canvas-statuses")
|
||||||
@ResponseStatus(HttpStatus.CREATED)
|
@ResponseStatus(HttpStatus.CREATED)
|
||||||
public Integer insertCanvasStatus(@RequestBody CanvasStatus cs) throws QcastException {
|
public Integer insertCanvasStatus(@RequestBody CanvasStatus cs) throws QcastException {
|
||||||
return canvasStatusService.insertCanvasStatus(cs);
|
return canvasStatusService.insertCanvasStatus(cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(description = "견적서를 수정 한다.")
|
@Operation(description = "견적서를 수정 한다.")
|
||||||
@PutMapping("/canvas-statuses")
|
@PutMapping("/canvas-statuses")
|
||||||
public void updateCanvasStatus(@RequestBody CanvasStatus cs) throws QcastException {
|
public void updateCanvasStatus(@RequestBody CanvasStatus cs) throws QcastException {
|
||||||
canvasStatusService.updateCanvasStatus(cs);
|
canvasStatusService.updateCanvasStatus(cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(description = "견적서를 삭제 한다.")
|
@Operation(description = "견적서를 삭제 한다.")
|
||||||
@DeleteMapping("/canvas-statuses/by-object/{objectNo}")
|
@DeleteMapping("/canvas-statuses/by-object/{objectNo}")
|
||||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||||
public void deleteObjectNoCanvasStatus(@PathVariable String objectNo) throws QcastException {
|
public void deleteObjectNoCanvasStatus(@PathVariable String objectNo) throws QcastException {
|
||||||
canvasStatusService.deleteObjectNoCanvasStatus(objectNo);
|
canvasStatusService.deleteObjectNoCanvasStatus(objectNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(description = "견적서의 이미지(템플릿)를 삭제 한다.")
|
@Operation(description = "견적서의 이미지(템플릿)를 삭제 한다.")
|
||||||
@DeleteMapping("/canvas-statuses/by-id/{id}")
|
@DeleteMapping("/canvas-statuses/by-id/{id}")
|
||||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||||
public void deleteIdCanvasStatus(@PathVariable Integer id) throws QcastException {
|
public void deleteIdCanvasStatus(@PathVariable Integer id) throws QcastException {
|
||||||
canvasStatusService.deleteIdCanvasStatus(id);
|
canvasStatusService.deleteIdCanvasStatus(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,46 +2,42 @@ package com.interplug.qcast.biz.canvasStatus;
|
|||||||
|
|
||||||
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus;
|
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus;
|
||||||
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CanvasStatusMapper {
|
public interface CanvasStatusMapper {
|
||||||
|
|
||||||
// objectNo 생성(미사용)
|
// objectNo 생성(미사용)
|
||||||
public CanvasStatus getCanvasStatusNewObjectNo(String userId);
|
public CanvasStatus getCanvasStatusNewObjectNo(String userId);
|
||||||
|
|
||||||
// imageName 생성(미사용)
|
|
||||||
public CanvasStatus getCanvasStatusImageAdd(String objectNo);
|
|
||||||
|
|
||||||
// 전체 견적서 조회
|
|
||||||
public List<CanvasStatusResponse> selectAllCanvasStatus(String userId);
|
|
||||||
|
|
||||||
// 견적서 조회(objectNo/userId)
|
|
||||||
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId);
|
|
||||||
|
|
||||||
// 견적서 조회(Max id)
|
|
||||||
public List<CanvasStatusResponse> getMaxIdCanvasStatus(String objectNo, String userId);
|
|
||||||
|
|
||||||
// 견적서 조회(id별)
|
|
||||||
public List<CanvasStatusResponse> getIdCanvasStatus(Integer id);
|
|
||||||
|
|
||||||
// 견적서 조회(objectNo)
|
|
||||||
public List<CanvasStatusResponse> getObjectNoCanvasStatus(String objectNo);
|
|
||||||
|
|
||||||
// 견적서 등록
|
|
||||||
public void insertCanvasStatus(CanvasStatus cs);
|
|
||||||
|
|
||||||
// 견적서 수정
|
|
||||||
public void updateCanvasStatus(CanvasStatus cs);
|
|
||||||
|
|
||||||
// 견적서 삭제
|
|
||||||
public void deleteObjectNoCanvasStatus(String objectNo);
|
|
||||||
|
|
||||||
// 이미지(템플릿) 삭제
|
|
||||||
public void deleteIdCanvasStatus(Integer id);
|
|
||||||
|
|
||||||
|
// imageName 생성(미사용)
|
||||||
}
|
public CanvasStatus getCanvasStatusImageAdd(String objectNo);
|
||||||
|
|
||||||
|
// 전체 견적서 조회
|
||||||
|
public List<CanvasStatusResponse> selectAllCanvasStatus(String userId);
|
||||||
|
|
||||||
|
// 견적서 조회(objectNo/userId)
|
||||||
|
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId);
|
||||||
|
|
||||||
|
// 견적서 조회(Max id)
|
||||||
|
public List<CanvasStatusResponse> getMaxIdCanvasStatus(String objectNo, String userId);
|
||||||
|
|
||||||
|
// 견적서 조회(id별)
|
||||||
|
public List<CanvasStatusResponse> getIdCanvasStatus(Integer id);
|
||||||
|
|
||||||
|
// 견적서 조회(objectNo)
|
||||||
|
public List<CanvasStatusResponse> getObjectNoCanvasStatus(String objectNo);
|
||||||
|
|
||||||
|
// 견적서 등록
|
||||||
|
public void insertCanvasStatus(CanvasStatus cs);
|
||||||
|
|
||||||
|
// 견적서 수정
|
||||||
|
public void updateCanvasStatus(CanvasStatus cs);
|
||||||
|
|
||||||
|
// 견적서 삭제
|
||||||
|
public void deleteObjectNoCanvasStatus(String objectNo);
|
||||||
|
|
||||||
|
// 이미지(템플릿) 삭제
|
||||||
|
public void deleteIdCanvasStatus(Integer id);
|
||||||
|
}
|
||||||
|
|||||||
@ -4,119 +4,119 @@ import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus;
|
|||||||
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
||||||
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;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CanvasStatusService {
|
public class CanvasStatusService {
|
||||||
private final CanvasStatusMapper canvasStatusMapper;
|
private final CanvasStatusMapper canvasStatusMapper;
|
||||||
|
|
||||||
// 전체 견적서 조회
|
// 전체 견적서 조회
|
||||||
public List<CanvasStatusResponse> selectAllCanvasStatus(String userId) throws QcastException {
|
public List<CanvasStatusResponse> selectAllCanvasStatus(String userId) throws QcastException {
|
||||||
List<CanvasStatusResponse> result = null;
|
List<CanvasStatusResponse> result = null;
|
||||||
|
|
||||||
if (userId != null && !userId.trim().isEmpty()) {
|
|
||||||
result = canvasStatusMapper.selectAllCanvasStatus(userId);
|
|
||||||
} else {
|
|
||||||
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 견적서 조회(objectNo)
|
if (userId != null && !userId.trim().isEmpty()) {
|
||||||
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId) throws QcastException {
|
result = canvasStatusMapper.selectAllCanvasStatus(userId);
|
||||||
List<CanvasStatusResponse> result = null;
|
} else {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
|
||||||
if (objectNo != null && !objectNo.trim().isEmpty() && userId != null && !userId.trim().isEmpty()) {
|
}
|
||||||
result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo, userId);
|
|
||||||
} else {
|
|
||||||
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 견적서 등록
|
return result;
|
||||||
public Integer insertCanvasStatus(CanvasStatus cs) throws QcastException {
|
}
|
||||||
|
|
||||||
Integer id = 0;
|
|
||||||
|
|
||||||
// 데이터가 없으면 저장
|
|
||||||
try {
|
|
||||||
canvasStatusMapper.insertCanvasStatus(cs);
|
|
||||||
|
|
||||||
// 데이터 저장 후 Max id 확인
|
|
||||||
List<CanvasStatusResponse> maxId = canvasStatusMapper.getMaxIdCanvasStatus(cs.getObjectNo(), cs.getUserId());
|
|
||||||
id = maxId.get(0).getId();
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"견적서 등록 중 오류 발생");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 생성된 id 반환
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 견적서 수정
|
// 견적서 조회(objectNo)
|
||||||
public void updateCanvasStatus(CanvasStatus cs) throws QcastException {
|
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId)
|
||||||
|
throws QcastException {
|
||||||
|
List<CanvasStatusResponse> result = null;
|
||||||
|
|
||||||
if (cs.getId() == null) {
|
if (objectNo != null
|
||||||
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
|
&& !objectNo.trim().isEmpty()
|
||||||
}
|
&& userId != null
|
||||||
|
&& !userId.trim().isEmpty()) {
|
||||||
// 먼저 데이터가 존재하는지 확인
|
result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo, userId);
|
||||||
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(cs.getId());
|
} else {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
return result;
|
||||||
if (existingStatus.size() > 0) {
|
}
|
||||||
canvasStatusMapper.updateCanvasStatus(cs);
|
|
||||||
} else {
|
|
||||||
throw new QcastException (ErrorCode.NOT_FOUND ,"수정할 견적서가 존재하지 않습니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 전체 견적서 삭제
|
// 견적서 등록
|
||||||
public void deleteObjectNoCanvasStatus(String objectNo) throws QcastException {
|
public Integer insertCanvasStatus(CanvasStatus cs) throws QcastException {
|
||||||
|
|
||||||
if (objectNo == null || objectNo.trim().isEmpty()) {
|
|
||||||
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 먼저 데이터가 존재하는지 확인
|
|
||||||
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getObjectNoCanvasStatus(objectNo);
|
|
||||||
|
|
||||||
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
|
||||||
if (existingStatus.size() > 0) {
|
|
||||||
canvasStatusMapper.deleteObjectNoCanvasStatus(objectNo);
|
|
||||||
} else {
|
|
||||||
throw new QcastException (ErrorCode.NOT_FOUND ,"삭제할 견적서가 존재하지 않습니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 이미지(템플릿) 삭제
|
Integer id = 0;
|
||||||
public void deleteIdCanvasStatus(Integer id) throws QcastException {
|
|
||||||
|
|
||||||
if (id == null) {
|
|
||||||
throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 먼저 데이터가 존재하는지 확인
|
|
||||||
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(id);
|
|
||||||
|
|
||||||
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
|
||||||
if (existingStatus.size() > 0) {
|
|
||||||
canvasStatusMapper.deleteIdCanvasStatus(id);
|
|
||||||
} else {
|
|
||||||
throw new QcastException (ErrorCode.NOT_FOUND ,"삭제할 견적서가 존재하지 않습니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 데이터가 없으면 저장
|
||||||
|
try {
|
||||||
|
canvasStatusMapper.insertCanvasStatus(cs);
|
||||||
|
|
||||||
|
// 데이터 저장 후 Max id 확인
|
||||||
|
List<CanvasStatusResponse> maxId =
|
||||||
|
canvasStatusMapper.getMaxIdCanvasStatus(cs.getObjectNo(), cs.getUserId());
|
||||||
|
id = maxId.get(0).getId();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "견적서 등록 중 오류 발생");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 생성된 id 반환
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 견적서 수정
|
||||||
|
public void updateCanvasStatus(CanvasStatus cs) throws QcastException {
|
||||||
|
|
||||||
|
if (cs.getId() == null) {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 먼저 데이터가 존재하는지 확인
|
||||||
|
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(cs.getId());
|
||||||
|
|
||||||
|
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
||||||
|
if (existingStatus.size() > 0) {
|
||||||
|
canvasStatusMapper.updateCanvasStatus(cs);
|
||||||
|
} else {
|
||||||
|
throw new QcastException(ErrorCode.NOT_FOUND, "수정할 견적서가 존재하지 않습니다.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 전체 견적서 삭제
|
||||||
|
public void deleteObjectNoCanvasStatus(String objectNo) throws QcastException {
|
||||||
|
|
||||||
|
if (objectNo == null || objectNo.trim().isEmpty()) {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 먼저 데이터가 존재하는지 확인
|
||||||
|
List<CanvasStatusResponse> existingStatus =
|
||||||
|
canvasStatusMapper.getObjectNoCanvasStatus(objectNo);
|
||||||
|
|
||||||
|
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
||||||
|
if (existingStatus.size() > 0) {
|
||||||
|
canvasStatusMapper.deleteObjectNoCanvasStatus(objectNo);
|
||||||
|
} else {
|
||||||
|
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 견적서가 존재하지 않습니다.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 이미지(템플릿) 삭제
|
||||||
|
public void deleteIdCanvasStatus(Integer id) throws QcastException {
|
||||||
|
|
||||||
|
if (id == null) {
|
||||||
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 먼저 데이터가 존재하는지 확인
|
||||||
|
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getIdCanvasStatus(id);
|
||||||
|
|
||||||
|
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
||||||
|
if (existingStatus.size() > 0) {
|
||||||
|
canvasStatusMapper.deleteIdCanvasStatus(id);
|
||||||
|
} else {
|
||||||
|
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 견적서가 존재하지 않습니다.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,125 +1,128 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.interplug.qcast.biz.canvasStatus.CanvasStatusMapper">
|
<mapper namespace="com.interplug.qcast.biz.canvasStatus.CanvasStatusMapper">
|
||||||
|
|
||||||
<select id="getCanvasStatusNewObjectNo" parameterType="string"
|
<select id="getCanvasStatusNewObjectNo" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusNewObjectNo */
|
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusNewObjectNo */
|
||||||
SELECT #{userId} + FORMAT(GETDATE(), 'yyMMdd') + RIGHT('000' + CAST(ISNULL(MAX(CAST(RIGHT(object_no, 3) AS INT)), 0) + 1 AS VARCHAR (3)), 3) AS objectNo
|
SELECT #{userId} + FORMAT(GETDATE(), 'yyMMdd') + RIGHT('000' + CAST(ISNULL(MAX(CAST(RIGHT(object_no, 3) AS INT)), 0) + 1 AS VARCHAR (3)), 3) AS objectNo
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE object_no LIKE #{userId} + FORMAT(GETDATE(), 'yyMMdd') + '%'
|
WHERE object_no LIKE #{userId} + FORMAT(GETDATE(), 'yyMMdd') + '%'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCanvasStatusImageAdd" parameterType="string"
|
<select id="getCanvasStatusImageAdd" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusImageAdd */
|
/* sqlid : com.interplug.qcast.canvasStatus.getCanvasStatusImageAdd */
|
||||||
SELECT 'image' + RIGHT('00' + CAST(ISNULL(MAX(CAST(RIGHT(image_name, 2) AS INT)), 0) + 1 AS VARCHAR (2)), 2) AS imageName
|
SELECT 'image' + RIGHT('00' + CAST(ISNULL(MAX(CAST(RIGHT(image_name, 2) AS INT)), 0) + 1 AS VARCHAR (2)), 2) AS imageName
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllCanvasStatus" parameterType="string"
|
<select id="selectAllCanvasStatus" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.selectAllCanvasStatus 전체 견적서 조회 */
|
/* sqlid : com.interplug.qcast.canvasStatus.selectAllCanvasStatus 전체 견적서 조회 */
|
||||||
SELECT id
|
SELECT id
|
||||||
, user_id
|
, user_id
|
||||||
, object_no
|
, object_no
|
||||||
, image_name
|
, image_name
|
||||||
, canvas_status
|
, canvas_status
|
||||||
, regist_datetime
|
, regist_datetime
|
||||||
, last_edit_datetime
|
, last_edit_datetime
|
||||||
, bg_image_name
|
, bg_image_name
|
||||||
, map_position_address
|
, map_position_address
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE user_id = #{userId}
|
WHERE user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectObjectNoCanvasStatus" parameterType="string"
|
<select id="selectObjectNoCanvasStatus" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.selectObjectNoCanvasStatus 견적서 조회 */
|
/* sqlid : com.interplug.qcast.canvasStatus.selectObjectNoCanvasStatus 견적서 조회 */
|
||||||
SELECT id
|
SELECT id
|
||||||
, user_id
|
, user_id
|
||||||
, object_no
|
, object_no
|
||||||
, image_name
|
, image_name
|
||||||
, canvas_status
|
, canvas_status
|
||||||
, regist_datetime
|
, regist_datetime
|
||||||
, last_edit_datetime
|
, last_edit_datetime
|
||||||
, bg_image_name
|
, bg_image_name
|
||||||
, map_position_address
|
, map_position_address
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
<if test="userId != null and userId != ''">
|
<if test="userId != null and userId != ''">
|
||||||
AND user_id = #{userId}
|
AND user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMaxIdCanvasStatus" parameterType="string"
|
<select id="getMaxIdCanvasStatus" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.getMaxIdCanvasStatus 견적서 조회(Max id) */
|
/* sqlid : com.interplug.qcast.canvasStatus.getMaxIdCanvasStatus 견적서 조회(Max id) */
|
||||||
SELECT MAX(id) AS id
|
SELECT MAX(id) AS id
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
AND user_id = #{userId}
|
AND user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getIdCanvasStatus" parameterType="integer"
|
<select id="getIdCanvasStatus" parameterType="integer"
|
||||||
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.getIdCanvasStatus 견적서 조회(id별) */
|
/* sqlid : com.interplug.qcast.canvasStatus.getIdCanvasStatus 견적서 조회(id별) */
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getObjectNoCanvasStatus" parameterType="string"
|
<select id="getObjectNoCanvasStatus" parameterType="string"
|
||||||
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
resultType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.getObjectNoCanvasStatus 견적서 조회 */
|
/* sqlid : com.interplug.qcast.canvasStatus.getObjectNoCanvasStatus 견적서 조회 */
|
||||||
SELECT object_no
|
SELECT object_no
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertCanvasStatus" parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
<insert id="insertCanvasStatus"
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.insertCanvasStatus 견적서 등록 */
|
parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
||||||
INSERT INTO TB_CANVAS_STATUS
|
/* sqlid : com.interplug.qcast.canvasStatus.insertCanvasStatus 견적서 등록 */
|
||||||
( user_id
|
INSERT INTO TB_CANVAS_STATUS
|
||||||
, object_no
|
( user_id
|
||||||
, image_name
|
, object_no
|
||||||
, canvas_status
|
, image_name
|
||||||
, regist_datetime
|
, canvas_status
|
||||||
, bg_image_name
|
, regist_datetime
|
||||||
, map_position_address)
|
, bg_image_name
|
||||||
VALUES ( #{userId}
|
, map_position_address)
|
||||||
, #{objectNo}
|
VALUES ( #{userId}
|
||||||
, #{imageName}
|
, #{objectNo}
|
||||||
, #{canvasStatus}
|
, #{imageName}
|
||||||
, GETDATE()
|
, #{canvasStatus}
|
||||||
, #{bgImageName}
|
, GETDATE()
|
||||||
, #{mapPositionAddress})
|
, #{bgImageName}
|
||||||
</insert>
|
, #{mapPositionAddress})
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateCanvasStatus" parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
<update id="updateCanvasStatus"
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.updateCanvasStatus 견적서 수정 */
|
parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
||||||
UPDATE TB_CANVAS_STATUS
|
/* sqlid : com.interplug.qcast.canvasStatus.updateCanvasStatus 견적서 수정 */
|
||||||
SET canvas_status = #{canvasStatus}
|
UPDATE TB_CANVAS_STATUS
|
||||||
, bg_image_name = #{bgImageName}
|
SET canvas_status = #{canvasStatus}
|
||||||
, map_position_address = #{mapPositionAddress}
|
, bg_image_name = #{bgImageName}
|
||||||
, last_edit_datetime = GETDATE()
|
, map_position_address = #{mapPositionAddress}
|
||||||
WHERE id = #{id}
|
, last_edit_datetime = GETDATE()
|
||||||
</update>
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteObjectNoCanvasStatus" parameterType="string">
|
<delete id="deleteObjectNoCanvasStatus" parameterType="string">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.deleteObjectNoCanvasStatus 견적서 삭제 */
|
/* sqlid : com.interplug.qcast.canvasStatus.deleteObjectNoCanvasStatus 견적서 삭제 */
|
||||||
DELETE
|
DELETE
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteIdCanvasStatus" parameterType="integer">
|
<delete id="deleteIdCanvasStatus" parameterType="integer">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.deleteIdCanvasStatus 이미지(템플릿) 삭제 */
|
/* sqlid : com.interplug.qcast.canvasStatus.deleteIdCanvasStatus 이미지(템플릿) 삭제 */
|
||||||
DELETE
|
DELETE
|
||||||
FROM TB_CANVAS_STATUS
|
FROM TB_CANVAS_STATUS
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
x
Reference in New Issue
Block a user