feat: mpower 반영 완료

dev
minuk926 2 years ago
parent 48a4721073
commit ce45d9ddd7

@ -102,11 +102,11 @@ public class AuthMinService implements IAuthMinService {
infoMap.put(XitConstants.JwtToken.TOKEN_USER_NAME.getCode(), user.getName()); infoMap.put(XitConstants.JwtToken.TOKEN_USER_NAME.getCode(), user.getName());
infoMap.put(XitConstants.JwtToken.TOKEN_USER_MAIL.getCode(), user.getEmail()); infoMap.put(XitConstants.JwtToken.TOKEN_USER_MAIL.getCode(), user.getEmail());
RefreshToken savedRefreshToken = refreshTokenDao.findByKey(authentication.getName()) RefreshToken savedRefreshToken = refreshTokenDao.findByKey(authentication.getName());
.orElse(null);
// 저장된 refresh token not exists // 저장된 refresh token not exists
if (Checks.isNull(savedRefreshToken) || Checks.isNull(savedRefreshToken.getValue()) || "".equals(savedRefreshToken.getValue().trim())) { //if (Checks.isNull(savedRefreshToken) || Checks.isNull(savedRefreshToken.getValue()) || "".equals(savedRefreshToken.getValue().trim())) {
if (Checks.isEmpty(savedRefreshToken)) {
// 없는 경우 새로 등록 // 없는 경우 새로 등록
tokenDto = jwtTokenProvider.generateTokenDto(authentication, infoMap); tokenDto = jwtTokenProvider.generateTokenDto(authentication, infoMap);
refreshTokenDao.save( refreshTokenDao.save(
@ -119,10 +119,12 @@ public class AuthMinService implements IAuthMinService {
// 저장된 토큰이 있다 // 저장된 토큰이 있다
} else { } else {
//Checks.isNull(savedRefreshToken.getValue()) || "".equals(savedRefreshToken.getValue().trim()
// 만료되지 않은 refresh token // 만료되지 않은 refresh token
if(!jwtTokenProvider.isExpiredToken(savedRefreshToken.getValue())) { if(Checks.isNotEmpty(savedRefreshToken.getValue()) && !jwtTokenProvider.isExpiredToken(savedRefreshToken.getValue())) {
// refresh token 잔여기간 기준 도달여부 check // refresh token 잔여기간 기준 도달여부 check
// 잔여기간에 도달된 경우 갱신
Date now = new Date(); Date now = new Date();
long validTime = jwtTokenProvider.parseClaims(savedRefreshToken.getValue()).getExpiration().getTime() - now.getTime(); long validTime = jwtTokenProvider.parseClaims(savedRefreshToken.getValue()).getExpiration().getTime() - now.getTime();
@ -137,15 +139,8 @@ public class AuthMinService implements IAuthMinService {
tokenDto = TokenDto.builder() tokenDto = TokenDto.builder()
.grantType(XitConstants.JwtToken.GRANT_TYPE.getCode()) .grantType(XitConstants.JwtToken.GRANT_TYPE.getCode())
.accessToken(jwtTokenProvider.generateJwtAccessToken(authentication, infoMap)) .accessToken(jwtTokenProvider.generateJwtAccessToken(authentication, infoMap))
.refreshToken("") //savedRefreshToken.getValue()) .refreshToken(savedRefreshToken.getValue())
.build(); .build();
refreshTokenDao.update(
RefreshToken.builder()
.key(loginRequestDto.getUserid())
.value(tokenDto.getRefreshToken())
.build()
);
} }
// refresh token 만료 // refresh token 만료
@ -253,8 +248,7 @@ public class AuthMinService implements IAuthMinService {
jwtTokenProvider.validateTokenExcludeExpired(sRefreshToken, true, true); jwtTokenProvider.validateTokenExcludeExpired(sRefreshToken, true, true);
// userId refresh token 으로 DB 확인 // userId refresh token 으로 DB 확인
RefreshToken savedRefreshToken = refreshTokenDao.findByKey(authentication.getName()) RefreshToken savedRefreshToken = refreshTokenDao.findByKey(authentication.getName());
.orElse(null);
if (Checks.isEmpty(savedRefreshToken)) throw new TokenAuthException(ErrorCode.NOT_EXISTS_SAVED_REFRESH_TOKEN); if (Checks.isEmpty(savedRefreshToken)) throw new TokenAuthException(ErrorCode.NOT_EXISTS_SAVED_REFRESH_TOKEN);
if (!Objects.equals(Objects.requireNonNull(savedRefreshToken).getValue(), sRefreshToken)) { if (!Objects.equals(Objects.requireNonNull(savedRefreshToken).getValue(), sRefreshToken)) {

@ -7,6 +7,8 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Objects; import java.util.Objects;
@Schema(name = "MinUserinfoDto", description = "사용자 DTO") @Schema(name = "MinUserinfoDto", description = "사용자 DTO")
@ -68,4 +70,11 @@ public class MinUserinfoDto implements Serializable {
public int hashCode() { public int hashCode() {
return Objects.hash(userid); return Objects.hash(userid);
} }
public void setSaveInit(){
LocalDateTime localDateTime = LocalDateTime.now();
this.regdate = LocalDate.parse(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
this.isenable = "1";
this.gu = "680";
}
} }

@ -46,8 +46,7 @@ public class MinUserController {
final MinUserinfoDto minUserinfoDto, final MinUserinfoDto minUserinfoDto,
@Parameter(hidden = true) @Parameter(hidden = true)
final Pageable pageable) { final Pageable pageable) {
return null; return RestResponse.of(service.findMinUsers(minUserinfoDto, pageable));
//return RestResponse.of(service.findMinUsers(mapstruct.toEntity(minUserinfoDto), pageable));
} }
@Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회") @Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회")

@ -23,6 +23,6 @@ public class CmmCodeDao extends BaseMpowerDaoSupport {
.setParameter("codeMcd", codeMcd) .setParameter("codeMcd", codeMcd)
.getQueryString(); .getQueryString();
return selectList(ComboCodeDto.class, sql, "code, value"); return selectComboCodeList(sql);
} }
} }

@ -96,11 +96,12 @@ public class ParkingDao extends BaseMpowerDaoSupport {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
.setParameter("msMaincode", msMaincode) .setParameter("msMaincode", msMaincode)
.getQueryString(); .getQueryString();
return Integer.parseInt(selectOneColumn(sql)); String cnt = selectOneColumn(sql);
return cnt == null? 0: Integer.parseInt(cnt);
} }
public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) { public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateJudegResult")
.setParameter("msMaincode", msMaincode) .setParameter("msMaincode", msMaincode)
.setParameter("msSeq", msSeq) .setParameter("msSeq", msSeq)
.setParameter("msResult", msResult) .setParameter("msResult", msResult)
@ -115,13 +116,13 @@ public class ParkingDao extends BaseMpowerDaoSupport {
.setParameter("rcSeq2", dto.getRcSeq2()) .setParameter("rcSeq2", dto.getRcSeq2())
.setParameter("rcIrTransfer", dto.getRcIrTransfer()) .setParameter("rcIrTransfer", dto.getRcIrTransfer())
.getQueryString(); .getQueryString();
final String fieldStrs = "mmCode, rcCode, rcSeq, mmOcarno, mmNcarno, rcName, rcContDoc, rcIngb, rcDate, scContDocNm, scIngbNm"; final String fieldStrs = "mmCode, rcCode, rcSeq, mmOcarno, mmNcarno, rcName, rcContDoc, rcIngb, rcDate, rcContDocNm, rcIngbNm";
return selectList(ParkingTargetDto.class, sql, fieldStrs); return selectList(ParkingTargetDto.class, sql, fieldStrs);
} }
public int insertJudgeTargetIntoSelect(@NotNull final ParkingTargetDto dto) { public int insertJudgeTargetIntoSelect(@NotNull final ParkingTargetDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertJudgeTargetIntoSelect") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertJudgeTargetIntoSelect")
.setParameter("scCode", dto.getRcCode()) .setParameter("rcCode", dto.getRcCode())
.setParameter("msYear", dto.getMsYear()) .setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate()) .setParameter("msSdate", dto.getMsSdate())
@ -148,8 +149,8 @@ public class ParkingDao extends BaseMpowerDaoSupport {
public void saveJudgeUsers(@NotNull final List<MinSimsaUser680> list) { public void saveJudgeUsers(@NotNull final List<MinSimsaUser680> list) {
for(MinSimsaUser680 vo : list) { for(MinSimsaUser680 vo : list) {
insert( insert(
QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer") QueryGenerator.createNamedQuery(NAME_SPACE, "insertJudgeUser")
.setParameter("msuCode", vo.getMsuCode()) .setParameter("msuMaincode", vo.getMsuMaincode())
.setParameter("msuResult", vo.getMsuResult()) .setParameter("msuResult", vo.getMsuResult())
.setParameter("msuTeam", vo.getMsuTeam()) .setParameter("msuTeam", vo.getMsuTeam())
.setParameter("msuUserid", vo.getMsuUserid()) .setParameter("msuUserid", vo.getMsuUserid())

@ -1,7 +1,5 @@
package com.xit.biz.ctgy.v2.repository; package com.xit.biz.ctgy.v2.repository;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Projections;
import com.xit.biz.ctgy.dto.DashboardJudgeListDto; import com.xit.biz.ctgy.dto.DashboardJudgeListDto;
import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.JudgeListDto;
@ -19,10 +17,6 @@ import java.time.LocalDate;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.xit.biz.ctgy.entity.QGnRecallSc.gnRecallSc;
import static com.xit.biz.ctgy.entity.QMinSimsa680Sc.minSimsa680Sc;
import static com.xit.biz.ctgy.entity.QMinSimsaUser680Sc.minSimsaUser680Sc;
@Repository @Repository
public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "residentAndDisabled"; private static final String NAME_SPACE = "residentAndDisabled";
@ -48,7 +42,7 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
.setParameter("scCode", scCode) .setParameter("scCode", scCode)
.getQueryString(); .getQueryString();
final String fieldStrs = "scCode, scSeq, scCarnum, scDong, scName, scContDoc, scIngb, scDatagb, scCdate, scState, " + final String fieldStrs = "scCode, scSeq, scCarnum, scDong, scName, scContDoc, scIngb, scDatagb, scCdate, scState, " +
"scWdate, scJbtime, scPos, scTransfer, scAnswer, scZipcode1, scZipcode2, scJuso, scBunji, " + "scWdate, scJbtime, scPos, scTransfer, scAnswer, zipcode1, zipcode2, scJuso, scBunji, " +
"scFrecad1, scFrecad2, scFrecad3, scFrecad4, scPicad1, scPicad2, scPicad3, scPicad4, " + "scFrecad1, scFrecad2, scFrecad3, scFrecad4, scPicad1, scPicad2, scPicad3, scPicad4, " +
"scContad1, scContad2, scContad3, scContad4, scContad5, scContad6, scContad7, scContad8, " + "scContad1, scContad2, scContad3, scContad4, scContad5, scContad6, scContad7, scContad8, " +
"scContDocNm, scIngbNm, scTransferNm, scStateNm"; "scContDocNm, scIngbNm, scTransferNm, scStateNm";
@ -76,17 +70,19 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) { public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) {
final String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeListCnt") final String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeListCnt")
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msYear", dto.getMsYear()) .setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.getQueryString(); .getQueryString();
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeList") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeList")
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msYear", dto.getMsYear()) .setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.setParameter("page", pageable.getPageNumber()) .setParameter("page", pageable.getPageNumber())
.setParameter("size", pageable.getPageSize()) .setParameter("size", pageable.getPageSize())
.getQueryString(); .getQueryString();
final String fieldStrs = "msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, msClosesi, cnt"; final String fieldStrs = "msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, msClosesi, msDatagb, cnt";
return selectList(JudgeListDto.class, listSql, cntSql, fieldStrs, pageable); return selectList(JudgeListDto.class, listSql, cntSql, fieldStrs, pageable);
} }
@ -105,7 +101,7 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
} }
public List<Map<String, Object>> selectJudgeResultGroupByCarnum(@NotNull final JudgeListDto dto) { public List<Map<String, Object>> selectJudgeResultGroupByCarnum(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingJurgeResultGroupByCarnum") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJurgeResultGroupByCarnum")
.setParameter("msuTeam", dto.getMsuTeam()) .setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msDatagb", dto.getMsDatagb()) .setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
@ -117,8 +113,8 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
return selectMapList(listSql, fieldsStrs); return selectMapList(listSql, fieldsStrs);
} }
public List<Map<String, Object>> selectTotJudgeResultGroupByUser(@NotNull final JudgeListDto dto) { public List<Map<String, Object>> findTotJudgeResultGroupByUser(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectTotParkingJudgeResultGroupByUser") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectTotJudgeResultGroupByUser")
.setParameter("msuTeam", dto.getMsuTeam()) .setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msDatagb", dto.getMsDatagb()) .setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
@ -130,8 +126,8 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
return selectMapList(listSql, fieldStrs); return selectMapList(listSql, fieldStrs);
} }
public List<Map<String, Object>> selectJudgeResultList(@NotNull final Map<String, Object> paramMap) { public List<Map<String, Object>> findJudgeResultList(@NotNull final Map<String, Object> paramMap) {
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingJudgeResultList") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeResultList")
.setParameter("msDatagb", (String)paramMap.get("msDatagb")) .setParameter("msDatagb", (String)paramMap.get("msDatagb"))
.setParameter("msuTeam", (String)paramMap.get("msuTeam")) .setParameter("msuTeam", (String)paramMap.get("msuTeam"))
.setParameter("msChasu", (Long)paramMap.get("msChasu")) .setParameter("msChasu", (Long)paramMap.get("msChasu"))
@ -150,11 +146,12 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
.setParameter("msMaincode", msMaincode) .setParameter("msMaincode", msMaincode)
.getQueryString(); .getQueryString();
return Integer.parseInt(selectOneColumn(sql)); String cnt = selectOneColumn(sql);
return cnt == null? 0: Integer.parseInt(cnt);
} }
public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) { public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateJudegResult")
.setParameter("msMaincode", msMaincode) .setParameter("msMaincode", msMaincode)
.setParameter("msSeq", msSeq) .setParameter("msSeq", msSeq)
.setParameter("msResult", msResult) .setParameter("msResult", msResult)
@ -170,7 +167,7 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
.setParameter("scSeq2", dto.getScSeq2()) .setParameter("scSeq2", dto.getScSeq2())
.setParameter("scTransfer", dto.getScTransfer()) .setParameter("scTransfer", dto.getScTransfer())
.getQueryString(); .getQueryString();
final String fieldStrs = "scCode, scSeq, scCarno, scName, scContDoc, scIngb, scCdate, scContDocNm, scIngbNm"; final String fieldStrs = "scCode, scSeq, scCarnum, scName, scContDoc, scIngb, scCdate, scContDocNm, scIngbNm";
return selectList(JudgeTargetDto.class, sql, fieldStrs); return selectList(JudgeTargetDto.class, sql, fieldStrs);
} }
@ -203,8 +200,8 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
public void saveJudgeUsers(@NotNull final List<MinSimsaUser680Sc> list) { public void saveJudgeUsers(@NotNull final List<MinSimsaUser680Sc> list) {
for(MinSimsaUser680Sc vo : list) { for(MinSimsaUser680Sc vo : list) {
insert( insert(
QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer") QueryGenerator.createNamedQuery(NAME_SPACE, "insertJudgeUser")
.setParameter("msuCode", vo.getMsuCode()) .setParameter("msuMaincode", vo.getMsuMaincode())
.setParameter("msuResult", vo.getMsuResult()) .setParameter("msuResult", vo.getMsuResult())
.setParameter("msuTeam", vo.getMsuTeam()) .setParameter("msuTeam", vo.getMsuTeam())
.setParameter("msuUserid", vo.getMsuUserid()) .setParameter("msuUserid", vo.getMsuUserid())
@ -250,7 +247,7 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
return QueryGenerator.createNamedQuery(NAME_SPACE, sqlId) return QueryGenerator.createNamedQuery(NAME_SPACE, sqlId)
.setParameter("curYear", curYear) .setParameter("curYear", curYear)
.setParameter("scCode", dto.getScCode()) .setParameter("scCode", dto.getScCode())
.setParameter("scCarNum", dto.getScCarnum()) .setParameter("scCarnum", dto.getScCarnum())
.setParameter("scDong", dto.getScDong()) .setParameter("scDong", dto.getScDong())
.setParameter("scName", dto.getScName()) .setParameter("scName", dto.getScName())
.setParameter("scContDoc", dto.getScContDoc()) .setParameter("scContDoc", dto.getScContDoc())
@ -260,8 +257,8 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
.setParameter("scWdate", dto.getScWdate()) .setParameter("scWdate", dto.getScWdate())
.setParameter("scJbtime", dto.getScJbtime()) .setParameter("scJbtime", dto.getScJbtime())
.setParameter("scPos", dto.getScPos()) .setParameter("scPos", dto.getScPos())
.setParameter("scZipcode1", dto.getZipcode1()) .setParameter("zipcode1", dto.getZipcode1())
.setParameter("scZipcode2", dto.getZipcode2()) .setParameter("zipcode2", dto.getZipcode2())
.setParameter("scJuso", dto.getScJuso()) .setParameter("scJuso", dto.getScJuso())
.setParameter("scBunji", dto.getScBunji()) .setParameter("scBunji", dto.getScBunji())
.setParameter("scFrecad1", dto.getScFrecad1()) .setParameter("scFrecad1", dto.getScFrecad1())
@ -286,11 +283,15 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
public List<DashboardJudgeListDto> findDashboardJudgeList(@NotNull final String msDatagb) { public List<DashboardJudgeListDto> findDashboardJudgeList(@NotNull final String msDatagb) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList")
.setParameter("msDatagb", msDatagb)
.getQueryString(); .getQueryString();
final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt"; final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt";
return selectList(DashboardJudgeListDto.class, sql, fieldStrs); return selectList(DashboardJudgeListDto.class, sql, fieldStrs);
} }
public List<JudgeListDto> findByUserJudges(@NotNull final JudgeListDto dto) { public List<JudgeListDto> findByUserJudges(@NotNull final JudgeListDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList")
.setParameter("msDatagb", dto.getMsDatagb()) .setParameter("msDatagb", dto.getMsDatagb())

@ -1,11 +1,14 @@
package com.xit.biz.ctgy.v2.repository; package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.MinUserinfoDto; import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc; import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
import com.xit.biz.ctgy.entity.MinUserinfo; import com.xit.biz.ctgy.entity.MinUserinfo;
import com.xit.core.config.database.BaseMpowerDaoSupport; import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.support.sql.parser.QueryGenerator; import com.xit.core.support.sql.parser.QueryGenerator;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -59,4 +62,61 @@ public class UserDao extends BaseMpowerDaoSupport {
} }
public Page<MinUserinfoDto> findMinUserList(@NotNull final MinUserinfoDto dto, @NotNull final Pageable pageable) {
final String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectMinUserinfoListCnt")
.setParameter("userid", dto.getUserid())
.setParameter("name", dto.getName())
.setParameter("team", dto.getTeam())
.getQueryString();
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectMinUserinfoList")
.setParameter("userid", dto.getUserid())
.setParameter("name", dto.getName())
.setParameter("team", dto.getTeam())
.setParameter("page", pageable.getPageNumber())
.setParameter("size", pageable.getPageSize())
.getQueryString();
final String fieldStrs = "userid, accesstype, email, gu, isenable, mphone, name, passwd, regdate, regnum, team";
return selectList(MinUserinfoDto.class, listSql, cntSql, fieldStrs, pageable);
}
public void insertMinUserinfo(@NotNull final MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("isenable", dto.getIsenable())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("regdate", dto.getRegdate())
.setParameter("team", dto.getTeam())
.setParameter("gu", dto.getGu())
.getQueryString();
insert(sql);
}
public void updateMinUserinfo(MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("team", dto.getTeam())
.getQueryString();
update(sql);
}
public void removeMinUserinfo(@NotNull final MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfoIsenable")
.setParameter("userid", dto.getUserid())
.setParameter("isenable", dto.getIsenable())
.getQueryString();
update(sql);
}
} }

@ -7,7 +7,7 @@ import org.springframework.data.domain.Pageable;
public interface IMinUserService { public interface IMinUserService {
Page<MinUserinfo> findMinUsers(final MinUserinfo minUserinfo, Pageable pageable); Page<MinUserinfoDto> findMinUsers(final MinUserinfoDto dto, Pageable pageable);
MinUserinfoDto findMinUser(); MinUserinfoDto findMinUser();

@ -7,6 +7,7 @@ import com.xit.biz.ctgy.v2.service.IMinUserService;
import com.xit.core.constant.ErrorCode; import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException; import com.xit.core.exception.CustomBaseException;
import com.xit.core.oauth2.utils.HeaderUtil; import com.xit.core.oauth2.utils.HeaderUtil;
import com.xit.core.util.Checks;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.*; import org.springframework.data.domain.*;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
@ -22,49 +23,46 @@ import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatc
public class MinUserService implements IMinUserService { public class MinUserService implements IMinUserService {
private final PasswordEncoder passwordEncoder; private final PasswordEncoder passwordEncoder;
private final UserDao minUserinfoDao; private final UserDao userDao;
@Transactional//(readOnly = true) @Transactional(readOnly = true)
public Page<MinUserinfo> findMinUsers(final MinUserinfo minUserinfo, Pageable pageable) { public Page<MinUserinfoDto> findMinUsers(final MinUserinfoDto dto, Pageable pageable) {
Sort sort = Sort.by(Sort.Direction.ASC, "team", "name"); pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize());
pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort); return userDao.findMinUserList(dto, pageable);
ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll()
.withMatcher("userid", contains())
.withMatcher("name", contains());
Example<MinUserinfo> example = Example.of(minUserinfo, exampleMatcher);
return null;
// Page<MinUserinfo> page = repository.findAll(example, pageable);
// return page;
} }
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public MinUserinfoDto findMinUser() { public MinUserinfoDto findMinUser() {
//cmmUserRepos return userDao.findByUserid(HeaderUtil.getUserId()).orElse(null);
//return Optional.empty(); //cmmUserRepository.findOneWithAuthorities(SecurityUtil.getCurrentMemberId());
return minUserinfoDao.findByUserid(HeaderUtil.getUserId()).orElse(null);
} }
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public MinUserinfoDto findMinUserByUserid(final String userid) { public MinUserinfoDto findMinUserByUserid(final String userid) {
return minUserinfoDao.findByUserid(userid).orElse(null); return userDao.findByUserid(userid).orElse(null);
} }
@Override @Override
@Transactional @Transactional
public void saveMinUser(MinUserinfoDto dto) { public void saveMinUser(MinUserinfoDto dto) {
if("Y".equals(dto.getNewYn()) && minUserinfoDao.findByUserid(dto.getUserid()).isPresent()) throw new CustomBaseException(ErrorCode.MEMBER_EXISTS); Optional<MinUserinfoDto> opUser = userDao.findByUserid(dto.getUserid());
dto.setPasswd(passwordEncoder.encode(dto.getPasswd())); dto.setPasswd(passwordEncoder.encode(dto.getPasswd()));
// minUserinfoDao.save(dto); if("Y".equals(dto.getNewYn())){
if(opUser.isPresent() && !Checks.isEmpty(opUser.get().getUserid())) throw new CustomBaseException(ErrorCode.MEMBER_EXISTS);
dto.setSaveInit();
userDao.insertMinUserinfo(dto);
}else{
// 비밀번호가 다른 경우
//if(!savedDto.get().getPasswd().equals(encPasswd)) dto.setPasswd(encPasswd);
userDao.updateMinUserinfo(dto);
}
} }
@Override @Override
@Transactional @Transactional
public void removeMinUser(MinUserinfoDto dto) { public void removeMinUser(MinUserinfoDto dto) {
MinUserinfoDto savedDto = minUserinfoDao.findByUserid(dto.getUserid()).orElseThrow(()-> new CustomBaseException(ErrorCode.USER_NOT_FOUND)); dto.setIsenable("0");
savedDto.setIsenable("0"); userDao.removeMinUserinfo(dto);
// minUserinfoDao.save(savedDto);
} }
} }

@ -190,7 +190,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
// 차수별 심사자별 심사결과 합산 // 차수별 심사자별 심사결과 합산
dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam"))); dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam")));
List<Map<String, Object>> totJudgeUserList = residentAndDisabledDao.selectTotJudgeResultGroupByUser(dto); List<Map<String, Object>> totJudgeUserList = residentAndDisabledDao.findTotJudgeResultGroupByUser(dto);
totJudgeUserList.add(teamList.get(0)); totJudgeUserList.add(teamList.get(0));
// 심사대상 차량 목록 // 심사대상 차량 목록
@ -206,7 +206,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList())); paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList()));
paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList())); paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList()));
List<Map<String,Object>> jurgeUserList = residentAndDisabledDao.selectJudgeResultList(paramMap); List<Map<String,Object>> jurgeUserList = residentAndDisabledDao.findJudgeResultList(paramMap);
// List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> { // List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> {
// paramMap.put("msSeq", m.get("msSeq")); // paramMap.put("msSeq", m.get("msSeq"));

@ -1,10 +1,9 @@
package com.xit.core.config.database; package com.xit.core.config.database;
import com.plf.client.Client; import com.plf.client.Client;
import com.xit.biz.cmm.dto.ComboCodeDto;
import com.xit.core.constant.ErrorCode; import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException;
import com.xit.core.exception.MpowerException; import com.xit.core.exception.MpowerException;
import com.xit.core.util.DBUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -36,9 +35,10 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
T instance = null; T instance = null;
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml("select", sql));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
client.Request(); client.Request();
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
@ -47,10 +47,15 @@ public abstract class BaseMpowerDaoSupport {
if (result.equals("true")){ if (result.equals("true")){
row = client.getMaxRow("list1"); row = client.getMaxRow("list1");
if(row > 1) throw new MpowerException("조회된 데이타가 단일행이 아닙니다"); if(row > 1) throw new MpowerException("조회된 데이타가 단일행이 아닙니다");
if(row == 0) return null;
instance = getT(type, getFeilds(fields), 0, client); instance = getT(type, getFeilds(fields), 0, client);
}else{
throw new MpowerException("SQL 오류::"+result);
} }
return instance; return instance;
}catch (MpowerException e){
throw e;
}catch (Exception e){ }catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR); throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally { } finally {
@ -66,9 +71,10 @@ public abstract class BaseMpowerDaoSupport {
public String selectOneColumn(String sql){ public String selectOneColumn(String sql){
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml("select", sql));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
client.Request(); client.Request();
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
@ -77,13 +83,17 @@ public abstract class BaseMpowerDaoSupport {
if (result.equals("true")){ if (result.equals("true")){
row = client.getMaxRow("list1"); row = client.getMaxRow("list1");
if(row > 1) throw new MpowerException("조회된 데이타가 단일행이 아닙니다"); if(row > 1) throw new MpowerException("조회된 데이타가 단일행이 아닙니다");
if(row == 0) return null;
String value = client.getString("list1", 0, 0); String value = client.getString("list1", 0, 0);
if(" ".equals(value)) value = ""; if(" ".equals(value)) value = "";
return value; return value;
}else{
throw new MpowerException("SQL 오류::"+result);
} }
return null;
}catch (MpowerException e){
throw e;
}catch (Exception e){ }catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR); throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally { } finally {
@ -95,9 +105,10 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
List<Long> list = new ArrayList<>(); List<Long> list = new ArrayList<>();
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml("select", sql));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
client.Request(); client.Request();
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
@ -113,9 +124,13 @@ public abstract class BaseMpowerDaoSupport {
list.add(Long.valueOf(client.getString("list1", i, 0))); list.add(Long.valueOf(client.getString("list1", i, 0)));
} }
} }
}else{
throw new MpowerException("SQL 오류::"+result);
} }
return list; return list;
}catch (MpowerException e){
throw e;
}catch (Exception e){ }catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR); throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally { } finally {
@ -128,9 +143,10 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
List<T> list = new ArrayList<>(); List<T> list = new ArrayList<>();
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml("select", sql));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
client.Request(); client.Request();
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
@ -148,6 +164,8 @@ public abstract class BaseMpowerDaoSupport {
} }
} }
} }
}else{
throw new MpowerException("SQL 오류::"+result);
} }
return list; return list;
@ -166,14 +184,17 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(listSql, "SQL cannot be null"); Objects.requireNonNull(listSql, "SQL cannot be null");
long totalCnt = 0L; long totalCnt = 0L;
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml("select", cntQuery));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", cntQuery));
client.Request(); client.Request();
totalCnt = Long.parseLong(client.getString("list1", 0, 0)); totalCnt = Long.parseLong(client.getString("list1", 0, 0));
if(totalCnt <= 0) return new PageImpl<>(new ArrayList<>(), pageable, 0); if(totalCnt <= 0) return new PageImpl<>(new ArrayList<>(), pageable, 0);
}catch (MpowerException e){
throw e;
}catch (Exception e){ }catch (Exception e){
log.error(e.getLocalizedMessage()); log.error(e.getLocalizedMessage());
throw new MpowerException(ErrorCode.MPOWER_ERROR); throw new MpowerException(ErrorCode.MPOWER_ERROR);
@ -200,9 +221,10 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
Map<String,Object> map = null; Map<String,Object> map = null;
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml("select", sql));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
client.Request(); client.Request();
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
@ -216,9 +238,13 @@ public abstract class BaseMpowerDaoSupport {
for (int j = 0; j < fields.size(); j++) { for (int j = 0; j < fields.size(); j++) {
map.put(fields.get(j), client.getString("list1", 0, j)); map.put(fields.get(j), client.getString("list1", 0, j));
} }
}else{
throw new MpowerException("SQL 오류::"+result);
} }
return map; return map;
}catch (MpowerException e){
throw e;
}catch (Exception e){ }catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR); throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally { } finally {
@ -230,9 +256,10 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String,Object>> list = new ArrayList<>();
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml("select", sql));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
client.Request(); client.Request();
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
@ -249,9 +276,13 @@ public abstract class BaseMpowerDaoSupport {
} }
list.add(map); list.add(map);
} }
}else{
throw new MpowerException("SQL 오류::"+result);
} }
return list; return list;
}catch (MpowerException e){
throw e;
}catch (Exception e){ }catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR); throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally { } finally {
@ -259,6 +290,45 @@ public abstract class BaseMpowerDaoSupport {
} }
} }
/**
* GET
* code
*/
public List<ComboCodeDto> selectComboCodeList(String sql){
Objects.requireNonNull(sql, "SQL cannot be null");
List<ComboCodeDto> list = new ArrayList<>();
Client client = null;
try {
client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
client.Request();
String result = client.getString("result", 0, 0);
int row;
if (result.equals("true")){
row = client.getMaxRow("list1");
if(row>0) {
for (int i = 0; i < row; i++) {
list.add(new ComboCodeDto(client.getString("list1", i, 0), client.getString("list1", i, 1)));
}
}
}else{
throw new MpowerException("SQL 오류::"+result);
}
return list;
}catch (MpowerException e){
throw e;
} catch (Exception e) {
log.error(e.getLocalizedMessage());
throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally {
disConnection(client);
}
}
private String getQueryXml(String syntax, String sql){ private String getQueryXml(String syntax, String sql){
log.info(sql); log.info(sql);
return String.format( return String.format(
@ -294,17 +364,23 @@ public abstract class BaseMpowerDaoSupport {
private int dmlQuery(String sql, String syntax) { private int dmlQuery(String sql, String syntax) {
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
Client client = getConnection(); Client client = null;
client.setInput("SQLXML", getQueryXml(syntax, sql));
try { try {
client = getConnection();
client.setInput("SQLXML", getQueryXml(syntax, sql));
client.Request(); client.Request();
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
if (result.equals("true")){ if (result.equals("true")){
System.out.println("<<<<<<<<<<<<===========#$#$#$$##$#$$#$#$$$$$$$====>>>>>>>>>"); System.out.println("<<<<<<<<<<<<===========#$#$#$$##$#$$#$#$$$$$$$====>>>>>>>>>");
}else{
throw new MpowerException("SQL 오류::"+result);
} }
return 1; return 1;
}catch (MpowerException e){
throw e;
}catch (Exception e){ }catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR); throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally { } finally {
@ -371,3 +447,53 @@ public abstract class BaseMpowerDaoSupport {
return list; return list;
} }
} }
/*
//첨부파일 터널링 서버로 복사
public void fnFileUpload(String tmpFileLocation,String realRcRilenm){
String fph = tunullingFile; //터널링에 복사되는 파일경로
try{
Client mp = new Client("127.0.0.1", 2500);
mp.getConnection("XitFile.XitUpload");
mp.setInput("dir",tunullingFile);
mp.setInput("upfile1",tmpFileLocation+realRcRilenm,true);
mp.Request();
}catch(Exception e){
e.printStackTrace();
}
//logger.debug(fph);
}
//터널링에서 웹서버로 첨부파일 복사
public static void fnDownFile(String fileName,String sessionId){
String serviceName = "XitFile.XitDownload";
String fph = MpowerUtil.class.getResource("").getPath();
fph = fph.replace("WEB-INF/classes/xit/cmmn/utill/", "vioPhoto/"+sessionId+"/"); //웹서버 저장 위치
String fphs = fph.substring(0,1);
if(fphs.equals("/")){
fph = fph.substring(1);
}
String tmpTunullingFile = tunullingFile; //터널링에 저장된 단속사진 경로
try{
Client mp = new Client("127.0.0.1", 2500);
mp.getConnection("XitFile.XitDownload");
mp.setInput("dnfile1",tmpTunullingFile+ fileName); //터널링에 실질 존재하는 경로,파일명
mp.Request();
String result = mp.getString("result", 0, 0);
if (result.equals("true")){
mp.getFileName("imageA");
mp.savefile("imageA", fph);
}
}catch(Exception e){
e.printStackTrace();
}
//logger.debug("웹서버 저장되는 첨부파일 위치:"+fph);
System.out.println("웹서버 저장되는 첨부파일 위치:"+fph);
}
*/

@ -9,11 +9,11 @@ import java.util.Optional;
@Repository @Repository
public class RefreshTokenDao extends BaseMpowerDaoSupport { public class RefreshTokenDao extends BaseMpowerDaoSupport {
public Optional<RefreshToken> findByKey(String key){ public RefreshToken findByKey(String key){
String sql = QueryGenerator.createNamedQuery("refreshToken", "selectRefreshToken") String sql = QueryGenerator.createNamedQuery("refreshToken", "selectRefreshToken")
.setParameter("key", key) .setParameter("key", key)
.getQueryString(); .getQueryString();
return Optional.ofNullable(selectOne(RefreshToken.class, sql, "key, value")); return selectOne(RefreshToken.class, sql, "key, value");
} }
public void save(RefreshToken refreshToken){ public void save(RefreshToken refreshToken){

@ -83,7 +83,7 @@ public class OAuth2AuthenticationSuccessHandler extends SimpleUrlAuthenticationS
// DB 저장 // DB 저장
//RefreshToken savedRefreshToken = refreshTokenRepository.findByKey(userInfo.getId()).orElse(null); //RefreshToken savedRefreshToken = refreshTokenRepository.findByKey(userInfo.getId()).orElse(null);
RefreshToken savedRefreshToken = refreshTokenDao.findByKey(userInfo.getId()).orElse(null); RefreshToken savedRefreshToken = refreshTokenDao.findByKey(userInfo.getId());
if (savedRefreshToken != null) { if (savedRefreshToken != null) {
//userRefreshToken(refreshToken); //userRefreshToken(refreshToken);
savedRefreshToken.setValue(refreshToken); savedRefreshToken.setValue(refreshToken);

@ -79,6 +79,7 @@
FROM min_simsa680_sc MSS FROM min_simsa680_sc MSS
, msu680_sc_view MSV , msu680_sc_view MSV
WHERE MSS.ms_maincode = MSV.msu_maincode WHERE MSS.ms_maincode = MSV.msu_maincode
AND MSS.ms_datagb = #{msDatagb}
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MSV.msu_team = #{msuTeam} AND MSV.msu_team = #{msuTeam}
</if> </if>

@ -2,8 +2,8 @@
<entity-mappings namespace="cmmCode"> <entity-mappings namespace="cmmCode">
<native-query id="selectComboCodes"> <native-query id="selectComboCodes">
/* refreshToken-mapper|selectComboCodes|julim */ /* cmmCode-mapper|selectComboCodes|julim */
SELECT code_cd as code, SELECT code_cd as code
, code_nm as value , code_nm as value
FROM tb_cmm_code_s FROM tb_cmm_code_s
WHERE code_grp_id = #{codeGrpId} WHERE code_grp_id = #{codeGrpId}

@ -30,6 +30,123 @@
WHERE userid = #{userid} WHERE userid = #{userid}
</native-query> </native-query>
<native-query id="selectAllByTeamAndIsenableAndAccesstype">
/* minuserinfo-mapper|selectAllByTeamAndIsenableAndAccesstype|julim */
SELECT userid
, accesstype
, email
, gu
, isenable
, mphone
, passwd
, regdate
, regnum
, team
FROM min_userinfo
WHERE team = #{team}
AND isenable = #{isenable}
AND accesstype = #{accesstype}
</native-query>
<native-query id="selectMinUserinfoList">
/* minuserinfo-mapper|selectMinUserinfoList|julim */
SELECT userid
, accesstype
, email
, gu
, isenable
, mphone
, name
, passwd
, regdate
, regnum
, team
FROM (
SELECT R.*, ROWNUM rn
FROM (
SELECT *
FROM min_userinfo
<where>
<if test="userid != null and userid != ''">
AND userid LIKE #{userid}||'%'
</if>
<if test="name != null and name != ''">
AND name LIKE #{name}||'%'
</if>
<if test="team != null and team != ''">
AND team = #{team}
</if>
</where>
ORDER BY team, name
) R
WHERE ROWNUM &lt;= (#{page} + 1) * #{size}
)
WHERE rn &gt; #{page} * #{size}
AND ROWNUM &lt;= #{size}
</native-query>
<native-query id="selectMinUserinfoListCnt">
/* minuserinfo-mapper|selectMinUserinfoListCnt|julim */
SELECT count(userid) as totalCount
FROM min_userinfo
<where>
<if test="userid != null and userid != ''">
AND userid LIKE #{userid}||'%'
</if>
<if test="name != null and name != ''">
AND name LIKE #{name}||'%'
</if>
<if test="team != null and team != ''">
AND team = #{team}
</if>
</where>
</native-query>
<native-query id="insertMinUserinfo">
/* minuserinfo-mapper|insertMinUserinfo|julim */
INSERT
INTO min_userinfo (
userid
, accesstype
, email
, gu
, isenable
, mphone
, name
, passwd
, regdate
, team
) VALUES (
#{userid}
, #{accesstype}
, #{email}
, #{gu}
, #{isenable}
, #{mphone}
, #{name}
, #{passwd}
, #{regdate}
, #{team}
)
</native-query>
<native-query id="updateMinUserinfo">
/* minuserinfo-mapper|updateMinUserinfo|julim */
UPDATE min_userinfo
SET passwd = #{passwd}
, accesstype = #{accesstype}
, team = #{team}
, name = #{name}
, mphone = #{mphone}
, email = #{email}
WHERE userid= #{userid}
</native-query>
<native-query id="updateMinUserinfoIsenable">
/* minuserinfo-mapper|updateMinUserinfoIsenable|julim */
UPDATE min_userinfo
SET isenable = #{isenable}
WHERE userid= #{userid}
</native-query>
</entity-mappings> </entity-mappings>

@ -145,8 +145,8 @@
msu_team, msu_team,
msu_userid msu_userid
) VALUES ( ) VALUES (
#{msuMaincode},
min_simsa_user680_seq.NEXTVAL, min_simsa_user680_seq.NEXTVAL,
#{msuCode},
#{msuResult}, #{msuResult},
#{msuTeam}, #{msuTeam},
#{msuUserid} #{msuUserid}
@ -155,7 +155,7 @@
<native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu"> <native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu">
/* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */ /* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */
SELECT MS.msu_team AS msuTeam SELECT MV.msu_team AS msuTeam
, NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu , NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
, 0 as seo , 0 as seo
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu , NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
@ -171,6 +171,7 @@
AND MS.ms_sdate = #{msSdate} AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate} AND MS.ms_edate = #{msEdate}
GROUP BY MV.msu_team, MS.ms_chasu GROUP BY MV.msu_team, MS.ms_chasu
ORDER BY MV.msu_team
</native-query> </native-query>
<native-query id="selectParkingJudgeTeamGroupByChasuAndTeamList"> <native-query id="selectParkingJudgeTeamGroupByChasuAndTeamList">
@ -273,7 +274,7 @@
/* parking-mapper|selectJudegStdCount|julim */ /* parking-mapper|selectJudegStdCount|julim */
SELECT count(msu_code) SELECT count(msu_code)
FROM min_simsa_user680 FROM min_simsa_user680
WHERE ms_maincode = #{msuMaincode} WHERE msu_maincode = #{msMaincode}
AND msu_result= '2' AND msu_result= '2'
</native-query> </native-query>

@ -15,7 +15,7 @@
INTO refresh_token ( INTO refresh_token (
key, key,
value value
) VALUE ( ) VALUES (
#{key}, #{key},
#{value} #{value}
) )

@ -28,12 +28,12 @@
AND code_mcd = 'RC_INGB') as scIngbNm, AND code_mcd = 'RC_INGB') as scIngbNm,
(SELECT code_nm (SELECT code_nm
FROM tb_cmm_code_s FROM tb_cmm_code_s
WHERE GRS.GRS.sc_state = code_cd WHERE GRS.sc_state = code_cd
AND code_grp_id = 'TRAFFIC' AND code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA' AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'SC_STATE') as scStateNm AND code_mcd = 'SC_STATE') as scStateNm
FROM gn_recall_sc GRS FROM gn_recall_sc GRS
WHERE GRS.GRS.sc_code in ( WHERE GRS.sc_code in (
SELECT sc_code SELECT sc_code
FROM ( FROM (
SELECT R.sc_code, ROWNUM rn SELECT R.sc_code, ROWNUM rn
@ -75,8 +75,8 @@
GRS.sc_pos, GRS.sc_pos,
GRS.sc_transfer, GRS.sc_transfer,
GRS.sc_answer, GRS.sc_answer,
GRS.sc_zipcode1, GRS.zipcode1,
GRS.sc_zipcode2, GRS.zipcode2,
GRS.sc_juso, GRS.sc_juso,
GRS.sc_bunji, GRS.sc_bunji,
GRS.sc_frecad1, GRS.sc_frecad1,
@ -218,8 +218,8 @@
, sc_wdate = #{scWdate} , sc_wdate = #{scWdate}
, sc_jbtime = #{scJbtime} , sc_jbtime = #{scJbtime}
, sc_pos = #{scPos} , sc_pos = #{scPos}
, sc_zipcode1 = #{scZipcode1} , zipcode1 = #{zipcode1}
, sc_zipcode2 = #{scZipcode2} , zipcode2 = #{zipcode2}
, sc_juso = #{scJuso} , sc_juso = #{scJuso}
, sc_bunji = #{scBunji} , sc_bunji = #{scBunji}
, sc_frecad1 = NVL(#{scFrecad1}, sc_frecad1) , sc_frecad1 = NVL(#{scFrecad1}, sc_frecad1)
@ -391,8 +391,8 @@
msu_team, msu_team,
msu_userid msu_userid
) VALUES ( ) VALUES (
#{msuMaincode},
min_simsa_user680_sc_seq.NEXTVAL, min_simsa_user680_sc_seq.NEXTVAL,
#{msuCode}
#{msuResult}, #{msuResult},
#{msuTeam}, #{msuTeam},
#{msuUserid} #{msuUserid}
@ -401,14 +401,14 @@
<native-query id="selectTotJudgeResultGroupByTeamAndChasu"> <native-query id="selectTotJudgeResultGroupByTeamAndChasu">
/* residentAndDisabled-mapper|selectTotJudgeResultGroupByTeamAndChasu|julim */ /* residentAndDisabled-mapper|selectTotJudgeResultGroupByTeamAndChasu|julim */
SELECT MS.msu_team AS msuTeam SELECT MV.msu_team AS msuTeam
, NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu , NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
, 0 as seo , 0 as seo
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu , NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot , NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name , '결과' as name
FROM min_simsa680_sc MS FROM min_simsa680_sc MS
, msu680_view MV , msu680_sc_view MV
WHERE MS.ms_maincode = MV.msu_maincode WHERE MS.ms_maincode = MV.msu_maincode
<if test="msuTeam != null and msuTeam != ''"> <if test="msuTeam != null and msuTeam != ''">
AND MV.msu_team = #{msuTeam} AND MV.msu_team = #{msuTeam}
@ -418,6 +418,7 @@
AND MS.ms_sdate = #{msSdate} AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate} AND MS.ms_edate = #{msEdate}
GROUP BY MV.msu_team, MS.ms_chasu GROUP BY MV.msu_team, MS.ms_chasu
ORDER BY MV.msu_team
</native-query> </native-query>
<native-query id="selectJudgeTeamGroupByChasuAndTeamList"> <native-query id="selectJudgeTeamGroupByChasuAndTeamList">
@ -429,7 +430,7 @@
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot , NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name , '결과' as name
FROM min_simsa680_sc MS FROM min_simsa680_sc MS
, msu680_view MV , msu680_sc_view MV
WHERE MS.ms_maincode = MV.msu_maincode WHERE MS.ms_maincode = MV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'> <if test='msuTeam != null and msuTeam != ""'>
AND MV.msu_team = #{msuTeam} AND MV.msu_team = #{msuTeam}
@ -448,9 +449,9 @@
, 0 as seo , 0 as seo
, SUM(DECODE(MSU.MSU_RESULT, '1', 1, 0)) as mibu , SUM(DECODE(MSU.MSU_RESULT, '1', 1, 0)) as mibu
, SUM(DECODE(MSU.MSU_RESULT, '1', 1, '2', 1, 0)) as tot , SUM(DECODE(MSU.MSU_RESULT, '1', 1, '2', 1, 0)) as tot
, MU.name , name
FROM min_simsa680_sc MS FROM min_simsa680_sc MS
, min_simsa_user680 MSU , min_simsa_user680_sc MSU
, min_userinfo MU , min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_datagb = #{msDatagb} AND MS.ms_datagb = #{msDatagb}
@ -471,7 +472,7 @@
, MS.ms_seq AS msSeq , MS.ms_seq AS msSeq
, MS.ms_carnum AS msCarnum , MS.ms_carnum AS msCarnum
FROM min_simsa680_sc MS FROM min_simsa680_sc MS
, min_simsa_user680 MSU , min_simsa_user680_sc MSU
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_datagb = #{msDatagb} AND MS.ms_datagb = #{msDatagb}
AND MS.ms_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
@ -504,7 +505,7 @@
AND code_mcd = 'RESULT' AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msuResult AND code_cd = MSU.msu_result) as msuResult
FROM min_simsa680_sc MS FROM min_simsa680_sc MS
, min_simsa_user680 MSU , min_simsa_user680_sc MSU
, min_userinfo MU , min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_datagb = #{msDatagb} AND MS.ms_datagb = #{msDatagb}
@ -524,7 +525,7 @@
/* residentAndDisabled-mapper|selectJudegStdCount|julim */ /* residentAndDisabled-mapper|selectJudegStdCount|julim */
SELECT count(msu_code) SELECT count(msu_code)
FROM min_simsa_user680_sc FROM min_simsa_user680_sc
WHERE ms_maincode = #{msuMaincode} WHERE msu_maincode = #{msMaincode}
AND msu_result= '2' AND msu_result= '2'
</native-query> </native-query>
@ -537,26 +538,26 @@
</native-query> </native-query>
<native-query id="selectJudgeTarget"> <native-query id="selectJudgeTarget">
/* parking-mapper|selectJudgeTarget|julim */ /* residentAndDisabled-mapper|selectJudgeTarget|julim */
SELECT GRC.sc_code, SELECT GRC.sc_code,
GRC.sc_seq, GRC.sc_seq,
GRC.sc_carno, GRC.sc_carnum,
GRC.sc_name, GRC.sc_name,
GRC.sc_cont_doc, GRC.sc_cont_doc,
GRC.sc_ingb, GRC.sc_ingb,
GRC.sc_cdate, GRC.sc_cdate,
(SELECT code_nm (SELECT code_nm
FROM tb_cmm_code_s FROM tb_cmm_code_s
WHERE GRC.rc_cont_doc = code_cd WHERE GRC.sc_cont_doc = code_cd
AND code_grp_id = 'TRAFFIC' AND code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA' AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RC_CONT_DOC') as rcContDocNm, AND code_mcd = 'RC_CONT_DOC') as scContDocNm,
(SELECT code_nm (SELECT code_nm
FROM tb_cmm_code_s FROM tb_cmm_code_s
WHERE GRC.rc_ingb = code_cd WHERE GRC.sc_ingb = code_cd
AND code_grp_id = 'TRAFFIC' AND code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA' AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RC_INGB') as rcIngbNm AND code_mcd = 'RC_INGB') as scIngbNm
FROM gn_recall_sc GRC FROM gn_recall_sc GRC
WHERE GRC.sc_datagb = #{scDatagb} WHERE GRC.sc_datagb = #{scDatagb}
AND GRC.sc_state = '1' AND GRC.sc_state = '1'
@ -601,7 +602,7 @@
WHERE ROWNUM = 1) T WHERE ROWNUM = 1) T
WHERE MS.ms_datagb = #{msDatagb} WHERE MS.ms_datagb = #{msDatagb}
AND MS.ms_result = '0' AND MS.ms_result = '0'
MS.ms_maincode = MSU.msu_maincode AND MS.ms_maincode = MSU.msu_maincode
AND MSU.msu_userid = MU.userid AND MSU.msu_userid = MU.userid
AND MS.ms_edate = T.ms_edate AND MS.ms_edate = T.ms_edate
GROUP BY MS.ms_edate, MSU.msu_team, MU.name GROUP BY MS.ms_edate, MSU.msu_team, MU.name

Loading…
Cancel
Save