Browse Source

구매요청현황 , 반품요청현황 수정

dwkim 2 years ago
parent
commit
6a8a947021

+ 6 - 0
src/main/resources/mybatis/sqlmaps/pomng/PchReq.xml

@@ -14,6 +14,9 @@
14 14
                 ,date_format(pch_req_dt,'%Y.%m.%d') as pch_req_dt
15 15
         from   pch_req_base_info
16 16
         where  brand_id = #{sBrandId}
17
+        <if test="sStoreId == null or sStoreId == ''">
18
+            and   ((store_id is null or store_id = '') or (store_id is not null and store_id <![CDATA[ <> ]]> '' and pch_req_st_cd <![CDATA[ <> ]]> 'PR00'))
19
+        </if>
17 20
         <if test="sStoreId != null and sStoreId != ''">
18 21
         and    store_id = #{sStoreId}
19 22
         </if>
@@ -53,6 +56,9 @@
53 56
             select count(*) as cnt
54 57
             from   pch_req_base_info
55 58
             where  brand_id = #{sBrandId}
59
+            <if test="sStoreId == null or sStoreId == ''">
60
+                and   ((store_id is null or store_id = '') or (store_id is not null and store_id <![CDATA[ <> ]]> '' and pch_req_st_cd <![CDATA[ <> ]]> 'PR00'))
61
+            </if>
56 62
             <if test="sStoreId != null and sStoreId != ''">
57 63
                 and    store_id = #{sStoreId}
58 64
             </if>

+ 12 - 0
src/main/resources/mybatis/sqlmaps/rtnmng/RtnReq.xml

@@ -102,6 +102,9 @@
102 102
         from rtn_req_base_info base
103 103
         where 1 = 1
104 104
         and base.brand_id = #{sBrandId}
105
+        <if test="sStoreId == null or sStoreId == ''">
106
+            and   ((base.store_id is null or base.store_id = '') or (base.store_id is not null and base.store_id <![CDATA[ <> ]]> '' and base.rtn_req_st_cd <![CDATA[ <> ]]> 'RR00'))
107
+        </if>
105 108
         and base.col_req_dt between #{fromDt} and #{toDt}
106 109
         <if test="sStoreId != null and sStoreId != ''">
107 110
             and base.store_id = #{sStoreId}
@@ -118,6 +121,9 @@
118 121
                                         rtn_req_dtl_ptcl  ptcl
119 122
                                     where sbase.rtn_req_unq_no = ptcl.rtn_req_unq_no
120 123
                                     and   sbase.brand_id = #{sBrandId}
124
+                                    <if test="sStoreId == null or sStoreId == ''">
125
+                                        and   ((sbase.store_id is null or sbase.store_id = '') or (sbase.store_id is not null and sbase.store_id <![CDATA[ <> ]]> '' and sbase.rtn_req_st_cd <![CDATA[ <> ]]> 'RR00'))
126
+                                    </if>
121 127
                                     and   sbase.col_req_dt between #{fromDt} and #{toDt}
122 128
                                     <if test="sStoreId != null and sStoreId != ''">
123 129
                                         and sbase.store_id = #{sStoreId}
@@ -155,6 +161,9 @@
155 161
         from rtn_req_base_info base
156 162
         where 1 = 1
157 163
         and base.brand_id = #{sBrandId}
164
+        <if test="sStoreId == null or sStoreId == ''">
165
+            and   ((base.store_id is null or base.store_id = '') or (base.store_id is not null and base.store_id <![CDATA[ <> ]]> '' and base.rtn_req_st_cd <![CDATA[ <> ]]> 'RR00'))
166
+        </if>
158 167
         and base.col_req_dt between #{fromDt} and #{toDt}
159 168
         <if test="sStoreId != null and sStoreId != ''">
160 169
             and base.store_id = #{sStoreId}
@@ -171,6 +180,9 @@
171 180
                                         rtn_req_dtl_ptcl  ptcl
172 181
                                         where sbase.rtn_req_unq_no = ptcl.rtn_req_unq_no
173 182
                                         and   sbase.brand_id = #{sBrandId}
183
+                                        <if test="sStoreId == null or sStoreId == ''">
184
+                                            and   ((sbase.store_id is null or sbase.store_id = '') or (sbase.store_id is not null and sbase.store_id <![CDATA[ <> ]]> '' and sbase.rtn_req_st_cd <![CDATA[ <> ]]> 'RR00'))
185
+                                        </if>
174 186
                                         and   sbase.col_req_dt between #{fromDt} and #{toDt}
175 187
                                         <if test="sStoreId != null and sStoreId != ''">
176 188
                                             and sbase.store_id = #{sStoreId}