Selaa lähdekoodia

매장 단가 조회 쿼리 수정

dwkim 2 vuotta sitten
vanhempi
commit
e9d155d8f9

+ 1 - 1
src/main/java/com/oqpo/api/mapper/stinfo/StoreItemUnitMapper.java

@@ -12,7 +12,7 @@ import java.util.List;
12 12
 public interface StoreItemUnitMapper {
13 13
 
14 14
     List<StoreItemUnitEntity> selectStoreItemUnitGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId , GridRequest gridRequest)throws Exception;
15
-    int selectStoreItemUnitGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId )throws Exception;
15
+    int selectStoreItemUnitGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreNm") String sStoreNm )throws Exception;
16 16
 /*
17 17
     List<StoreItemUnitEntity> selectSstoreItemUnitGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId , GridRequest gridRequest)throws Exception;
18 18
     int selectSstoreItemUnitGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId )throws Exception;

+ 3 - 3
src/main/java/com/oqpo/api/service/stinfo/ItemUnitService.java

@@ -201,13 +201,13 @@ public class ItemUnitService extends CommonService {
201 201
     /*
202 202
       브랜드 매장 단가 리스트 조회
203 203
      */
204
-    public GridResponse selectStoreItemUnitGridList(String sBrandId, String sStoreId,  GridRequest gridRequest) throws Exception {
204
+    public GridResponse selectStoreItemUnitGridList(String sBrandId, String sStoreNm,  GridRequest gridRequest) throws Exception {
205 205
         int gridPage = gridRequest.getGridPage();
206 206
         int gridSize = gridRequest.getGridSize();
207 207
 
208
-        int gridRecords = storeItemUnitMapper.selectStoreItemUnitGridCnt( sBrandId, sStoreId );
208
+        int gridRecords = storeItemUnitMapper.selectStoreItemUnitGridCnt( sBrandId, sStoreNm );
209 209
         int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
210
-        List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitGridList(sBrandId, sStoreId, gridRequest);
210
+        List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitGridList(sBrandId, sStoreNm, gridRequest);
211 211
         List<Object> gridRows = entities.stream()
212 212
                 .map(m -> StoreItemUnitSearchResponse.builder()
213 213
                         .viewCd("R")

+ 4 - 4
src/main/java/com/oqpo/api/web/controller/stinfo/ItemUnitController.java

@@ -124,11 +124,11 @@ public class ItemUnitController {
124 124
     public ResponseEntity<GridResponse> storeDetailGridList(@ApiIgnore String authTpCd, @RequestBody @Valid StoreItemUnitSearchGridRequest storeItemUnitSearchGridRequest) throws Exception {
125 125
 
126 126
         //System.out.println("============================>" +authTpCd );
127
-        if ("50".equals(authTpCd)  && "".equals(storeItemUnitSearchGridRequest.getSStoreId())) {
128
-            throw new GlobalException(SystemMessageCode.ERR_NONSTOREID);
129
-        }
127
+        //if ("50".equals(authTpCd)  && "".equals(storeItemUnitSearchGridRequest.getSStoreNm())) {
128
+        //    throw new GlobalException(SystemMessageCode.ERR_NONSTOREID);
129
+        //}
130 130
 
131
-        return ResponseEntity.ok(itemUnitService.selectStoreItemUnitGridList(storeItemUnitSearchGridRequest.getSBrandId(),storeItemUnitSearchGridRequest.getSStoreId(),  storeItemUnitSearchGridRequest.toDTO(storeItemUnitSearchGridRequest)));
131
+        return ResponseEntity.ok(itemUnitService.selectStoreItemUnitGridList(storeItemUnitSearchGridRequest.getSBrandId(),storeItemUnitSearchGridRequest.getSStoreNm(),  storeItemUnitSearchGridRequest.toDTO(storeItemUnitSearchGridRequest)));
132 132
     }
133 133
 
134 134
     /**

+ 1 - 1
src/main/java/com/oqpo/api/web/dto/request/stinfo/itemUnit/StoreItemUnitSearchGridRequest.java

@@ -17,7 +17,7 @@ public class StoreItemUnitSearchGridRequest extends GridRequest {
17 17
     private String sBrandId;
18 18
 
19 19
     @ApiModelProperty(value = "매장아이디")
20
-    private String sStoreId;
20
+    private String sStoreNm;
21 21
 
22 22
     protected StoreItemUnitSearchGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
23 23
         super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);

+ 4 - 4
src/main/resources/mybatis/sqlmaps/stinfo/StoreItemUnit.xml

@@ -12,8 +12,8 @@
12 12
         select  brand_id, store_id, cont_stt_dt, cont_end_dt, min(sys_reg_dttm) as sys_reg_dttm, count(*) as item_cnt
13 13
         from    store_item_unit_info
14 14
         where   brand_id = #{sBrandId}
15
-        <if test="sStoreId != null and sStoreId != ''">
16
-            and     store_id = #{sStoreId}
15
+        <if test="sStoreNm != null and sStoreNm != ''">
16
+            and     store_nm like concat('%', #{sStoreNm}, '%')
17 17
         </if>
18 18
         and     unit_target_cd = 'Y'
19 19
         group by brand_id, store_id, cont_stt_dt, cont_end_dt
@@ -45,8 +45,8 @@
45 45
         select  distinct brand_id, store_id, cont_stt_dt, cont_end_dt
46 46
         from    store_item_unit_info
47 47
         where   brand_id = #{sBrandId}
48
-        <if test="sStoreId != null and sStoreId != ''">
49
-            and     store_id = #{sStoreId}
48
+        <if test="sStoreNm != null and sStoreNm != ''">
49
+            and     store_nm like concat('%', #{sStoreNm}, '%')
50 50
         </if>
51 51
         and     unit_target_cd = 'Y'
52 52
         ) iunit