User 정보 동기화 추가
This commit is contained in:
parent
f161a797e8
commit
0bb248aa4f
@ -23,7 +23,7 @@ public class UserController {
|
||||
@Operation(description = "판매점 정보를 등록/수정 한다.(동기화)")
|
||||
@PutMapping("/store-save")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public UserResponse setStoreInfo(@RequestBody StoreRequest storeReq) {
|
||||
public UserResponse setStoreSave(@RequestBody StoreRequest storeReq) {
|
||||
UserResponse userResponse = new UserResponse();
|
||||
|
||||
int resultCnt = userService.setStoreSave(storeReq);
|
||||
@ -36,7 +36,8 @@ public class UserController {
|
||||
|
||||
@Operation(description = "user 정보를 등록/수정 한다.(동기화)")
|
||||
@PutMapping("/user-save")
|
||||
public UserResponse updateUserInfo(@RequestBody List<UserRequest> userReqList) {
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public UserResponse setUserSave(@RequestBody List<UserRequest> userReqList) {
|
||||
UserResponse userResponse = new UserResponse();
|
||||
|
||||
int resultCnt = userService.setUserSave(userReqList);
|
||||
|
||||
@ -9,5 +9,7 @@ public interface UserMapper {
|
||||
|
||||
int setStoreSave(StoreRequest storeReq);
|
||||
|
||||
int setStoreSapCdSave(StoreRequest storeReq);
|
||||
|
||||
int setUserSave(UserRequest userReqList);
|
||||
}
|
||||
@ -13,6 +13,7 @@ public class UserService {
|
||||
private final UserMapper userMapper;
|
||||
|
||||
public int setStoreSave(StoreRequest storeReq) {
|
||||
userMapper.setStoreSapCdSave(storeReq);
|
||||
return userMapper.setStoreSave(storeReq);
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class StoreRequest {
|
||||
|
||||
private String sapSalesStoreCd;
|
||||
private String saleStoreId;
|
||||
private String saleStoreName;
|
||||
private String saleStoreNameKana;
|
||||
|
||||
@ -178,7 +178,7 @@
|
||||
ON G.FIRST_AGENT_ID = Y.SALE_STORE_ID /*1차점정보*/
|
||||
WHERE A.DEL_FLG = 0
|
||||
AND B.DEL_FLG = 0
|
||||
AND B.ESTIMATE_DETAIL_CREATE_DATE >= #{sch_baseDt} /* 과거일자 기준일 */
|
||||
AND B.ESTIMATE_DETAIL_CREATE_DATE <![CDATA[ <= ]]> #{sch_baseDt} /* 과거일자 기준일 */
|
||||
<if test="sch_startDt != null and sch_startDt != '' and sch_endDt != null and sch_endDt != ''"> <!-- 견적일 -->
|
||||
AND B.ESTIMATE_DETAIL_CREATE_DATE BETWEEN #{sch_startDt} and #{sch_endDt}
|
||||
</if>
|
||||
@ -255,7 +255,7 @@
|
||||
WHERE C.DEL_FLG = 0
|
||||
AND D.DEL_FLG = 0
|
||||
AND B.DEL_FLG = 0
|
||||
AND C.ESTIMATE_DETAIL_CREATE_DATE >= #{sch_baseDt} /* 과거일자 기준일 */
|
||||
AND C.ESTIMATE_DETAIL_CREATE_DATE <![CDATA[ <= ]]> #{sch_baseDt} /* 과거일자 기준일 */
|
||||
<if test="sch_startDt != null and sch_startDt != '' and sch_endDt != null and sch_endDt != ''"> <!-- 견적일 -->
|
||||
AND C.ESTIMATE_DETAIL_CREATE_DATE BETWEEN #{sch_startDt} and #{sch_endDt}
|
||||
</if>
|
||||
@ -349,7 +349,7 @@
|
||||
LEFT JOIN T_OBJECT D
|
||||
ON A.OBJECT_NO = D.OBJECT_NO
|
||||
WHERE D.DEL_FLG != 1
|
||||
AND D.ESTIMATE_DETAIL_CREATE_DATE >= #{sch_baseDt} /* 과거일자 기준일 */
|
||||
AND D.ESTIMATE_DETAIL_CREATE_DATE <![CDATA[ <= ]]> #{sch_baseDt} /* 과거일자 기준일 */
|
||||
<if test="sch_dtType != null and sch_dtType != ''">
|
||||
<if test="sch_startDt != null and sch_startDt != '' and sch_endDt != null and sch_endDt != ''">
|
||||
<choose>
|
||||
|
||||
@ -2,13 +2,33 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.interplug.qcast.biz.user.UserMapper">
|
||||
|
||||
|
||||
<insert id="setStoreSapCdSave" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >
|
||||
/* sqlid : com.interplug.qcast.user.setStoreSapCdSave */
|
||||
MERGE M_SALES_STORE_ID_FOR_SAP AS A
|
||||
USING
|
||||
( SELECT #{saleStoreId} AS SALE_STORE_ID ) AS D
|
||||
ON (A.SALE_STORE_ID = D.SALE_STORE_ID)
|
||||
WHEN MATCHED THEN
|
||||
UPDATE SET
|
||||
SAP_SALES_STORE_CD = #{sapSalesStoreCd}
|
||||
WHEN NOT MATCHED THEN
|
||||
INSERT (
|
||||
SALE_STORE_ID
|
||||
, SAP_SALES_STORE_CD
|
||||
) VALUES (
|
||||
#{saleStoreId}
|
||||
, #{sapSalesStoreCd}
|
||||
);
|
||||
</insert>
|
||||
|
||||
<insert id="setStoreSave" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >
|
||||
/* sqlid : com.interplug.qcast.user.setStoreSave */
|
||||
MERGE M_SALES_STORE AS A
|
||||
USING
|
||||
( SELECT #{saleStoreId} AS SALE_STORE_ID ) AS D
|
||||
ON (A.SALE_STORE_ID = D.SALE_STORE_ID
|
||||
)
|
||||
( SELECT #{saleStoreId} AS SALE_STORE_ID ) AS D
|
||||
ON (A.SALE_STORE_ID = D.SALE_STORE_ID)
|
||||
WHEN MATCHED THEN
|
||||
UPDATE SET
|
||||
SALE_STORE_NAME = #{saleStoreName}
|
||||
@ -119,8 +139,7 @@
|
||||
MERGE M_USER AS A
|
||||
USING
|
||||
( SELECT #{userId} AS USER_ID ) AS D
|
||||
ON (A.USER_ID = D.USER_ID
|
||||
)
|
||||
ON (A.USER_ID = D.USER_ID)
|
||||
WHEN MATCHED THEN
|
||||
UPDATE SET
|
||||
SALE_STORE_ID = #{saleStoreId}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user