[Spring][쇼핑몰 프로젝트][29] 상품 이미지 수정 - 5(배치 프로그램 적용 2)

https://kimvampa.tistory.com/239
This commit is contained in:
SeoJin Kim
2021-07-26 20:55:43 +09:00
parent 670f3a5fa2
commit 7e79e3be36
8 changed files with 61 additions and 4 deletions

View File

@@ -36,4 +36,7 @@ public interface AdminMapper {
/* 지정 상품 이미지 전체 삭제 */
public void deleteImageAll(int bookId);
/* 어제자 날짜 이미지 리스트 */
public List<AttachImageVO> checkFileList();
}

View File

@@ -101,5 +101,12 @@
delete FROM vam_image where bookId = #{bookId}
</delete>
<!-- 어제자 날자 이미지 리스트 -->
<select id="checkFileList" resultType="com.vam.model.AttachImageVO">
select * from vam_image where uploadpath = to_char(sysdate -1, 'yyyy\mm\dd')
</select>
</mapper>

View File

@@ -152,6 +152,7 @@ public class AdminMapperTests {
*/
/* 지정 상품 이미지 삭제 */
/*
@Test
public void deleteImageAllTest() {
@@ -160,6 +161,15 @@ public class AdminMapperTests {
mapper.deleteImageAll(bookId);
}
*/
/* 어제자 날짜 이미지 리스트 */
@Test
public void checkImageListTest() {
mapper.checkFileList();
}

View File

@@ -101,5 +101,12 @@
delete FROM vam_image where bookId = #{bookId}
</delete>
<!-- 어제자 날자 이미지 리스트 -->
<select id="checkFileList" resultType="com.vam.model.AttachImageVO">
select * from vam_image where uploadpath = to_char(sysdate -1, 'yyyy\mm\dd')
</select>
</mapper>

View File

@@ -36,4 +36,7 @@ public interface AdminMapper {
/* 지정 상품 이미지 전체 삭제 */
public void deleteImageAll(int bookId);
/* 어제자 날짜 이미지 리스트 */
public List<AttachImageVO> checkFileList();
}

View File

@@ -90,6 +90,13 @@
delete FROM vam_image where bookId = #{bookId}
</delete>
</delete>
<!-- 어제자 날자 이미지 리스트 -->
<select id="checkFileList" resultType="com.vam.model.AttachImageVO">
select * from vam_image where uploadpath = DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), '%Y\%m\%d')
</select>
</mapper>

View File

@@ -16,7 +16,7 @@ public class AdminMapperTests {
private AdminMapper mapper;
/* 상품 등록 */
/*
@Test
public void bookEnrollTest() throws Exception{
@@ -40,6 +40,7 @@ public class AdminMapperTests {
System.out.println("After BookVO :" + book);
}
*/
/* 카테고리 리스트 */
@@ -151,6 +152,7 @@ public class AdminMapperTests {
*/
/* 지정 상품 이미지 삭제 */
/*
@Test
public void deleteImageAllTest() {
@@ -158,6 +160,17 @@ public class AdminMapperTests {
mapper.deleteImageAll(bookId);
}
}
*/
/* 어제자 날짜 이미지 리스트 */
@Test
public void checkImageListTest() {
mapper.checkFileList();
}
}

View File

@@ -90,6 +90,13 @@
delete FROM vam_image where bookId = #{bookId}
</delete>
</delete>
<!-- 어제자 날자 이미지 리스트 -->
<select id="checkFileList" resultType="com.vam.model.AttachImageVO">
select * from vam_image where uploadpath = DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), '%Y\%m\%d')
</select>
</mapper>