feat: mpower 적용 - 거주자 / 장애인

dev
Jonguk. Lim 2 years ago
parent c4a6e4acad
commit 85e212501a

@ -35,7 +35,7 @@ import java.io.IOException;
AppProperties.class AppProperties.class
}) })
@ComponentScan( @ComponentScan(
nameGenerator = CustomBeanNameGenerator.class, //nameGenerator = CustomBeanNameGenerator.class,
basePackages = {"com.xit.biz", "com.xit.core"}, basePackages = {"com.xit.biz", "com.xit.core"},
excludeFilters = @ComponentScan.Filter( excludeFilters = @ComponentScan.Filter(
type = FilterType.ASPECTJ, type = FilterType.ASPECTJ,
@ -66,9 +66,8 @@ public class Application { //WebApplicationInitializer {
// beanName Generator 등록 : API v1, v2 등으로 분류하는 경우 // beanName Generator 등록 : API v1, v2 등으로 분류하는 경우
// Bean 이름 식별시 풀패키지 명으로 식별 하도록 함 // Bean 이름 식별시 풀패키지 명으로 식별 하도록 함
//CustomBeanNameGenerator beanNameGenerator = new CustomBeanNameGenerator(); CustomBeanNameGenerator beanNameGenerator = new CustomBeanNameGenerator();
//beanNameGenerator.addBasePackages(BEAN_GEN_BASE_PACKAGE); applicationBuilder.beanNameGenerator(beanNameGenerator);
//applicationBuilder.beanNameGenerator(beanNameGenerator);
//TODO : 이벤트 실행 시점이 Application context 실행 이전인 경우 리스너 추가 //TODO : 이벤트 실행 시점이 Application context 실행 이전인 경우 리스너 추가
//application.listeners(new xitCoreApplicationListner()); //application.listeners(new xitCoreApplicationListner());

@ -33,7 +33,6 @@ public class BoardController {
private final IBoardService service; private final IBoardService service;
// TODO :: 파라메터 정의 필요
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "게시글 목록 조회" , description = "게시글 목록 조회") @Operation(summary = "게시글 목록 조회" , description = "게시글 목록 조회")
@Parameters({ @Parameters({

@ -35,7 +35,6 @@ public class MinUserController {
private final MinUserinfoMapstruct mapstruct = Mappers.getMapper(MinUserinfoMapstruct.class); private final MinUserinfoMapstruct mapstruct = Mappers.getMapper(MinUserinfoMapstruct.class);
// TODO :: 파라메터 정의 필요
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "사용자 목록 조회" , description = "사용자 목록 조회") @Operation(summary = "사용자 목록 조회" , description = "사용자 목록 조회")
@Parameters({ @Parameters({

@ -50,7 +50,6 @@ public class ResidentAndDisabledController {
// 관리자 // 관리자
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// TODO :: 파라메터 정의 필요
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "거주자/장애인 의견지술자료 목록 조회" , description = "거주자/장애인 의견진술자료 목록 조회") @Operation(summary = "거주자/장애인 의견지술자료 목록 조회" , description = "거주자/장애인 의견진술자료 목록 조회")
@Parameters({ @Parameters({

@ -336,8 +336,6 @@ public class IResidentAndDisabledRepositoryImpl implements IResidentAndDisabledR
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
builder.and(minSimsa680Sc.msDatagb.eq(dto.getMsDatagb())); builder.and(minSimsa680Sc.msDatagb.eq(dto.getMsDatagb()));
builder.and(minSimsaUser680Sc.msuUserid.eq(HeaderUtil.getUserId())); builder.and(minSimsaUser680Sc.msuUserid.eq(HeaderUtil.getUserId()));
//TODO : 테스트를 위행 임시로 코멘트 처리
//builder.and(minSimsa680Sc.msResult.eq(CtgyConstants.Judge.RESULT_JUDGE_PRE.getCode()));
return queryFactory return queryFactory
.select(Projections.fields( .select(Projections.fields(

@ -33,7 +33,6 @@ public class BoardController {
private final IBoardService service; private final IBoardService service;
// TODO :: 파라메터 정의 필요
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "게시글 목록 조회" , description = "게시글 목록 조회") @Operation(summary = "게시글 목록 조회" , description = "게시글 목록 조회")
@Parameters({ @Parameters({

@ -31,7 +31,6 @@ public class MinUserController {
private final IMinUserService service; private final IMinUserService service;
// TODO :: 파라메터 정의 필요
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "사용자 목록 조회" , description = "사용자 목록 조회") @Operation(summary = "사용자 목록 조회" , description = "사용자 목록 조회")
@Parameters({ @Parameters({

@ -28,7 +28,6 @@ public class PublicBoardController {
private final IPublicBoardService service; private final IPublicBoardService service;
// TODO :: 파라메터 정의 필요
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "공지사항 목록 조회" , description = "공지사항 목록 조회") @Operation(summary = "공지사항 목록 조회" , description = "공지사항 목록 조회")
@Parameters({ @Parameters({

@ -50,7 +50,6 @@ public class ResidentAndDisabledController {
// 관리자 // 관리자
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// TODO :: 파라메터 정의 필요
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "거주자/장애인 의견지술자료 목록 조회" , description = "거주자/장애인 의견진술자료 목록 조회") @Operation(summary = "거주자/장애인 의견지술자료 목록 조회" , description = "거주자/장애인 의견진술자료 목록 조회")
@Parameters({ @Parameters({

@ -8,13 +8,15 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.util.*; import java.util.*;
@Repository @Repository
@Slf4j @Slf4j
public class BoardDao extends BaseMpowerDaoSupport { public class BoardDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "board";
public Page<BoardDto> findAll(final BoardDto dto, final Pageable pageable) { public Page<BoardDto> findAll(@NotNull final BoardDto dto, @NotNull final Pageable pageable) {
final String cntSql = getSql("selectBoardListCnt", dto, pageable); final String cntSql = getSql("selectBoardListCnt", dto, pageable);
final String listSql = getSql("selectBoardList", dto, pageable); final String listSql = getSql("selectBoardList", dto, pageable);
final String fieldStrs = "ciCode, ciName, ciContentno, ciTitle, ciContents, ciNalja, ciStep, ciRevel, ciRef, ciHit, ciPass, ciId"; final String fieldStrs = "ciCode, ciName, ciContentno, ciTitle, ciContents, ciNalja, ciStep, ciRevel, ciRef, ciHit, ciPass, ciId";
@ -22,8 +24,8 @@ public class BoardDao extends BaseMpowerDaoSupport {
return selectList(BoardDto.class, listSql, cntSql, fieldStrs, pageable); return selectList(BoardDto.class, listSql, cntSql, fieldStrs, pageable);
} }
private String getSql(final String sqlId, final BoardDto dto, final Pageable pageable){ private String getSql(@NotNull final String sqlId, @NotNull final BoardDto dto, @NotNull final Pageable pageable){
return QueryGenerator.createNamedQuery("board", sqlId) return QueryGenerator.createNamedQuery(NAME_SPACE, sqlId)
.setParameter("ciTitle", dto.getCiTitle()) .setParameter("ciTitle", dto.getCiTitle())
.setParameter("ciName", dto.getCiName()) .setParameter("ciName", dto.getCiName())
.setParameter("ciContents", dto.getCiContents()) .setParameter("ciContents", dto.getCiContents())
@ -32,14 +34,14 @@ public class BoardDao extends BaseMpowerDaoSupport {
.getQueryString(); .getQueryString();
} }
public void updateInHitForMinCivBoard680(final Long ciCode) { public void updateInHitForMinCivBoard680(@NotNull final Long ciCode) {
final String sql = QueryGenerator.createNamedQuery("board", "updateCiHit") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateCiHit")
.setParameter("ciCode", ciCode).getQueryString(); .setParameter("ciCode", ciCode).getQueryString();
update(sql); update(sql);
} }
public Optional<BoardDto> findById(final Long ciCode) { public Optional<BoardDto> findById(@NotNull final Long ciCode) {
final String sql = QueryGenerator.createNamedQuery("board", "selectBoard") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectBoard")
.setParameter("ciCode", ciCode) .setParameter("ciCode", ciCode)
.getQueryString(); .getQueryString();
final String fieldStrs = "ciCode, ciContentno, ciContents, ciEmail, ciHit, ciId, ciIp, ciNalja, ciName, ciPass, ciPwd, ciRef, ciRevel, ciStep, ciTime, ciTitle"; final String fieldStrs = "ciCode, ciContentno, ciContents, ciEmail, ciHit, ciId, ciIp, ciNalja, ciName, ciPass, ciPwd, ciRef, ciRevel, ciStep, ciTime, ciTitle";
@ -47,8 +49,8 @@ public class BoardDao extends BaseMpowerDaoSupport {
return Optional.ofNullable(selectOne(BoardDto.class, sql, fieldStrs)); return Optional.ofNullable(selectOne(BoardDto.class, sql, fieldStrs));
} }
public void insertBoard(final BoardDto dto) { public void insertBoard(@NotNull final BoardDto dto) {
final String sql = QueryGenerator.createNamedQuery("board", "insertBoard") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertBoard")
.setParameter("ciTitle", dto.getCiTitle()) .setParameter("ciTitle", dto.getCiTitle())
.setParameter("ciContents", dto.getCiContents()) .setParameter("ciContents", dto.getCiContents())
.setParameter("ciEmail", dto.getCiEmail()) .setParameter("ciEmail", dto.getCiEmail())
@ -67,8 +69,8 @@ public class BoardDao extends BaseMpowerDaoSupport {
insert(sql); insert(sql);
} }
public void updateBoard(final BoardDto dto){ public void updateBoard(@NotNull final BoardDto dto){
final String sql = QueryGenerator.createNamedQuery("board", "updateBoard") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateBoard")
.setParameter("ciCode", dto.getCiCode()) .setParameter("ciCode", dto.getCiCode())
.setParameter("ciTitle", dto.getCiTitle()) .setParameter("ciTitle", dto.getCiTitle())
.setParameter("ciContents", dto.getCiContents()) .setParameter("ciContents", dto.getCiContents())
@ -76,15 +78,15 @@ public class BoardDao extends BaseMpowerDaoSupport {
update(sql); update(sql);
} }
public int findByCiRefCnt(final Long ciRef) { public int findByCiRefCnt(@NotNull final Long ciRef) {
final String sql = QueryGenerator.createNamedQuery("board", "selectCntByCiRef") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectCntByCiRef")
.setParameter("ciRef", ciRef) .setParameter("ciRef", ciRef)
.getQueryString(); .getQueryString();
return Integer.parseInt(selectOneColumn(sql)); return Integer.parseInt(selectOneColumn(sql));
} }
public void deleteById(final Long ciCode) { public void deleteById(@NotNull final Long ciCode) {
final String sql = QueryGenerator.createNamedQuery("board", "deleteBoard") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "deleteBoard")
.setParameter("ciCode", ciCode) .setParameter("ciCode", ciCode)
.getQueryString(); .getQueryString();
delete(sql); delete(sql);

@ -2,7 +2,10 @@ package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.BoardDto; import com.xit.biz.ctgy.dto.BoardDto;
import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsaUser680;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
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 com.xit.core.util.ConvertUtils; import com.xit.core.util.ConvertUtils;
@ -11,6 +14,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -18,14 +22,15 @@ import java.util.stream.Collectors;
@Repository @Repository
public class ParkingDao extends BaseMpowerDaoSupport { public class ParkingDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "parking";
public Page<JudgeListDto> findParkings(JudgeListDto dto, Pageable pageable) { public Page<JudgeListDto> findParkings(@NotNull final JudgeListDto dto, @NotNull final Pageable pageable) {
final String cntSql = QueryGenerator.createNamedQuery("parking", "selectParkingListCnt") final String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingListCnt")
.setParameter("msYear", dto.getMsYear()) .setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.getQueryString(); .getQueryString();
final String listSql = QueryGenerator.createNamedQuery("parking", "selectParkingList") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingList")
.setParameter("msYear", dto.getMsYear()) .setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.setParameter("page", pageable.getPageNumber()) .setParameter("page", pageable.getPageNumber())
@ -36,8 +41,8 @@ public class ParkingDao extends BaseMpowerDaoSupport {
return selectList(JudgeListDto.class, listSql, cntSql, fieldStrs, pageable); return selectList(JudgeListDto.class, listSql, cntSql, fieldStrs, pageable);
} }
public List<Map<String, Object>> selectParkingJudgeTeamGroupByChasuAndTeamList(JudgeListDto dto) { public List<Map<String, Object>> selectParkingJudgeTeamGroupByChasuAndTeamList(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery("parking", "selectTotParkingJudgeResultGroupByTeamAndChasu") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectTotParkingJudgeResultGroupByTeamAndChasu")
.setParameter("msuTeam", dto.getMsuTeam()) .setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate()) .setParameter("msSdate", dto.getMsSdate())
@ -48,8 +53,8 @@ public class ParkingDao extends BaseMpowerDaoSupport {
return selectMapList(listSql, fieldStrs); return selectMapList(listSql, fieldStrs);
} }
public List<Map<String, Object>> selectParkingJurgeResultGroupByCarnum(JudgeListDto dto) { public List<Map<String, Object>> selectParkingJurgeResultGroupByCarnum(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery("parking", "selectParkingJurgeResultGroupByCarnum") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingJurgeResultGroupByCarnum")
.setParameter("msuTeam", dto.getMsuTeam()) .setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate()) .setParameter("msSdate", dto.getMsSdate())
@ -60,8 +65,8 @@ public class ParkingDao extends BaseMpowerDaoSupport {
return selectMapList(listSql, fieldsStrs); return selectMapList(listSql, fieldsStrs);
} }
public List<Map<String, Object>> selectTotParkingJudgeResultGroupByUser(JudgeListDto dto) { public List<Map<String, Object>> selectTotParkingJudgeResultGroupByUser(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery("parking", "selectTotParkingJudgeResultGroupByUser") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectTotParkingJudgeResultGroupByUser")
.setParameter("msuTeam", dto.getMsuTeam()) .setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msChasu", dto.getMsChasu()) .setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate()) .setParameter("msSdate", dto.getMsSdate())
@ -74,11 +79,11 @@ public class ParkingDao extends BaseMpowerDaoSupport {
public List<Map<String, Object>> selectParkingJudgeResultList(Map<String, Object> paramMap) { public List<Map<String, Object>> selectParkingJudgeResultList(@NotNull final Map<String, Object> paramMap) {
final String listSql = QueryGenerator.createNamedQuery("parking", "selectParkingJudgeResultList") final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingJudgeResultList")
.setParameter("msDatagb", String.valueOf(paramMap.get("msDatagb"))) .setParameter("msDatagb", (String)paramMap.get("msDatagb"))
.setParameter("msuTeam", String.valueOf(paramMap.get("msuTeam"))) .setParameter("msuTeam", (String)paramMap.get("msuTeam"))
.setParameter("msChasu", Long.parseLong(String.valueOf(paramMap.get("msChasu")))) .setParameter("msChasu", (Long)paramMap.get("msChasu"))
.setParameter("msSdate", (LocalDate)paramMap.get("msSdate")) .setParameter("msSdate", (LocalDate)paramMap.get("msSdate"))
.setParameter("msEdate", (LocalDate) paramMap.get("msEdate")) .setParameter("msEdate", (LocalDate) paramMap.get("msEdate"))
.setParameter("seqList", (List)paramMap.get("seqList")) .setParameter("seqList", (List)paramMap.get("seqList"))
@ -89,9 +94,71 @@ public class ParkingDao extends BaseMpowerDaoSupport {
return selectMapList(listSql, fieldsStrs); return selectMapList(listSql, fieldsStrs);
} }
// public List<ParkingTargetDto> findParkingJudgeTargets(ParkingTargetDto dto) { public int getJudgeStdCnt(@NotNull final Long msMaincode) {
// return null; final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
// } .setParameter("msMaincode", msMaincode)
.getQueryString();
return Integer.parseInt(selectOneColumn(sql));
}
public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
.setParameter("msMaincode", msMaincode)
.setParameter("msSeq", msSeq)
.setParameter("msResult", msResult)
.getQueryString();
update(sql);
}
public List<ParkingTargetDto> findParkingJudgeTargets(@NotNull final ParkingTargetDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeTarget")
.setParameter("rcSeq1", dto.getRcSeq1())
.setParameter("rcSeq2", dto.getRcSeq2())
.setParameter("rcIrTransfer", dto.getRcIrTransfer())
.getQueryString();
final String fieldStrs = "mmCode, rcCode, rcSeq, mmOcarno, mmNcarno, rcName, rcContDoc, rcIngb, rcDate, scContDocNm, scIngbNm";
return selectList(ParkingTargetDto.class, sql, fieldStrs);
}
public int insertJudgeTargetIntoSelect(@NotNull final ParkingTargetDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertJudgeTargetIntoSelect")
.setParameter("scCode", dto.getRcCode())
.setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msStartsi", dto.getMsStartsi())
.setParameter("msEdate", dto.getMsEdate())
.setParameter("msCdate", dto.getMsCdate())
.setParameter("msClosesi", dto.getMsClosesi())
.setParameter("msResult", dto.getMsResult())
.getQueryString();
insert(sql);
return 1;
}
public void updateTransfer(@NotNull final Long rcCode, @NotNull final String rcIrTransfer) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer")
.setParameter("rcCode", rcCode)
.setParameter("rcIrTransfer", rcIrTransfer)
.getQueryString();
update(sql);
}
public void saveJudgeUsers(@NotNull final List<MinSimsaUser680> list) {
for(MinSimsaUser680 vo : list) {
insert(
QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer")
.setParameter("msuCode", vo.getMsuCode())
.setParameter("msuResult", vo.getMsuResult())
.setParameter("msuTeam", vo.getMsuTeam())
.setParameter("msuUserid", vo.getMsuUserid())
.getQueryString()
);
}
}
// //
// public List<Long> findAllMsMaincode(Long msChasu, LocalDate msSdate, LocalDate msEdate) { // public List<Long> findAllMsMaincode(Long msChasu, LocalDate msSdate, LocalDate msEdate) {
// return null; // return null;

@ -9,33 +9,35 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
@Repository @Repository
@Slf4j @Slf4j
public class PublicBoardDao extends BaseMpowerDaoSupport { public class PublicBoardDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "pboard";
private static final String fieldStrs = "inCode, inBgubun, inContentno, inContents, inDept, inEtc, inFilename, inFilesize, inFileurl, inHit, inNalja, inName, inTime, inTitle"; private static final String fieldStrs = "inCode, inBgubun, inContentno, inContents, inDept, inEtc, inFilename, inFilesize, inFileurl, inHit, inNalja, inName, inTime, inTitle";
public Page<MinInfoBoard680Dto> findAll(MinInfoBoard680Dto dto, Pageable pageable) { public Page<MinInfoBoard680Dto> findAll(@NotNull final MinInfoBoard680Dto dto, @NotNull final Pageable pageable) {
String cntSql = QueryGenerator.createNamedQuery("pboard", "selectPublicBoardListCnt") String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPublicBoardListCnt")
.getQueryString(); .getQueryString();
String listSql = QueryGenerator.createNamedQuery("pboard", "selectPublicBoardList") String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPublicBoardList")
.setParameter("page", pageable.getPageNumber()) .setParameter("page", pageable.getPageNumber())
.setParameter("size", pageable.getPageSize()) .setParameter("size", pageable.getPageSize())
.getQueryString(); .getQueryString();
return selectList(MinInfoBoard680Dto.class, listSql, cntSql, fieldStrs, pageable); return selectList(MinInfoBoard680Dto.class, listSql, cntSql, fieldStrs, pageable);
} }
public MinInfoBoard680Dto findByInCode(Long inCode) { public MinInfoBoard680Dto findByInCode(@NotNull final Long inCode) {
String sql = QueryGenerator.createNamedQuery("pboard", "selectPublicBoard") String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPublicBoard")
.setParameter("inCode", inCode).getQueryString(); .setParameter("inCode", inCode).getQueryString();
return selectOne(MinInfoBoard680Dto.class, sql, fieldStrs); return selectOne(MinInfoBoard680Dto.class, sql, fieldStrs);
} }
public void updateInHitForMinInfoBoard680(Long inCode) { public void updateInHitForMinInfoBoard680(@NotNull final Long inCode) {
String sql = QueryGenerator.createNamedQuery("pboard", "updateInHit") String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateInHit")
.setParameter("inCode", inCode).getQueryString(); .setParameter("inCode", inCode).getQueryString();
update(sql); update(sql);
} }
@ -44,9 +46,9 @@ public class PublicBoardDao extends BaseMpowerDaoSupport {
// return 1L; // return 1L;
// } // }
public void insertPublicBoard(MinInfoBoard680Dto dto) { public void insertPublicBoard(@NotNull final MinInfoBoard680Dto dto) {
// null 값 set 불가 // null 값 set 불가
String sql = QueryGenerator.createNamedQuery("pboard", "insertPublicBoard") String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertPublicBoard")
.setParameter("inBgubun", dto.getInBgubun()) .setParameter("inBgubun", dto.getInBgubun())
.setParameter("inContents", dto.getInContents()) .setParameter("inContents", dto.getInContents())
.setParameter("inDept", dto.getInDept()) .setParameter("inDept", dto.getInDept())
@ -63,8 +65,8 @@ public class PublicBoardDao extends BaseMpowerDaoSupport {
insert(sql); insert(sql);
} }
public void updatePublicBoard(MinInfoBoard680Dto dto) { public void updatePublicBoard(@NotNull final MinInfoBoard680Dto dto) {
String sql = QueryGenerator.createNamedQuery("pboard", "updatePublicBoard") String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updatePublicBoard")
.setParameter("inCode", dto.getInCode() ) .setParameter("inCode", dto.getInCode() )
.setParameter("inTitle", dto.getInTitle()) .setParameter("inTitle", dto.getInTitle())
.setParameter("inContents", dto.getInContents()) .setParameter("inContents", dto.getInContents())
@ -76,8 +78,8 @@ public class PublicBoardDao extends BaseMpowerDaoSupport {
update(sql); update(sql);
} }
public void deletePublicBoard(Long inCode) { public void deletePublicBoard(@NotNull final Long inCode) {
String sql = QueryGenerator.createNamedQuery("pboard", "deleteBoard") String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "deleteBoard")
.setParameter("inCode", inCode).getQueryString(); .setParameter("inCode", inCode).getQueryString();
delete(sql); delete(sql);
} }

@ -1,8 +1,82 @@
package com.xit.biz.ctgy.v2.repository; package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
import com.xit.core.config.database.BaseMpowerDaoSupport; import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.support.sql.parser.QueryGenerator;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.util.List;
@Repository @Repository
public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "residentAndDisabled";
public int getJudgeStdCnt(@NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
.setParameter("msMaincode", msMaincode)
.getQueryString();
return Integer.parseInt(selectOneColumn(sql));
}
public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
.setParameter("msMaincode", msMaincode)
.setParameter("msSeq", msSeq)
.setParameter("msResult", msResult)
.getQueryString();
update(sql);
}
public List<JudgeTargetDto> findJudgeTargets(@NotNull final JudgeTargetDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeTarget")
.setParameter("scDatagb", dto.getScDatagb())
.setParameter("scSeq1", dto.getScSeq1())
.setParameter("scSeq2", dto.getScSeq2())
.setParameter("scTransfer", dto.getScTransfer())
.getQueryString();
final String fieldStrs = "scCode, scSeq, scCarno, scName, scContDoc, scIngb, scCdate, scContDocNm, scIngbNm";
return selectList(JudgeTargetDto.class, sql, fieldStrs);
}
public int insertJudgeTargetIntoSelect(@NotNull final JudgeTargetDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertJudgeTargetIntoSelect")
.setParameter("scCode", dto.getScCode())
.setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msStartsi", dto.getMsStartsi())
.setParameter("msEdate", dto.getMsEdate())
.setParameter("msCdate", dto.getMsCdate())
.setParameter("msClosesi", dto.getMsClosesi())
.setParameter("msResult", dto.getMsResult())
.getQueryString();
insert(sql);
return 1;
}
public void updateTransfer(@NotNull final Long scCode, @NotNull final String scTransfer) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer")
.setParameter("scCode", scCode)
.setParameter("scTransfer", scTransfer)
.getQueryString();
update(sql);
}
public void saveJudgeUsers(@NotNull final List<MinSimsaUser680Sc> list) {
for(MinSimsaUser680Sc vo : list) {
insert(
QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer")
.setParameter("msuCode", vo.getMsuCode())
.setParameter("msuResult", vo.getMsuResult())
.setParameter("msuTeam", vo.getMsuTeam())
.setParameter("msuUserid", vo.getMsuUserid())
.getQueryString()
);
}
}
} }

@ -1,52 +1,62 @@
package com.xit.biz.ctgy.v2.repository; package com.xit.biz.ctgy.v2.repository;
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.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.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@Repository @Repository
@Slf4j @Slf4j
public class UserDao extends BaseMpowerDaoSupport { public class UserDao extends BaseMpowerDaoSupport {
public Optional<MinUserinfoDto> findByUserid(final String userid){ private static final String NAME_SPACE = "user";
String sql = QueryGenerator.createNamedQuery("user", "selectUserInfo")
public Optional<MinUserinfoDto> findByUserid(@NotNull final String userid){
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectUserInfo")
.setParameter("userid", userid) .setParameter("userid", userid)
.getQueryString(); .getQueryString();
String fieldsStrs = "userid, passwd, name, regnum, mphone, email, accesstype, team, isenable, gu"; final String fieldsStrs = "userid, passwd, name, regnum, mphone, email, accesstype, team, isenable, gu";
return Optional.ofNullable(selectOne(MinUserinfoDto.class, sql, fieldsStrs)); return Optional.ofNullable(selectOne(MinUserinfoDto.class, sql, fieldsStrs));
} }
public String queryGetPasswdEncode(final String passwd){ public String queryGetPasswdEncode(@NotNull final String passwd){
String sql = QueryGenerator.createNamedQuery("user", "selectPasswdEnc") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdEnc")
.setParameter("passwd", passwd) .setParameter("passwd", passwd)
.getQueryString(); .getQueryString();
return selectOneColumn(sql); return selectOneColumn(sql);
} }
//@Query(value = "SELECT ECL_DECRYPT(MU.passwd) AS passwd FROM min_userinfo MU WHERE MU.userid = ?1", nativeQuery = true) //@Query(value = "SELECT ECL_DECRYPT(MU.passwd) AS passwd FROM min_userinfo MU WHERE MU.userid = ?1", nativeQuery = true)
public String queryGetPasswd(final String userid){ public String queryGetPasswd(@NotNull final String userid){
String sql = QueryGenerator.createNamedQuery("user", "selectPasswdDec") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdDec")
.setParameter("userid", userid) .setParameter("userid", userid)
.getQueryString(); .getQueryString();
return selectOneColumn(sql); return selectOneColumn(sql);
} }
// public MinUserinfo findMinUserinfoByUserid(final String userid){ // public MinUserinfo findMinUserinfoByUserid(@NotNull final String userid){
// return null; // return null;
// } // }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// 주정차위반 심사대상 등록 - 등록 대상 심사자 조회 // 주정차위반 심사대상 등록 - 등록 대상 심사자 조회
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
public List<MinUserinfo> findAllByTeamAndIsenableAndAccesstype(String msuTeam, String isenabled, String accesstype){ public List<MinUserinfoDto> findAllByTeamAndIsenableAndAccesstype(@NotNull final String team, @NotNull final String isenabled, @NotNull final String accesstype){
return null; String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectAllByTeamAndIsenableAndAccesstype")
} .setParameter("team", team)
.setParameter("isenable", isenabled)
.setParameter("accesstype", accesstype)
.getQueryString();
final String fieldStrs = "userid, accesstype, email, gu, isenable, mphone, passwd, regdate, regnum, team";
public void save(MinUserinfoDto dto) { return selectList(MinUserinfoDto.class, sql, fieldStrs);
} }
} }

@ -57,7 +57,7 @@ public class MinUserService implements IMinUserService {
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); if("Y".equals(dto.getNewYn()) && minUserinfoDao.findByUserid(dto.getUserid()).isPresent()) throw new CustomBaseException(ErrorCode.MEMBER_EXISTS);
dto.setPasswd(passwordEncoder.encode(dto.getPasswd())); dto.setPasswd(passwordEncoder.encode(dto.getPasswd()));
minUserinfoDao.save(dto); // minUserinfoDao.save(dto);
} }
@Override @Override
@ -65,6 +65,6 @@ public class MinUserService implements IMinUserService {
public void removeMinUser(MinUserinfoDto dto) { public void removeMinUser(MinUserinfoDto dto) {
MinUserinfoDto savedDto = minUserinfoDao.findByUserid(dto.getUserid()).orElseThrow(()-> new CustomBaseException(ErrorCode.USER_NOT_FOUND)); MinUserinfoDto savedDto = minUserinfoDao.findByUserid(dto.getUserid()).orElseThrow(()-> new CustomBaseException(ErrorCode.USER_NOT_FOUND));
savedDto.setIsenable("0"); savedDto.setIsenable("0");
minUserinfoDao.save(savedDto); // minUserinfoDao.save(savedDto);
} }
} }

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.v2.service.impl;
import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsaUser680; import com.xit.biz.ctgy.entity.MinSimsaUser680;
import com.xit.biz.ctgy.entity.MinUserinfo; import com.xit.biz.ctgy.entity.MinUserinfo;
@ -12,6 +13,7 @@ import com.xit.biz.ctgy.repository.IParkingJudgeUserRepository;
import com.xit.biz.ctgy.repository.IParkingRepository; import com.xit.biz.ctgy.repository.IParkingRepository;
import com.xit.biz.ctgy.repository.IRecallRepository; import com.xit.biz.ctgy.repository.IRecallRepository;
import com.xit.biz.ctgy.v2.repository.ParkingDao; import com.xit.biz.ctgy.v2.repository.ParkingDao;
import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.service.IParkingService; import com.xit.biz.ctgy.v2.service.IParkingService;
import com.xit.core.constant.ErrorCode; import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException; import com.xit.core.exception.CustomBaseException;
@ -39,6 +41,7 @@ public class ParkingService implements IParkingService {
private final ParkingDao parkingDao; private final ParkingDao parkingDao;
private final IRecallRepository recallRepository; private final IRecallRepository recallRepository;
private final IMinUserRepository userRepository; private final IMinUserRepository userRepository;
private final UserDao userDao;
private final IParkingJudgeUserRepository parkingJudgeUserRepository; private final IParkingJudgeUserRepository parkingJudgeUserRepository;
private final IParkingMapper mapper; private final IParkingMapper mapper;
@ -100,7 +103,7 @@ public class ParkingService implements IParkingService {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public List<ParkingTargetDto> findParkingJudgeTargets(ParkingTargetDto dto) { public List<ParkingTargetDto> findParkingJudgeTargets(ParkingTargetDto dto) {
return repository.findParkingJudgeTargets(dto); return parkingDao.findParkingJudgeTargets(dto);
} }
@Override @Override
@ -120,19 +123,20 @@ public class ParkingService implements IParkingService {
dto.setMsResult("0"); dto.setMsResult("0");
isFirst = false; isFirst = false;
} }
if(mapper.insertParkingJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getMmOcarno())); if(parkingDao.insertJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getMmOcarno()));
//--------------------------------------------------------- //---------------------------------------------------------
// 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수 // 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수
//--------------------------------------------------------- //---------------------------------------------------------
Tf680Recall recallEntity = recallRepository.findById(dto.getRcCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND)); //Tf680Recall recallEntity = recallRepository.findById(dto.getRcCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
recallEntity.setRcIrTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode()); //recallEntity.setRcIrTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
JpaUtil.saveIfNullId(recallEntity.getRcCode(), recallRepository, recallEntity); //JpaUtil.saveIfNullId(recallEntity.getRcCode(), recallRepository, recallEntity);
parkingDao.updateTransfer(dto.getRcCode(), CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
//--------------------------------------------------------- //---------------------------------------------------------
// 심사자 등록 // 심사자 등록
//--------------------------------------------------------- //---------------------------------------------------------
List<MinUserinfo> userinfoList = userRepository.findAllByTeamAndIsenableAndAccesstype( List<MinUserinfoDto> userinfoList = userDao.findAllByTeamAndIsenableAndAccesstype(
dto.getMsuTeam(), dto.getMsuTeam(),
CtgyConstants.UserInfo.ISENABLED_USE.getCode(), CtgyConstants.UserInfo.ISENABLED_USE.getCode(),
CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode()); CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode());
@ -148,7 +152,7 @@ public class ParkingService implements IParkingService {
//.msuIndate() //.msuIndate()
.build() .build()
).collect(Collectors.toList()); ).collect(Collectors.toList());
parkingJudgeUserRepository.saveAll(simsaUserList); parkingDao.saveJudgeUsers(simsaUserList);
} }
} }

@ -2,10 +2,7 @@ package com.xit.biz.ctgy.v2.service.impl;
import com.xit.biz.cmm.service.ICmmFileService; import com.xit.biz.cmm.service.ICmmFileService;
import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.*;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.JudgeStdDto;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.entity.GnRecallSc; import com.xit.biz.ctgy.entity.GnRecallSc;
import com.xit.biz.ctgy.entity.MinInfoBoard680; import com.xit.biz.ctgy.entity.MinInfoBoard680;
@ -15,6 +12,9 @@ import com.xit.biz.ctgy.mapper.IParkingMapper;
import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper; import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper;
import com.xit.biz.ctgy.repository.*; import com.xit.biz.ctgy.repository.*;
import com.xit.biz.ctgy.service.IPublicBoardService; import com.xit.biz.ctgy.service.IPublicBoardService;
import com.xit.biz.ctgy.v2.repository.ParkingDao;
import com.xit.biz.ctgy.v2.repository.ResidentAndDisabledDao;
import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService; import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService;
import com.xit.core.constant.ErrorCode; import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException; import com.xit.core.exception.CustomBaseException;
@ -59,13 +59,16 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class); private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class);
private final IResidentAndDisabledRepository gnReacallRepository; private final IResidentAndDisabledRepository gnReacallRepository;
private final ResidentAndDisabledDao residentAndDisabledDao;
private final IMinUserRepository userRepository; private final IMinUserRepository userRepository;
private final UserDao userDao;
private final IJudgeUserRepository judgeUserRepository; private final IJudgeUserRepository judgeUserRepository;
private final IJudgeRepository judgeRepository; private final IJudgeRepository judgeRepository;
private final IResidentAndDisabledMapper residentAndDisabledMapper; private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final IParkingRepository parkingRepository; private final IParkingRepository parkingRepository;
private final ParkingDao parkingDao;
private final ICmmFileService fileService; private final ICmmFileService fileService;
private final IPublicBoardService pBoardService; private final IPublicBoardService pBoardService;
@ -136,7 +139,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public List<JudgeTargetDto> findJudgeTargets(JudgeTargetDto dto) { public List<JudgeTargetDto> findJudgeTargets(JudgeTargetDto dto) {
return gnReacallRepository.findJudgeTargets(dto); return residentAndDisabledDao.findJudgeTargets(dto);
} }
@Override @Override
@ -156,21 +159,22 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
dto.setMsResult("0"); dto.setMsResult("0");
isFirst = false; isFirst = false;
} }
if(residentAndDisabledMapper.insertJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getScCarnum())); if(residentAndDisabledDao.insertJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getScCarnum()));
//--------------------------------------------------------- //---------------------------------------------------------
// 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수, 심의결과 : 접수 -> 심사중 // 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수, 심의결과 : 접수 -> 심사중
//--------------------------------------------------------- //---------------------------------------------------------
GnRecallSc entity = gnReacallRepository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND)); //GnRecallSc entity = gnReacallRepository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode()); //entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
// entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.getCode()); // entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.getCode());
//JpaUtil.saveIfNullId(dto.getScCode(), repository, entity); //JpaUtil.saveIfNullId(dto.getScCode(), repository, entity);
gnReacallRepository.save(entity); //gnReacallRepository.save(entity);
residentAndDisabledDao.updateTransfer(dto.getScCode(), CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
//--------------------------------------------------------- //---------------------------------------------------------
// 심사자 등록 // 심사자 등록
//--------------------------------------------------------- //---------------------------------------------------------
List<MinUserinfo> userinfoList = userRepository.findAllByTeamAndIsenableAndAccesstype( List<MinUserinfoDto> userinfoList = userDao.findAllByTeamAndIsenableAndAccesstype(
dto.getMsuTeam(), dto.getMsuTeam(),
CtgyConstants.UserInfo.ISENABLED_USE.getCode(), CtgyConstants.UserInfo.ISENABLED_USE.getCode(),
CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode()); CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode());
@ -185,7 +189,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
//.msuIndate() //.msuIndate()
.build() .build()
).collect(Collectors.toList()); ).collect(Collectors.toList());
judgeUserRepository.saveAll(simsaUserList); residentAndDisabledDao.saveJudgeUsers(simsaUserList);
} }
} }
@ -336,17 +340,17 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
String msResult = CtgyConstants.Judge.RESULT_JUDGE_NON_IMPOSE.getCode(); String msResult = CtgyConstants.Judge.RESULT_JUDGE_NON_IMPOSE.getCode();
// 주정차 심사 // 주정차 심사
if (Checks.isEmpty(dto.getDataGb())) { if (Checks.isEmpty(dto.getDataGb())) {
cnt = parkingRepository.getJudgeStdCnt(msMaincode); cnt = parkingDao.getJudgeStdCnt(msMaincode);
if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode(); if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
parkingRepository.updateMsResult(msMaincode, msSeq, msResult); parkingDao.updateMsResult(msMaincode, msSeq, msResult);
// 거주자 장애인 심사 // 거주자 장애인 심사
} else { } else {
cnt = gnReacallRepository.getJudgeStdCnt(msMaincode); cnt = residentAndDisabledDao.getJudgeStdCnt(msMaincode);
if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode(); if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
judgeRepository.updateMsResult(msMaincode, msSeq, msResult); residentAndDisabledDao.updateMsResult(msMaincode, msSeq, msResult);
} }
}); });
} }

@ -55,7 +55,7 @@ import java.util.Map;
) )
// Mybatis // Mybatis
@MapperScan( @MapperScan(
nameGenerator = CustomBeanNameGenerator.class, //nameGenerator = CustomBeanNameGenerator.class,
basePackages = DataSourceConfig.PACKAGE, basePackages = DataSourceConfig.PACKAGE,
sqlSessionFactoryRef = "sqlSessionFactory" sqlSessionFactoryRef = "sqlSessionFactory"
) )

@ -20,15 +20,16 @@ import java.io.IOException;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
//TODO :: 공통 framework에 반영 필요
/** /**
* <pre>
*
* DTO LocalDate * DTO LocalDate
* @JsonFormat(pattern="yyyy-MM-dd") * @JsonFormat(pattern="yyyy-MM-dd")
* @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) * @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
* *
* Request( -> ) @DateTimeFormat * Request( -> ) @DateTimeFormat
* Responst ( -> ) @JsonFormat * Responst ( -> ) @JsonFormat
* * </pre>
*/ */
@Configuration @Configuration
@Slf4j @Slf4j

@ -148,7 +148,6 @@ public class CustomRestExceptionHandler extends ResponseEntityExceptionHandler {
} }
//TODO :: 공통 framework에 반영 필요
/** /**
* NoSuchElementException * NoSuchElementException
* *

@ -866,7 +866,6 @@ public class DateUtil2 {
cnt++; cnt++;
} catch (ParseException e) { } catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
} }

@ -18,14 +18,18 @@
</native-query> </native-query>
<native-query id="selectPasswdEnc"> <native-query id="selectPasswdEnc">
/* minuserinfo-mapper|selectPasswdEnc|julim */
SELECT TRAFFIC.ECL_ENCRYPT(#{passwd}) AS passwd SELECT TRAFFIC.ECL_ENCRYPT(#{passwd}) AS passwd
FROM DUAL FROM DUAL
</native-query> </native-query>
<native-query id="selectPasswdDec"> <native-query id="selectPasswdDec">
/* minuserinfo-mapper|selectPasswdDec|julim */
SELECT TRAFFIC.ECL_DECRYPT(passwd) AS passwd SELECT TRAFFIC.ECL_DECRYPT(passwd) AS passwd
FROM min_userinfo FROM min_userinfo
WHERE userid = #{userid} WHERE userid = #{userid}
</native-query> </native-query>
</entity-mappings> </entity-mappings>

@ -51,10 +51,10 @@
</native-query> </native-query>
<native-query id="insertParkingJudgeTargetIntoSelect"> <native-query id="insertJudgeTargetIntoSelect">
/* parking-mapper|insertParkingJudgeTargetIntoSelect|julim */ /* parking-mapper|insertJudgeTargetIntoSelect|julim */
insert INSERT
into min_simsa680( INTO min_simsa680 (
ms_maincode, ms_maincode,
ms_seq, ms_seq,
ms_carnum, ms_carnum,
@ -69,30 +69,70 @@
ms_pos, ms_pos,
ms_result, ms_result,
ms_jbtime ms_jbtime
) select TR.rc_code, )
TR.rc_seq, SELECT TR.rc_code,
TM.mm_ocarno, TR.rc_seq,
#{msYear}, TM.mm_ocarno,
#{msChasu}, #{msYear},
#{msSdate}, #{msChasu},
#{msStartsi}, #{msSdate},
#{msEdate}, #{msStartsi},
#{msCdate}, #{msEdate},
#{msClosesi}, #{msCdate},
TM.mm_wdate, #{msClosesi},
TD.do_bname||''||TJ.mj_pos, TM.mm_wdate,
#{msResult}, TD.do_bname||''||TJ.mj_pos,
TJ.mj_jbtime #{msResult},
from tf680_recall TR TJ.mj_jbtime
join tf680_main TM on TR.rc_code = #{rcCode} FROM tf680_recall TR
and TM.mm_code = TR.rc_maincode JOIN tf680_main TM
and TR.rc_ir_transfer = '1' ON TR.rc_code = #{rcCode}
and TR.rc_state = '0' AND TM.mm_code = TR.rc_maincode
join tf680_jucha TJ on TM.mm_code = TJ.mj_code AND TR.rc_ir_transfer = '1'
join tf680_dong TD AND TR.rc_state = '0'
on TJ.mj_dong = TD.do_code JOIN tf680_jucha TJ
ON TM.mm_code = TJ.mj_code
JOIN tf680_dong TD
ON TJ.mj_dong = TD.do_code
</native-query> </native-query>
<native-query id="updateTransfer">
/* parking-mapper|updateTransfer|julim */
UPDATE tf680_recall
SET rc_ir_transfer = #{rcIrTransfer}
WHERE rc_code = #{rcCode}
</native-query>
<native-query id="insertJudgeUser">
/* minuserinfo-mapper|insertJudgeUser|julim */
INSERT
INTO min_simsa_user680 (
msu_maincode,
msu_code,
msu_result,
msu_team,
msu_userid
) VALUES (
min_simsa_user680_seq.NEXTVAL,
#{msuCode},
#{msuResult},
#{msuTeam},
#{msuUserid}
)
</native-query>
<native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu"> <native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu">
/* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */ /* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */
SELECT msu_team AS msuTeam SELECT msu_team AS msuTeam
@ -209,6 +249,61 @@
ORDER BY MSU.msu_userid, MU.name, MS.ms_maincode, MS.ms_seq, MS.ms_carnum ORDER BY MSU.msu_userid, MU.name, MS.ms_maincode, MS.ms_seq, MS.ms_carnum
</native-query> </native-query>
<native-query id="selectJudegStdCount">
/* parking-mapper|selectJudegStdCount|julim */
SELECT count(msu_code)
FROM min_simsa_user680
WHERE ms_maincode = #{msuMaincode}
AND msu_result= '2'
</native-query>
<native-query id="updateJudegResult">
/* parking-mapper|updateJudegResult|julim */
UPDATE min_simsa680
SET ms_result = #{msResult}
WHERE ms_maincode = #{msMaincode}
AND ms_seq = #{msSeq}
</native-query>
<native-query id="selectJudgeTarget">
/* parking-mapper|selectJudgeTarget|julim */
SELECT TM.mm_code,
TR.rc_code,
TR.rc_seq,
TM.mm_ocarno,
TM.mm_ncarno,
TR.rc_name,
TR.rc_cont_doc,
TR.rc_ingb,
TR.rc_date,
(SELECT code_nm
FROM tb_cmm_code_s
WHERE TR.rc_cont_doc = code_cd
AND code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RC_CONT_DOC') as rcContDocNm,
(SELECT code_nm
FROM tb_cmm_code_s
WHERE TR.rc_ingb = code_cd
AND code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RC_INGB') as rcIngbNm,
FROM tf680_main TM
, tf680_recall TR
WHERE TM.mm_code = TR.rc_maincode
AND TM.mm_dbgb = '11'
AND TM.mm_lstate != 75
AND TR.rc_gb = '1'
AND TR.rc_state ='0'
AND TR.rc_ir_transfer = #{rcIrTransfer}
AND TR.rc_seq &gt;= #{rcSeq1}
AND TR.rc_seq &lt;= #{rcSeq2}
ORDER BY TR.rc_seq
</native-query>
<native-query id="selectDashboardJudgeList"> <native-query id="selectDashboardJudgeList">
/* parking-mapper|selectDashboardJudgeList|julim */ /* parking-mapper|selectDashboardJudgeList|julim */

@ -0,0 +1,344 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings namespace="residentAndDisabled">
<native-query id="selectParkingList">
/* residentAndDisabled-mapper|selectParkingList|julim */
SELECT ms_year,
ms_chasu,
ms_sdate,
ms_startsi,
ms_edate,
ms_cdate,
ms_closesi,
cnt
FROM (
SELECT R.*, ROWNUM rn
FROM (
SELECT ms_year,
ms_chasu,
ms_sdate,
ms_startsi,
ms_edate,
ms_cdate,
ms_closesi,
count(ms_maincode) AS cnt
FROM min_simsa680
WHERE ms_year = #{msYear}
<if test="msChasu != null and msChasu != ''">
AND ms_chasu = #{msChasu}
</if>
GROUP BY ms_year, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi
ORDER BY ms_year DESC, ms_chasu DESC
) R
WHERE ROWNUM &lt;= (#{page} + 1) * #{size}
)
WHERE rn &gt; #{page} * #{size}
AND ROWNUM &lt;= #{size}
</native-query>
<native-query id="selectParkingListCnt">
/* residentAndDisabled-mapper|selectParkingListCnt|julim */
SELECT count(*) AS totalCount
FROM (
SELECT ms_year
FROM min_simsa680
WHERE ms_year = #{msYear}
<if test="msChasu != null and msChasu != ''">
AND ms_chasu = #{msChasu}
</if>
GROUP BY ms_year, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi
)
</native-query>
<native-query id="insertJudgeTargetIntoSelect">
/* residentAndDisabled-mapper|insertJudgeTargetIntoSelect|julim */
INSERT
INTO min_simsa680_sc(
ms_maincode,
ms_seq,
ms_carnum,
ms_year,
ms_chasu,
ms_sdate,
ms_startsi,
ms_edate,
ms_cdate,
ms_closesi,
ms_wdate,
ms_pos,
ms_result,
ms_jbtime,
ms_datagb
)
SELECT sc_code,
sc_seq,
sc_carnum,
#{msYear},
#{msChasu},
#{msSdate},
#{msStartsi},
#{msEdate},
#{msCdate},
#{msClosesi},
sc_wdate,
sc_dong||''||sc_pos,
#{msResult},
sc_jbtime,
sc_datagb
FROM gn_recall_sc
WHERE sc_code = #{scCode}
AND sc_transfer = '1'
AND sc_state = '1'
</native-query>
<native-query id="updateTransfer">
/* residentAndDisabled-mapper|updateTransfer|julim */
UPDATE gn_recall_sc
SET sc_transfer = #{scTransfer}
WHERE sc_code = #{scCode}
</native-query>
<native-query id="insertJudgeUser">
/* minuserinfo-mapper|insertJudgeUser|julim */
INSERT
INTO min_simsa_user680_sc (
msu_maincode,
msu_code,
msu_result,
msu_team,
msu_userid
) VALUES (
min_simsa_user680_sc_seq.NEXTVAL,
#{msuCode}
#{msuResult},
#{msuTeam},
#{msuUserid},
)
</native-query>
<native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu">
/* residentAndDisabled-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */
SELECT msu_team AS msuTeam
, NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
, 0 as seo
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name
FROM min_simsa680 MS
, msu680_view MV
WHERE MS.ms_maincode = MV.msu_maincode
<if test="msuTeam != null and msuTeam != ''">
AND MV.msu_team = #{msuTeam}
</if>
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
GROUP BY MV.msu_team, MS.ms_chasu
</native-query>
<native-query id="selectParkingJudgeTeamGroupByChasuAndTeamList">
/* residentAndDisabled-mapper|selectParkingJudgeTeamGroupByChasuAndTeamList|julim */
SELECT MV.msu_team AS msuTeam
, NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
, 0 as seo
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
, '결과' as name
FROM min_simsa680 MS
, msu680_view MV
WHERE MS.ms_maincode = MV.msu_maincode
<if test='msuTeam != null and msuTeam != ""'>
AND MV.msu_team = #{msuTeam}
</if>
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
GROUP BY MS.ms_chasu, MV.msu_team
ORDER BY MS.ms_chasu, MV.msu_team
</native-query>
<native-query id="selectTotParkingJudgeResultGroupByUser">
/* residentAndDisabled-mapper|selectTotParkingJudgeResultByUser|julim */
SELECT SUM(DECODE(MSU_RESULT, '2', 1, 0)) as bu
, 0 as seo
, SUM(DECODE(MSU_RESULT, '1', 1, 0)) as mibu
, SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) as tot
, MU.name
FROM min_simsa680 MS
, min_simsa_user680 MSU
, min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
AND MSU.msu_userid = MU.userid
<if test="msuTeam != null and msuTeam != ''">
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MSU.msu_userid, MU.name
ORDER BY MSU.msu_userid, MU.name
</native-query>
<native-query id="selectParkingJurgeResultGroupByCarnum">
/* residentAndDisabled-mapper|selectParkingJurgeResultGroupByCarnum|julim */
SELECT MS.ms_maincode AS msMaincode
, MS.ms_seq AS msSeq
, MS.ms_carnum AS msCarnum
FROM min_simsa680 MS
, min_simsa_user680 MSU
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
<if test="msuTeam != null and msuTeam != ''">
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
</native-query>
<native-query id="selectParkingJudgeResultList">
/* residentAndDisabled-mapper|selectParkingJudgeResultList|julim */
SELECT MS.ms_maincode AS msMaincode
, MS.ms_seq AS msSeq
, MS.ms_carnum AS msCarnum
, MU.name
, MS.ms_result AS msResult
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MS.ms_result) as msResultNm
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msuResult
FROM min_simsa680 MS
, min_simsa_user680 MSU
, min_userinfo MU
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate}
AND MS.ms_seq in #{seqList}
AND MS.ms_carnum in #{carnumList}
<if test="msuTeam != null and msuTeam != ''">
AND MSU.msu_team = #{msuTeam}
</if>
AND MSU.msu_userid = MU.userid
ORDER BY MSU.msu_userid, MU.name, MS.ms_maincode, MS.ms_seq, MS.ms_carnum
</native-query>
<native-query id="selectJudegStdCount">
/* residentAndDisabled-mapper|selectJudegStdCount|julim */
SELECT count(msu_code)
FROM min_simsa_user680_sc
WHERE ms_maincode = #{msuMaincode}
AND msu_result= '2'
</native-query>
<native-query id="updateJudegResult">
/* residentAndDisabled-mapper|updateJudegResult|julim */
UPDATE min_simsa680_sc
SET ms_result = #{msResult}
WHERE ms_maincode = #{msMaincode}
AND ms_seq = #{msSeq}
</native-query>
<native-query id="selectJudgeTarget">
/* parking-mapper|selectJudgeTarget|julim */
SELECT GRC.sc_code,
GRC.sc_seq,
GRC.sc_carno,
GRC.sc_name,
GRC.sc_cont_doc,
GRC.sc_ingb,
GRC.sc_cdate,
(SELECT code_nm
FROM tb_cmm_code_s
WHERE GRC.rc_cont_doc = code_cd
AND code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RC_CONT_DOC') as rcContDocNm,
(SELECT code_nm
FROM tb_cmm_code_s
WHERE GRC.rc_ingb = code_cd
AND code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RC_INGB') as rcIngbNm,
FROM gn_recall_sc GRC
WHERE GRC.sc_datagb = #{scDatagb}
AND GRC.sc_state = '1'
AND GRC.sc_transfer = #{scTransfer}
AND GRC.sc_seq &gt;= #{scSeq1}
AND GRC.sc_seq &lt;= #{scSeq2}
ORDER BY GRC.sc_seq
</native-query>
<native-query id="selectDashboardJudgeList">
/* residentAndDisabled-mapper|selectDashboardJudgeList|julim */
SELECT MS.ms_edate
, MSU.msu_team
, MU.name
, SUM(DECODE(MSU.msu_result, 0, 0, 1)) jcnt
, COUNT(*) tcnt
FROM min_simsa680 MS
, min_simsa_user680 MSU
, min_userinfo MU
, (SELECT *
FROM (SELECT ms_edate
FROM min_simsa680
WHERE MS_RESULT = '0'
ORDER BY ms_edate DESC)
WHERE ROWNUM = 1) T
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_result = '0'
AND MSU.msu_userid = MU.userid
AND MS.ms_edate = T.ms_edate
GROUP BY MS.ms_edate, MSU.msu_team, MU.name
ORDER BY MSU.msu_team, MU.name
</native-query>
</entity-mappings>
Loading…
Cancel
Save