dev #436
@ -71,7 +71,12 @@ public class AdminUserConfiguration implements JobExecutionListener {
|
||||
|
||||
@Bean
|
||||
public ItemProcessor<AdminUserSyncResponse, AdminUserSyncResponse> adminUserProcessor() {
|
||||
return item -> item;
|
||||
return item -> {
|
||||
if (item.getCategory() != null && item.getCategory().length() > 20) {
|
||||
item.setCategory(item.getCategory().substring(0, 20));
|
||||
}
|
||||
return item;
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.interplug.qcast.config.Exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
@ -12,6 +13,7 @@ public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
|
||||
protected ResponseEntity<ErrorResponse> handle(HttpRequestMethodNotSupportedException e) {
|
||||
return ResponseEntity.badRequest()
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(ErrorCode.METHOD_NOT_ALLOWED.getMessage()));
|
||||
}
|
||||
|
||||
@ -19,6 +21,7 @@ public class GlobalExceptionHandler {
|
||||
protected ResponseEntity<ErrorResponse> handle(BaseException e) {
|
||||
final ErrorCode errorCode = e.getErrorCode();
|
||||
return ResponseEntity.status(errorCode.getStatus())
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(errorCode.getMessage()));
|
||||
}
|
||||
|
||||
@ -27,14 +30,18 @@ public class GlobalExceptionHandler {
|
||||
final ErrorCode errorCode = e.getErrorCode();
|
||||
if (e.getMessage() == null) {
|
||||
return ResponseEntity.status(errorCode.getStatus())
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(errorCode.getMessage()));
|
||||
}
|
||||
return ResponseEntity.status(errorCode.getStatus()).body(ErrorResponse.of(e.getMessage()));
|
||||
return ResponseEntity.status(errorCode.getStatus())
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(e.getMessage()));
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
protected ResponseEntity<ErrorResponse> handle(Exception e) {
|
||||
return ResponseEntity.internalServerError()
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(ErrorCode.INTERNAL_SERVER_ERROR.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,41 +37,41 @@ public class InterfaceQsp {
|
||||
* @return String
|
||||
* @throws Exception
|
||||
*/
|
||||
public String callApi(HttpMethod httpMethod, String apiPath, Object requestObject)
|
||||
throws Exception {
|
||||
|
||||
URL url = null;
|
||||
HttpURLConnection con = null;
|
||||
public String callApi(HttpMethod httpMethod, String apiPath, Object requestObject)
|
||||
throws Exception {
|
||||
|
||||
URL url = null;
|
||||
HttpURLConnection con = null;
|
||||
OutputStreamWriter osw = null;
|
||||
BufferedReader br = null;
|
||||
StringBuilder sb = null;
|
||||
long startAt = System.currentTimeMillis();
|
||||
String requestType = requestObject == null ? "none" : requestObject.getClass().getSimpleName();
|
||||
|
||||
try {
|
||||
|
||||
// GET 요청 시 requestObject를 쿼리 스트링으로 변환
|
||||
if (HttpMethod.GET.equals(httpMethod) && requestObject != null) {
|
||||
BufferedReader br = null;
|
||||
StringBuilder sb = null;
|
||||
long startAt = System.currentTimeMillis();
|
||||
String requestType = requestObject == null ? "none" : requestObject.getClass().getSimpleName();
|
||||
|
||||
try {
|
||||
|
||||
// GET 요청 시 requestObject를 쿼리 스트링으로 변환
|
||||
if (HttpMethod.GET.equals(httpMethod) && requestObject != null) {
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
Map<String, Object> params = om.convertValue(requestObject, Map.class); // Object -> Map 변환
|
||||
String queryString =
|
||||
params.entrySet().stream()
|
||||
.map(entry -> entry.getKey() + "=" + entry.getValue())
|
||||
.reduce((p1, p2) -> p1 + "&" + p2)
|
||||
.orElse("");
|
||||
apiPath += "?" + queryString; // 쿼리 스트링 추가
|
||||
}
|
||||
|
||||
log.debug(
|
||||
"QSP API call start: method={}, url={}, requestType={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
requestType);
|
||||
url = new URL(apiPath);
|
||||
con = (HttpURLConnection) url.openConnection();
|
||||
con.setConnectTimeout(120000); // 서버에 연결되는 Timeout 시간 설정
|
||||
con.setReadTimeout(120000); // InputStream 읽어 오는 Timeout 시간 설정
|
||||
con.setRequestMethod(httpMethod.toString());
|
||||
.reduce((p1, p2) -> p1 + "&" + p2)
|
||||
.orElse("");
|
||||
apiPath += "?" + queryString; // 쿼리 스트링 추가
|
||||
}
|
||||
|
||||
log.debug(
|
||||
"QSP API call start: method={}, url={}, requestType={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
requestType);
|
||||
url = new URL(apiPath);
|
||||
con = (HttpURLConnection) url.openConnection();
|
||||
con.setConnectTimeout(120000); // 서버에 연결되는 Timeout 시간 설정
|
||||
con.setReadTimeout(120000); // InputStream 읽어 오는 Timeout 시간 설정
|
||||
con.setRequestMethod(httpMethod.toString());
|
||||
con.setRequestProperty("Content-Type", "application/json");
|
||||
con.setRequestProperty("Referer", frontUrl);
|
||||
con.setDoInput(true);
|
||||
@ -91,33 +91,34 @@ public class InterfaceQsp {
|
||||
}
|
||||
|
||||
sb = new StringBuilder();
|
||||
int status = con.getResponseCode();
|
||||
if (status == HttpURLConnection.HTTP_OK) {
|
||||
br = new BufferedReader(new InputStreamReader(con.getInputStream(), "utf-8"));
|
||||
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
}
|
||||
log.debug(
|
||||
"QSP API call end: method={}, url={}, status={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
status,
|
||||
System.currentTimeMillis() - startAt);
|
||||
} catch (Exception e) {
|
||||
log.error(
|
||||
"QSP API call failed: method={}, url={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
System.currentTimeMillis() - startAt,
|
||||
e);
|
||||
throw e;
|
||||
} finally {
|
||||
try {
|
||||
if (osw != null) osw.close();
|
||||
if (br != null) br.close();
|
||||
int status = con.getResponseCode();
|
||||
if (status == HttpURLConnection.HTTP_OK) {
|
||||
log.info("[DEBUG] QSP Content-Type: {}", con.getContentType());
|
||||
br = new BufferedReader(new InputStreamReader(con.getInputStream(), "utf-8"));
|
||||
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
}
|
||||
log.debug(
|
||||
"QSP API call end: method={}, url={}, status={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
status,
|
||||
System.currentTimeMillis() - startAt);
|
||||
} catch (Exception e) {
|
||||
log.error(
|
||||
"QSP API call failed: method={}, url={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
System.currentTimeMillis() - startAt,
|
||||
e);
|
||||
throw e;
|
||||
} finally {
|
||||
try {
|
||||
if (osw != null) osw.close();
|
||||
if (br != null) br.close();
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
@ -176,30 +177,30 @@ public class InterfaceQsp {
|
||||
* @return String
|
||||
* @throws Exception
|
||||
*/
|
||||
public byte[] callApi(
|
||||
HttpMethod httpMethod, String apiPath, Object requestObject, Map<String, String> result)
|
||||
throws Exception {
|
||||
|
||||
URL url = null;
|
||||
public byte[] callApi(
|
||||
HttpMethod httpMethod, String apiPath, Object requestObject, Map<String, String> result)
|
||||
throws Exception {
|
||||
|
||||
URL url = null;
|
||||
HttpURLConnection con = null;
|
||||
OutputStreamWriter osw = null;
|
||||
BufferedReader br = null;
|
||||
|
||||
byte[] bt = null;
|
||||
long startAt = System.currentTimeMillis();
|
||||
String requestType = requestObject == null ? "none" : requestObject.getClass().getSimpleName();
|
||||
|
||||
try {
|
||||
log.debug(
|
||||
"QSP API call start: method={}, url={}, requestType={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
requestType);
|
||||
url = new URL(apiPath);
|
||||
con = (HttpURLConnection) url.openConnection();
|
||||
con.setConnectTimeout(30000); // 서버에 연결되는 Timeout 시간 설정
|
||||
con.setReadTimeout(30000); // InputStream 읽어 오는 Timeout 시간 설정
|
||||
con.setRequestMethod(httpMethod.toString());
|
||||
BufferedReader br = null;
|
||||
|
||||
byte[] bt = null;
|
||||
long startAt = System.currentTimeMillis();
|
||||
String requestType = requestObject == null ? "none" : requestObject.getClass().getSimpleName();
|
||||
|
||||
try {
|
||||
log.debug(
|
||||
"QSP API call start: method={}, url={}, requestType={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
requestType);
|
||||
url = new URL(apiPath);
|
||||
con = (HttpURLConnection) url.openConnection();
|
||||
con.setConnectTimeout(30000); // 서버에 연결되는 Timeout 시간 설정
|
||||
con.setReadTimeout(30000); // InputStream 읽어 오는 Timeout 시간 설정
|
||||
con.setRequestMethod(httpMethod.toString());
|
||||
con.setRequestProperty("Content-Type", "application/json");
|
||||
con.setRequestProperty("Referer", frontUrl);
|
||||
con.setDoInput(true);
|
||||
@ -217,40 +218,40 @@ public class InterfaceQsp {
|
||||
osw.flush();
|
||||
}
|
||||
}
|
||||
int status = con.getResponseCode();
|
||||
if (status == HttpURLConnection.HTTP_OK) {
|
||||
// response 헤더 값 결과 셋팅
|
||||
result.put("type", con.getHeaderField("Content-Type"));
|
||||
result.put("disposition", con.getHeaderField("Content-Disposition"));
|
||||
|
||||
InputStream inputStream = con.getInputStream();
|
||||
int status = con.getResponseCode();
|
||||
if (status == HttpURLConnection.HTTP_OK) {
|
||||
// response 헤더 값 결과 셋팅
|
||||
result.put("type", con.getHeaderField("Content-Type"));
|
||||
result.put("disposition", con.getHeaderField("Content-Disposition"));
|
||||
|
||||
InputStream inputStream = con.getInputStream();
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
bt = outputStream.toByteArray(); // 파일 데이터 반환
|
||||
}
|
||||
log.debug(
|
||||
"QSP API call end: method={}, url={}, status={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
status,
|
||||
System.currentTimeMillis() - startAt);
|
||||
} catch (Exception e) {
|
||||
log.error(
|
||||
"QSP API call failed: method={}, url={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
System.currentTimeMillis() - startAt,
|
||||
e);
|
||||
throw e;
|
||||
} finally {
|
||||
try {
|
||||
if (osw != null) osw.close();
|
||||
if (br != null) br.close();
|
||||
}
|
||||
bt = outputStream.toByteArray(); // 파일 데이터 반환
|
||||
}
|
||||
log.debug(
|
||||
"QSP API call end: method={}, url={}, status={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
status,
|
||||
System.currentTimeMillis() - startAt);
|
||||
} catch (Exception e) {
|
||||
log.error(
|
||||
"QSP API call failed: method={}, url={}, durationMs={}",
|
||||
httpMethod,
|
||||
apiPath,
|
||||
System.currentTimeMillis() - startAt,
|
||||
e);
|
||||
throw e;
|
||||
} finally {
|
||||
try {
|
||||
if (osw != null) osw.close();
|
||||
if (br != null) br.close();
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
@ -91,91 +91,94 @@
|
||||
|
||||
<select id="selectEstimatePdfDetail" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="com.interplug.qcast.biz.estimate.dto.EstimateResponse">
|
||||
/* sqlid : com.interplug.qcast.biz.estimate.selectPdfEstimateDetail */
|
||||
SELECT Z.*
|
||||
, SS3.ZIP_NO AS ZIP_NO3
|
||||
, SS3.ADDRESS AS ADDRESS3
|
||||
, SS3.TEL AS TEL3
|
||||
, SS3.FAX AS FAX3
|
||||
, CASE WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') = '' THEN Z.ZIP_NO2
|
||||
WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') != '' THEN SS3.ZIP_NO
|
||||
ELSE Z.ZIP_NO1 END AS ZIP_NO
|
||||
, CASE WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') = '' THEN Z.ADDRESS2
|
||||
WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') != '' THEN SS3.ADDRESS
|
||||
ELSE Z.ADDRESS1 END AS ADDRESS
|
||||
, CASE WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') = '' THEN Z.TEL2
|
||||
WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') != '' THEN SS3.TEL
|
||||
ELSE Z.TEL1 END AS TEL
|
||||
, CASE WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') = '' THEN Z.FAX2
|
||||
WHEN Z.CREATE_USER = 'T01' AND ISNULL(Z.FIRST_AGENT_ID,'') != '' THEN SS3.FAX
|
||||
ELSE Z.FAX1 END AS FAX
|
||||
FROM (
|
||||
|
||||
SELECT
|
||||
T.*
|
||||
, SS1.SALE_STORE_NAME AS CUST_SALE_STORE_NAME
|
||||
, COALESCE(NULLIF(SS2.DISP_COMPANY_NAME, ''), SS2.SALE_STORE_NAME) AS SALE_STORE_NAME
|
||||
, COALESCE(NULLIF(SS2.DISP_ZIP_NO, ''), SS2.ZIP_NO) AS ZIP_NO1
|
||||
, COALESCE(NULLIF(SS2.DISP_ADDRESS, ''), SS2.ADDRESS) AS ADDRESS1
|
||||
, COALESCE(NULLIF(SS2.DISP_TEL, ''), SS2.TEL) AS TEL1
|
||||
, COALESCE(NULLIF(SS2.DISP_FAX, ''), SS2.FAX) AS FAX1
|
||||
, SSI2.BIZ_NO
|
||||
, SS1.ZIP_NO AS ZIP_NO2
|
||||
, SS1.ADDRESS AS ADDRESS2
|
||||
, SS1.TEL AS TEL2
|
||||
, SS1.FAX AS FAX2
|
||||
, SS1.FIRST_AGENT_ID
|
||||
, (SELECT BC.BUSINESS_TEAM_CD FROM M_BUSINESS_CHARGER BC WHERE BC.BUSINESS_CHARGER_CD = T.BUSINESS_CHARGER_CD) AS BUSINESS_TEAM_CD
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
P.OBJECT_NO
|
||||
, P.PLAN_NO
|
||||
, CONVERT(VARCHAR(10), P.DRAWING_ESTIMATE_CREATE_DATE, 121) AS DRAWING_ESTIMATE_CREATE_DATE
|
||||
, P.ESTIMATE_VALIDITY_TERM
|
||||
, P.SNOWFALL
|
||||
, CONVERT(NVARCHAR(10), P.LAST_EDIT_DATETIME, 121) AS ESTIMATE_DATE
|
||||
, PI.ESTIMATE_TYPE
|
||||
, PI.ESTIMATE_OPTION
|
||||
, PI.PKG_ASP
|
||||
, PI.REMARKS
|
||||
, PI.CREATE_USER
|
||||
, O.SALE_STORE_ID
|
||||
, (SELECT SS.BUSINESS_CHARGER_CD FROM M_SALES_STORE SS WHERE SS.SALE_STORE_ID = O.SALE_STORE_ID ) AS BUSINESS_CHARGER_CD
|
||||
, O.OBJECT_NAME
|
||||
, O.OBJECT_NAME_OMIT
|
||||
, (SELECT SALE_STORE_ID FROM M_USER WHERE USER_ID = OI.CREATE_USER) AS CREATE_SALE_STORE_ID
|
||||
, ISNULL(MP.PREF_NAME, '') AS PREF_NAME
|
||||
, ISNULL(MPA.AREA_NAME, '') AS AREA_NAME
|
||||
, ISNULL(C1.CODE_NM, '') AS STANDARD_WIND_SPEED_NAME
|
||||
FROM T_PLAN P WITH (NOLOCK)
|
||||
INNER JOIN T_PLAN_INFO PI WITH (NOLOCK)
|
||||
ON P.OBJECT_NO = PI.OBJECT_NO
|
||||
AND P.PLAN_NO = PI.PLAN_NO
|
||||
INNER JOIN T_OBJECT O WITH (NOLOCK)
|
||||
ON P.OBJECT_NO = O.OBJECT_NO
|
||||
INNER JOIN T_OBJECT_INFO OI WITH (NOLOCK)
|
||||
ON O.OBJECT_NO = OI.OBJECT_NO
|
||||
LEFT OUTER JOIN T_SIMULATION_PREFECTURE MP WITH (NOLOCK)
|
||||
ON O.PREF_ID = MP.PREF_ID
|
||||
LEFT OUTER JOIN T_SIMULATION_AREA MPA WITH (NOLOCK)
|
||||
ON O.PREF_ID = MPA.PREF_ID
|
||||
AND OI.AREA_ID = MPA.AREA_ID
|
||||
AND MPA.DEL_FLG = 0
|
||||
LEFT OUTER JOIN M_COMM_L C1 WITH (NOLOCK)
|
||||
ON C1.HEAD_CD = '202000'
|
||||
AND P.STANDARD_WIND_SPEED_ID = C1.CODE
|
||||
WHERE P.OBJECT_NO = #{objectNo}
|
||||
AND P.PLAN_NO = #{planNo}
|
||||
) T
|
||||
LEFT OUTER JOIN M_SALES_STORE SS1 WITH (NOLOCK)
|
||||
T.*
|
||||
, SS1.SALE_STORE_NAME AS CUST_SALE_STORE_NAME
|
||||
, COALESCE(NULLIF(SS2.DISP_COMPANY_NAME, ''), SS2.SALE_STORE_NAME) AS SALE_STORE_NAME
|
||||
<if test='saleStoreId != null and saleStoreId != "T01"'>
|
||||
, COALESCE(NULLIF(SS2.DISP_ZIP_NO, ''), SS2.ZIP_NO) AS ZIP_NO
|
||||
, COALESCE(NULLIF(SS2.DISP_ADDRESS, ''), SS2.ADDRESS) AS ADDRESS
|
||||
, COALESCE(NULLIF(SS2.DISP_TEL, ''), SS2.TEL) AS TEL
|
||||
, COALESCE(NULLIF(SS2.DISP_FAX, ''), SS2.FAX) AS FAX
|
||||
</if>
|
||||
<if test='saleStoreId != null and saleStoreId == "T01"'>
|
||||
, ISNULL((SELECT
|
||||
SUBSTRING(MCL.REF_CHR3, CHARINDEX('〒', MCL.REF_CHR3) + 1,
|
||||
CHARINDEX(')', MCL.REF_CHR3, CHARINDEX('〒', MCL.REF_CHR3)) - CHARINDEX('〒', MCL.REF_CHR3) - 1)
|
||||
FROM M_COMM_L MCL
|
||||
WHERE MCL.HEAD_CD = '103200'
|
||||
AND MCL.CODE = T.BUSINESS_TEAM_CD), '') AS ZIP_NO
|
||||
, ISNULL((SELECT
|
||||
LTRIM(SUBSTRING(MCL.REF_CHR3,
|
||||
CHARINDEX(')', MCL.REF_CHR3, CHARINDEX('〒', MCL.REF_CHR3)) + 1,
|
||||
LEN(MCL.REF_CHR3)))
|
||||
FROM M_COMM_L MCL
|
||||
WHERE MCL.HEAD_CD = '103200'
|
||||
AND MCL.CODE = T.BUSINESS_TEAM_CD), '') AS ADDRESS
|
||||
, ISNULL((SELECT MCL.REF_CHR4
|
||||
FROM M_COMM_L MCL
|
||||
WHERE MCL.HEAD_CD = '103200'
|
||||
AND MCL.CODE = T.BUSINESS_TEAM_CD), '') AS TEL
|
||||
, ISNULL((SELECT MCL.REF_CHR5
|
||||
FROM M_COMM_L MCL
|
||||
WHERE MCL.HEAD_CD = '103200'
|
||||
AND MCL.CODE = T.BUSINESS_TEAM_CD), '') AS FAX
|
||||
</if>
|
||||
, SSI2.BIZ_NO
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
P.OBJECT_NO
|
||||
, P.PLAN_NO
|
||||
, CONVERT(VARCHAR(10), P.DRAWING_ESTIMATE_CREATE_DATE, 121) AS DRAWING_ESTIMATE_CREATE_DATE
|
||||
, P.ESTIMATE_VALIDITY_TERM
|
||||
, P.SNOWFALL
|
||||
, CONVERT(NVARCHAR(10), P.LAST_EDIT_DATETIME, 121) AS ESTIMATE_DATE
|
||||
, PI.ESTIMATE_TYPE
|
||||
, PI.ESTIMATE_OPTION
|
||||
, PI.PKG_ASP
|
||||
, PI.REMARKS
|
||||
, O.SALE_STORE_ID
|
||||
, O.OBJECT_NAME
|
||||
, O.OBJECT_NAME_OMIT
|
||||
, (SELECT SALE_STORE_ID FROM M_USER WHERE USER_ID = OI.CREATE_USER) AS CREATE_SALE_STORE_ID
|
||||
<if test='saleStoreId != null and saleStoreId == "T01"'>
|
||||
, (SELECT BC.BUSINESS_TEAM_CD
|
||||
FROM M_SALES_STORE SS WITH (NOLOCK)
|
||||
INNER JOIN M_BUSINESS_CHARGER BC WITH (NOLOCK)
|
||||
ON SS.BUSINESS_CHARGER_CD = BC.BUSINESS_CHARGER_CD
|
||||
WHERE SS.SALE_STORE_ID = O.SALE_STORE_ID
|
||||
) AS BUSINESS_TEAM_CD
|
||||
</if>
|
||||
, ISNULL(MP.PREF_NAME, '') AS PREF_NAME
|
||||
, ISNULL(MPA.AREA_NAME, '') AS AREA_NAME
|
||||
, ISNULL(C1.CODE_NM, '') AS STANDARD_WIND_SPEED_NAME
|
||||
FROM T_PLAN P WITH (NOLOCK)
|
||||
INNER JOIN T_PLAN_INFO PI WITH (NOLOCK)
|
||||
ON P.OBJECT_NO = PI.OBJECT_NO
|
||||
AND P.PLAN_NO = PI.PLAN_NO
|
||||
INNER JOIN T_OBJECT O WITH (NOLOCK)
|
||||
ON P.OBJECT_NO = O.OBJECT_NO
|
||||
INNER JOIN T_OBJECT_INFO OI WITH (NOLOCK)
|
||||
ON O.OBJECT_NO = OI.OBJECT_NO
|
||||
LEFT OUTER JOIN T_SIMULATION_PREFECTURE MP WITH (NOLOCK)
|
||||
ON O.PREF_ID = MP.PREF_ID
|
||||
LEFT OUTER JOIN T_SIMULATION_AREA MPA WITH (NOLOCK)
|
||||
ON O.PREF_ID = MPA.PREF_ID
|
||||
AND OI.AREA_ID = MPA.AREA_ID
|
||||
AND MPA.DEL_FLG = 0
|
||||
LEFT OUTER JOIN M_COMM_L C1 WITH (NOLOCK)
|
||||
ON C1.HEAD_CD = '202000'
|
||||
AND P.STANDARD_WIND_SPEED_ID = C1.CODE
|
||||
WHERE P.OBJECT_NO = #{objectNo}
|
||||
AND P.PLAN_NO = #{planNo}
|
||||
) T
|
||||
LEFT OUTER JOIN M_SALES_STORE SS1 WITH (NOLOCK)
|
||||
ON T.SALE_STORE_ID = SS1.SALE_STORE_ID
|
||||
LEFT OUTER JOIN M_SALES_STORE SS2 WITH (NOLOCK)
|
||||
LEFT OUTER JOIN M_SALES_STORE SS2 WITH (NOLOCK)
|
||||
ON T.CREATE_SALE_STORE_ID = SS2.SALE_STORE_ID
|
||||
LEFT OUTER JOIN M_SALES_STORE_INFO SSI2 WITH (NOLOCK)
|
||||
LEFT OUTER JOIN M_SALES_STORE_INFO SSI2 WITH (NOLOCK)
|
||||
ON T.CREATE_SALE_STORE_ID = SSI2.SALE_STORE_ID
|
||||
)Z
|
||||
LEFT OUTER JOIN M_SALES_STORE SS3 WITH (NOLOCK)
|
||||
ON Z.FIRST_AGENT_ID = SS3.SALE_STORE_ID
|
||||
</select>
|
||||
|
||||
<select id="selectEstimateApiFailList" resultType="com.interplug.qcast.biz.estimate.dto.EstimateSendResponse">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user