This commit is contained in:
Daseul Kim 2025-02-03 15:03:01 +09:00
commit abe35e03a7
2 changed files with 20 additions and 14 deletions

View File

@ -173,6 +173,11 @@ public class ObjectService {
* @throws Exception * @throws Exception
*/ */
public List<ObjectResponse> selectObjectList(ObjectRequest objectRequest) throws Exception { public List<ObjectResponse> selectObjectList(ObjectRequest objectRequest) throws Exception {
if (!"T01".equals(objectRequest.getSaleStoreId())) {
objectRequest.setSchSelSaleStoreId("");
}
return objectMapper.selectObjectList(objectRequest); return objectMapper.selectObjectList(objectRequest);
} }

View File

@ -141,7 +141,7 @@
<select id="selectObjectList" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="com.interplug.qcast.biz.object.dto.ObjectResponse"> <select id="selectObjectList" parameterType="com.interplug.qcast.biz.object.dto.ObjectRequest" resultType="com.interplug.qcast.biz.object.dto.ObjectResponse">
/* sqlid : com.interplug.qcast.biz.object.selectObjectList */ /* sqlid : com.interplug.qcast.biz.object.selectObjectList */
<if test='saleStoreId != null and saleStoreId != "T01"'> <if test='(saleStoreId != null and saleStoreId != "T01") or (schSelSaleStoreId != null and schSelSaleStoreId != "")'>
/* 계층형 구조에 맞는 SALE_STORE_ID 축출 - 재귀함수 */ /* 계층형 구조에 맞는 SALE_STORE_ID 축출 - 재귀함수 */
WITH SALES_STORE_CTE AS ( WITH SALES_STORE_CTE AS (
SELECT SELECT
@ -151,7 +151,14 @@
FROM M_SALES_STORE WITH(NOLOCK) FROM M_SALES_STORE WITH(NOLOCK)
WHERE APPROVE_FLG = '2' WHERE APPROVE_FLG = '2'
AND DEL_FLG = '0' AND DEL_FLG = '0'
<choose>
<when test='schSelSaleStoreId != null and schSelSaleStoreId != ""'>
AND SALE_STORE_ID = #{schSelSaleStoreId}
</when>
<otherwise>
AND SALE_STORE_ID = #{saleStoreId} AND SALE_STORE_ID = #{saleStoreId}
</otherwise>
</choose>
UNION ALL UNION ALL
SELECT SELECT
@ -209,7 +216,7 @@
FROM T_OBJECT O WITH (NOLOCK) FROM T_OBJECT O WITH (NOLOCK)
INNER JOIN M_SALES_STORE S WITH (NOLOCK) INNER JOIN M_SALES_STORE S WITH (NOLOCK)
ON O.SALE_STORE_ID = S.SALE_STORE_ID ON O.SALE_STORE_ID = S.SALE_STORE_ID
<if test='saleStoreId != null and saleStoreId != "T01"'> <if test='(saleStoreId != null and saleStoreId != "T01") or (schSelSaleStoreId != null and schSelSaleStoreId != "")'>
INNER JOIN SALES_STORE_CTE T INNER JOIN SALES_STORE_CTE T
ON S.SALE_STORE_ID = T.SALE_STORE_ID ON S.SALE_STORE_ID = T.SALE_STORE_ID
</if> </if>
@ -220,18 +227,12 @@
AND O.TEMP_FLG = '0' AND O.TEMP_FLG = '0'
</if> </if>
<if test='schSaleStoreId != null and schSaleStoreId != ""'> <if test='schSaleStoreId != null and schSaleStoreId != ""'>
AND O.SALE_STORE_ID LIKE '%' + #{schSaleStoreId} + '%' AND O.SALE_STORE_ID = #{schSaleStoreId}
</if> </if>
<choose> <if test='schOtherSelSaleStoreId != null and schOtherSelSaleStoreId != ""'>
<when test='schOtherSelSaleStoreId != null and schOtherSelSaleStoreId != ""'>
/* 2차점까지 고름 */ /* 2차점까지 고름 */
AND O.SALE_STORE_ID = #{schOtherSelSaleStoreId} AND O.SALE_STORE_ID = #{schOtherSelSaleStoreId}
</when> </if>
<when test='schSelSaleStoreId != null and schSelSaleStoreId != ""'>
/* 1차점까지만 고름 */
AND O.SALE_STORE_ID = #{schSelSaleStoreId}
</when>
</choose>
<if test='schAddress != null and schAddress != ""'> <if test='schAddress != null and schAddress != ""'>
AND O.ADDRESS LIKE '%' + #{schAddress} + '%' AND O.ADDRESS LIKE '%' + #{schAddress} + '%'
</if> </if>