dwkim лет назад: 2
Родитель
Сommit
6b34c34129

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

@@ -60,7 +60,13 @@ public interface ItemUnitMapper {
60 60
     List<ItemUnitEntity> selectPopWishListItem(@Param("userId") String userId,
61 61
                                                    @Param("wishListMgntNo") String wishListMgntNo,
62 62
                                                    @Param("brandId") String brandId,
63
-                                                   @Param("storeId") String storeId
63
+                                                   @Param("storeId") String storeId,  GridRequest gridRequest
64
+    )throws Exception;
65
+
66
+    int selectPopWishListItemCnt(@Param("userId") String userId,
67
+                                               @Param("wishListMgntNo") String wishListMgntNo,
68
+                                               @Param("brandId") String brandId,
69
+                                               @Param("storeId") String storeId
64 70
     )throws Exception;
65 71
 
66 72
 

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

@@ -686,10 +686,10 @@ public class ItemService extends CommonService {
686 686
         int gridPage = gridRequest.getGridPage();
687 687
         int gridSize = gridRequest.getGridSize();
688 688
 
689
-        int gridRecords = 0;
690
-        int gridTotal = 0;
689
+        int gridRecords = itemUnitMapper.selectPopWishListItemCnt(userId, wishListMgntNo, brandId, storeId);
690
+        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
691 691
 
692
-        List<ItemUnitEntity> entities = itemUnitMapper.selectPopWishListItem(userId, wishListMgntNo, brandId, storeId);
692
+        List<ItemUnitEntity> entities = itemUnitMapper.selectPopWishListItem(userId, wishListMgntNo, brandId, storeId, gridRequest);
693 693
         List<Object> gridRows = entities.stream().
694 694
                 map(m -> ItemPopSearchResponse.builder()
695 695
                         .viewCd("R")

+ 33 - 1
src/main/resources/mybatis/sqlmaps/stinfo/ItemUnit.xml

@@ -692,7 +692,7 @@
692 692
 
693 693
 
694 694
     <select id="selectPopWishListItem" resultType="com.oqpo.api.entity.stinfo.ItemUnitEntity">
695
-        select  /* selectPopItemStoreWishGridList */
695
+        select  /* selectPopWishListItem */
696 696
                iInfo.item_id,iInfo.item_nm,iInfo.podr_pssbl_dvsn, fn_code_nm('PODR_PSSBL_DVSN',iInfo.podr_pssbl_dvsn) AS podr_pssbl_dvsn_nm
697 697
                ,sInfo.unit, fn_code_nm('DSTRBT_COST_UNIT', sInfo.unit) as unit_nm, sInfo.stdd_qty, sInfo.unit_amt
698 698
                , sInfo.store_unit_unq_no,'S' as unit_gubun, sInfo.brand_unit_unq_no
@@ -705,5 +705,37 @@
705 705
         and date_format(now(),'%Y%m%d') between sInfo.cont_stt_dt and sInfo.cont_end_dt
706 706
         where iInfo.brand_id =  #{brandId}
707 707
         AND   iInfo.item_st_cd = 'IS00'
708
+        <choose>
709
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
710
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
711
+                    <if test="gridRequest.sord == 'asc'.toString()">
712
+                        order by iInfo.item_nm asc
713
+                    </if>
714
+                    <if test="gridRequest.sord == 'desc'.toString()">
715
+                        order by iInfo.item_nm desc
716
+                    </if>
717
+                </if>
718
+            </when>
719
+            <otherwise>
720
+                order by iInfo.item_nm asc
721
+            </otherwise>
722
+        </choose>
723
+        <if test="gridRequest.pagingYn == true">
724
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
725
+        </if>
726
+    </select>
727
+
728
+    <select id="selectPopWishListItemCnt" resultType="int">
729
+        select  /* selectPopWishListItemCnt */
730
+                count(*) as cnt
731
+        from item_base_info iInfo
732
+        join store_base_info store on iInfo.brand_id = store.brand_id   and store.store_id = #{storeId}
733
+        join store_item_unit_info sInfo on iInfo.brand_id = sInfo.brand_id and iInfo.item_id = sInfo.item_id and sInfo.unit_target_cd = 'Y'
734
+        join store_wish_list_mgnt wish on wish_list_mgnt_no =  #{wishListMgntNo}  and wish.store_id = store.store_id and wish.del_yn = 'N'
735
+        join store_wish_list_ptcl wishptcl on wish.wish_list_mgnt_no = wishptcl.wish_list_mgnt_no and wishptcl.item_id = iInfo.item_id and wishptcl.del_yn = 'N'
736
+        and store.store_id = sInfo.store_id  and sInfo.store_id =  #{storeId}
737
+        and date_format(now(),'%Y%m%d') between sInfo.cont_stt_dt and sInfo.cont_end_dt
738
+        where iInfo.brand_id =  #{brandId}
739
+        AND   iInfo.item_st_cd = 'IS00'
708 740
     </select>
709 741
 </mapper>

+ 1 - 1
src/main/resources/mybatis/sqlmaps/system/Auth.xml

@@ -105,7 +105,7 @@
105 105
         (auth_no, menu_no, use_yn, wr_yn, add_dt, add_id, chg_dt, chg_id)
106 106
         values
107 107
         <foreach collection="gridUpdateData" item="item" separator=",">
108
-            ( #{item.authNo},#{item.menuNo},#{item.readYn},#{item.writeYn}, now(), #{userId}, now(), #{userId})
108
+            ( #{item.authNo},#{item.menuNo}, case when #{item.readYn} = 'N' and #{item.writeYn} = 'N' then 'N' else 'Y' end ,#{item.writeYn}, now(), #{userId}, now(), #{userId})
109 109
         </foreach>
110 110
         on duplicate key
111 111
         update