물건정보 갱신일 수정 API 개발

This commit is contained in:
LAPTOP-L3VE7KK2\USER 2025-01-15 10:27:25 +09:00
parent 8c42932f8b
commit db10023a63
4 changed files with 54 additions and 0 deletions

View File

@ -93,6 +93,13 @@ public class ObjectController {
return objectService.updateObject(objectRequest);
}
@Operation(description = "물건정보 갱신일을 수정한다.")
@PutMapping("/update-object-date")
@ResponseStatus(HttpStatus.CREATED)
public void updateObjectLastEditDate(@RequestBody ObjectRequest objectRequest) throws Exception {
objectService.updateObjectLastEditDate(objectRequest);
}
@Operation(description = "물건정보을 삭제한다.")
@DeleteMapping("/{objectNo}")
@ResponseStatus(HttpStatus.NO_CONTENT)

View File

@ -49,6 +49,9 @@ public interface ObjectMapper {
// 물건정보 수정
public int updateObject(ObjectRequest objectRequest);
// 물건정보 갱신일 수정
public int updateObjectLastEditDate(ObjectRequest objectRequest);
// 물건정보 삭제
public int deleteObject(ObjectRequest objectRequest);

View File

@ -398,6 +398,28 @@ public class ObjectService {
return objectResponse;
}
/**
* 물건정보 갱신일 수정
*
* @param objectRequest
* @throws Exception
*/
public void updateObjectLastEditDate(ObjectRequest objectRequest) throws Exception {
// Validation
if (StringUtils.isEmpty(objectRequest.getObjectNo())) {
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Object No"));
}
try {
// object 갱신일 수정
objectMapper.updateObjectLastEditDate(objectRequest);
} catch (Exception e) {
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
}
}
/**
* 물건정보 삭제
*

View File

@ -632,6 +632,28 @@
WHERE OBJECT_NO = #{objectNo}
</update>
<update id="updateObjectLastEditDate" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest">
/* sqlid : com.interplug.qcast.biz.object.updateObjectLastEditDate */
UPDATE T_OBJECT
SET
OBJECT_NO = #{objectNo}
<if test='standardWindSpeedId != null and standardWindSpeedId != ""'>
, STANDARD_WIND_SPEED_ID = #{standardWindSpeedId}
</if>
<if test='verticalSnowCover != null and verticalSnowCover != ""'>
, VERTICAL_SNOW_COVER = #{verticalSnowCover}
</if>
<if test='surfaceType != null and surfaceType != ""'>
, SURFACE_TYPE = #{surfaceType}
</if>
<if test='installHeight != null and installHeight != ""'>
, INSTALL_HEIGHT = #{installHeight}
</if>
, LAST_EDIT_DATETIME = GETDATE()
, LAST_EDIT_USER = #{userId}
WHERE OBJECT_NO = #{objectNo}
</update>
<update id="updateObjectDelivery" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest">
/* sqlid : com.interplug.qcast.biz.object.updateObjectDelivery */
UPDATE A SET