feat: mpower 적용 - 거주자 / 장애인 - 심의목록 삭제

dev
Jonguk. Lim 2 years ago
parent 85e212501a
commit 8371c2dd4d

@ -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,

@ -1,5 +1,6 @@
package com.xit.biz.ctgy.v2.controller; package com.xit.biz.ctgy.v2.controller;
import com.xit.biz.ctgy.CtgyConstants;
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;
import com.xit.biz.ctgy.dto.JudgeStdDto; import com.xit.biz.ctgy.dto.JudgeStdDto;
@ -175,6 +176,14 @@ public class ResidentAndDisabledController {
return RestResponse.of(HttpStatus.OK); return RestResponse.of(HttpStatus.OK);
} }
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "거주자/장애인 의견진술 심의목록 삭제" , description = "거주자/장애인 의견진술 심의목록 삭제")
@PostMapping(value="/admin/remove", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> removeJudge(final JudgeListDto dto) {
service.removeJudge(dto);
return RestResponse.of(HttpStatus.OK);
}
@Secured(policy = SecurityPolicy.TOKEN) @Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "dashboard" , description = "dashboard") @Operation(summary = "dashboard" , description = "dashboard")
@GetMapping(value="/dashboard", produces = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value="/dashboard", produces = MediaType.APPLICATION_JSON_VALUE)

@ -159,15 +159,34 @@ public class ParkingDao extends BaseMpowerDaoSupport {
); );
} }
} }
//
// public List<Long> findAllMsMaincode(Long msChasu, LocalDate msSdate, LocalDate msEdate) { public List<Long> findAllMsMaincode(@NotNull final ParkingTargetDto dto) {
// return null; final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectRemoveJudgeTgtList")
// } .setParameter("msChasu", dto.getMsChasu())
// .setParameter("msSdate", dto.getMsSdate())
// public void deleteById(Long msMaincode) { .setParameter("msEdate", dto.getMsEdate())
// } .getQueryString();
// return selectOneColumnLongList(sql);
// public List<JudgeListDto> findByUserJudges() { }
// return null;
// } public void deleteJudgeUser(@NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "deleteJudgeUser")
.setParameter("msMaincode", msMaincode)
.getQueryString();
delete(sql);
}
public void updateRcIrTransferAndRcState(@NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateJudgeTgtReset")
.setParameter("msMaincode", msMaincode)
.getQueryString();
update(sql);
}
public void deleteJudgeTgt(@NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "deleteJudgeTgt")
.setParameter("msMaincode", msMaincode)
.getQueryString();
delete(sql);
}
} }

@ -1,18 +1,95 @@
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.JudgeTargetDto; import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc; 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 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;
import java.time.LocalDate;
import java.util.List; import java.util.List;
import java.util.Map;
@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";
public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) {
final String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeListCnt")
.setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu())
.getQueryString();
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeList")
.setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("page", pageable.getPageNumber())
.setParameter("size", pageable.getPageSize())
.getQueryString();
final String fieldStrs = "msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, msClosesi, cnt";
return selectList(JudgeListDto.class, listSql, cntSql, fieldStrs, pageable);
}
public List<Map<String, Object>> selectJudgeTeamGroupByChasuAndTeamList(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectTotJudgeResultGroupByTeamAndChasu")
.setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msEdate", dto.getMsEdate())
.getQueryString();
final String fieldStrs = "msuTeam, BU, SEO, MIBU, TOT, NAME";
return selectMapList(listSql, fieldStrs);
}
public List<Map<String, Object>> selectJudgeResultGroupByCarnum(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingJurgeResultGroupByCarnum")
.setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msEdate", dto.getMsEdate())
.getQueryString();
final String fieldsStrs = "msMaincode, msSeq, msCarnum";
return selectMapList(listSql, fieldsStrs);
}
public List<Map<String, Object>> selectTotJudgeResultGroupByUser(@NotNull final JudgeListDto dto) {
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectTotParkingJudgeResultGroupByUser")
.setParameter("msuTeam", dto.getMsuTeam())
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msEdate", dto.getMsEdate())
.getQueryString();
final String fieldStrs = "BU, SEO, MIBU, TOT, NAME";
return selectMapList(listSql, fieldStrs);
}
public List<Map<String, Object>> selectJudgeResultList(@NotNull final Map<String, Object> paramMap) {
final String listSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingJudgeResultList")
.setParameter("msDatagb", (String)paramMap.get("msDatagb"))
.setParameter("msuTeam", (String)paramMap.get("msuTeam"))
.setParameter("msChasu", (Long)paramMap.get("msChasu"))
.setParameter("msSdate", (LocalDate)paramMap.get("msSdate"))
.setParameter("msEdate", (LocalDate) paramMap.get("msEdate"))
.setParameter("seqList", (List)paramMap.get("seqList"))
.setParameter("carnumList", (List)paramMap.get("carnumList"))
.getQueryString();
final String fieldsStrs = "msMaincode, msSeq, msCarnum, NAME, msResult, msResultNm, msuResult";
return selectMapList(listSql, fieldsStrs);
}
public int getJudgeStdCnt(@NotNull final Long msMaincode) { public int getJudgeStdCnt(@NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
.setParameter("msMaincode", msMaincode) .setParameter("msMaincode", msMaincode)
@ -79,4 +156,37 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
); );
} }
} }
public List<Long> findAllMsMaincode(@NotNull final JudgeListDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectRemoveJudgeTgtList")
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msEdate", dto.getMsEdate())
.getQueryString();
return selectOneColumnLongList(sql);
}
public void deleteJudgeUser(@NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "deleteJudgeUser")
.setParameter("msMaincode", msMaincode)
.getQueryString();
delete(sql);
}
public void updateScTransferAndScState(@NotNull final String msDatagb, @NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateJudgeTgtReset")
.setParameter("scDatagb", msDatagb)
.setParameter("msMaincode", msMaincode)
.getQueryString();
update(sql);
}
public void deleteJudgeTgt(@NotNull final Long msMaincode) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "deleteJudgeTgt")
.setParameter("msMaincode", msMaincode)
.getQueryString();
delete(sql);
}
} }

@ -61,7 +61,7 @@ public interface IResidentAndDisabledService {
* @return Map * @return Map
*/ */
Map<String,Object> findJudgeResults(final JudgeListDto dto); Map<String,Object> findJudgeResults(final JudgeListDto dto);
Map<String,Object> findJudgeResults2(final JudgeListDto dto); //Map<String,Object> findJudgeResults2(final JudgeListDto dto);
/** /**
* / * /

@ -39,11 +39,8 @@ public class ParkingService implements IParkingService {
private final IParkingRepository repository; private final IParkingRepository repository;
private final ParkingDao parkingDao; private final ParkingDao parkingDao;
private final IRecallRepository recallRepository;
private final IMinUserRepository userRepository;
private final UserDao userDao; private final UserDao userDao;
private final IParkingJudgeUserRepository parkingJudgeUserRepository; private final IParkingJudgeUserRepository parkingJudgeUserRepository;
private final IParkingMapper mapper;
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
@ -169,13 +166,13 @@ public class ParkingService implements IParkingService {
@Transactional @Transactional
public void removeParkingJudge(final ParkingTargetDto dto) { public void removeParkingJudge(final ParkingTargetDto dto) {
List<Long> msMaincodes = repository.findAllMsMaincode(dto.getMsChasu(), dto.getMsSdate(), dto.getMsEdate()); List<Long> msMaincodes = parkingDao.findAllMsMaincode(dto);
msMaincodes.forEach(msMaincode -> { msMaincodes.forEach(msMaincode -> {
parkingJudgeUserRepository.deleteByMsuMaincode(msMaincode); parkingDao.deleteJudgeUser(msMaincode);
// 전송상태 -> 미접수(1), 심의결과 -> 심의전(0) // 전송상태 -> 미접수(1), 심의결과 -> 심의전(0)
recallRepository.updateRcIrTransferAndRcState(msMaincode); parkingDao.updateRcIrTransferAndRcState(msMaincode);
repository.deleteById(msMaincode); parkingDao.deleteJudgeTgt(msMaincode);
}); });
} }

@ -60,21 +60,17 @@ 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 ResidentAndDisabledDao residentAndDisabledDao;
private final IMinUserRepository userRepository;
private final UserDao userDao; private final UserDao userDao;
private final IJudgeUserRepository judgeUserRepository; private final IJudgeUserRepository judgeUserRepository;
private final IJudgeRepository judgeRepository;
private final IResidentAndDisabledMapper residentAndDisabledMapper; private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final IParkingRepository parkingRepository;
private final ParkingDao parkingDao; private final ParkingDao parkingDao;
private final ICmmFileService fileService; private final ICmmFileService fileService;
private final IPublicBoardService pBoardService; private final IPublicBoardService pBoardService;
private final IParkingMapper parkingMapper; private final IParkingMapper parkingMapper;
private final EntityManager entityManager;
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// 관리자 // 관리자
@ -198,7 +194,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) { public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) {
pageable = JpaUtil.getPagingInfo(pageable); pageable = JpaUtil.getPagingInfo(pageable);
return gnReacallRepository.findJudges(dto, pageable); return residentAndDisabledDao.findJudges(dto, pageable);
} }
@Override @Override
@ -212,16 +208,16 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
// List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto); // List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto);
// totJudgeUserList.add(teamMap); // totJudgeUserList.add(teamMap);
List<Map<String, Object>> teamList = residentAndDisabledMapper.selectJudgeTeamGroupByChasuAndTeamList(dto); List<Map<String, Object>> teamList = residentAndDisabledDao.selectJudgeTeamGroupByChasuAndTeamList(dto);
if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND);
// 차수별 심사자별 심사결과 합산 // 차수별 심사자별 심사결과 합산
dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam"))); dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam")));
List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto); List<Map<String, Object>> totJudgeUserList = residentAndDisabledDao.selectTotJudgeResultGroupByUser(dto);
totJudgeUserList.add(teamList.get(0)); totJudgeUserList.add(teamList.get(0));
// 심사대상 차량 목록 // 심사대상 차량 목록
List<Map<String,Object>> judgeCarList = residentAndDisabledMapper.selectJudgeResultGroupByCarnum(dto); List<Map<String,Object>> judgeCarList = residentAndDisabledDao.selectJudgeResultGroupByCarnum(dto);
// 차량별 심사자 심사결과 목록 // 차량별 심사자 심사결과 목록
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
@ -233,7 +229,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 = residentAndDisabledMapper.selectJudgeResultList(paramMap); List<Map<String,Object>> jurgeUserList = residentAndDisabledDao.selectJudgeResultList(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"));
@ -252,56 +248,56 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
return resultMap; return resultMap;
} }
@Override // @Override
@Transactional(readOnly = true) // @Transactional(readOnly = true)
public Map<String,Object> findJudgeResults2(JudgeListDto dto) { // public Map<String,Object> findJudgeResults2(JudgeListDto dto) {
Map<String, Object> resultMap = new HashMap<>(); // Map<String, Object> resultMap = new HashMap<>();
//
// team && 팀별 부과현황 조회 : 팀이 선택되지 않은 경우 모두 // // team && 팀별 부과현황 조회 : 팀이 선택되지 않은 경우 모두
// Map<String, Object> teamMap = residentAndDisabledMapper.selectTotJudgeResultGroupByTeamAndChasu(dto); //// Map<String, Object> teamMap = residentAndDisabledMapper.selectTotJudgeResultGroupByTeamAndChasu(dto);
// if (Checks.isEmpty(teamMap)) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); //// if (Checks.isEmpty(teamMap)) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND);
//// List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto);
//// totJudgeUserList.add(teamMap);
//
// List<Map<String, Object>> teamList = residentAndDisabledMapper.selectJudgeTeamGroupByChasuAndTeamList(dto);
// if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND);
//
// // 차수별 심사자별 심사결과 합산
// dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam")));
// List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto); // List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto);
// totJudgeUserList.add(teamMap); // totJudgeUserList.add(teamList.get(0));
//
List<Map<String, Object>> teamList = residentAndDisabledMapper.selectJudgeTeamGroupByChasuAndTeamList(dto); // // 심사대상 차량 목록
if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); // List<Map<String,Object>> judgeCarList = residentAndDisabledMapper.selectJudgeResultGroupByCarnum(dto);
//
// 차수별 심사자별 심사결과 합산 // // 차량별 심사자 심사결과 목록
dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam"))); // Map<String, Object> paramMap = new HashMap<>();
List<Map<String, Object>> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto); // paramMap.put("msDatagb", dto.getMsDatagb());
totJudgeUserList.add(teamList.get(0)); // paramMap.put("msChasu", dto.getMsChasu());
// paramMap.put("msSdate", dto.getMsSdate());
// 심사대상 차량 목록 // paramMap.put("msEdate", dto.getMsEdate());
List<Map<String,Object>> judgeCarList = residentAndDisabledMapper.selectJudgeResultGroupByCarnum(dto); // paramMap.put("msuTeam", dto.getMsuTeam());
//
// 차량별 심사자 심사결과 목록 // paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList()));
Map<String, Object> paramMap = new HashMap<>(); // paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList()));
paramMap.put("msDatagb", dto.getMsDatagb()); // List<Map<String,Object>> jurgeUserList = residentAndDisabledMapper.selectJudgeResultList(paramMap);
paramMap.put("msChasu", dto.getMsChasu()); //
paramMap.put("msSdate", dto.getMsSdate()); //// List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> {
paramMap.put("msEdate", dto.getMsEdate()); //// paramMap.put("msSeq", m.get("msSeq"));
paramMap.put("msuTeam", dto.getMsuTeam()); //// paramMap.put("msCarnum", m.get("msCarnum"));
//// m.put("simsa", residentAndDisabledMapper.selectJudgeResultList(paramMap));
paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList())); //// }).collect(Collectors.toList());
paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList())); //
List<Map<String,Object>> jurgeUserList = residentAndDisabledMapper.selectJudgeResultList(paramMap); //
// resultMap.put("teamList", teamList);
// List<Map<String,Object>> resultList = judgeCarList.stream().peek((m) -> { // // 차수별 심사자별 심사결과 합산
// paramMap.put("msSeq", m.get("msSeq")); // resultMap.put("totJudgeUserData", totJudgeUserList);
// paramMap.put("msCarnum", m.get("msCarnum")); // // 심사대상 차량 목록
// m.put("simsa", residentAndDisabledMapper.selectJudgeResultList(paramMap)); // resultMap.put("judgeCarData", judgeCarList);
// }).collect(Collectors.toList()); // // 차량별 심사자 심사결과 목록
// resultMap.put("judgeUserData", jurgeUserList);
// return resultMap;
resultMap.put("teamList", teamList); // }
// 차수별 심사자별 심사결과 합산
resultMap.put("totJudgeUserData", totJudgeUserList);
// 심사대상 차량 목록
resultMap.put("judgeCarData", judgeCarList);
// 차량별 심사자 심사결과 목록
resultMap.put("judgeUserData", jurgeUserList);
return resultMap;
}
/** /**
* *
@ -313,16 +309,16 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
*/ */
@Override @Override
@Transactional @Transactional
public void removeJudge(final JudgeListDto dto) { public void removeJudge(@NotNull final JudgeListDto dto) {
List<Long> msMaincodes = judgeRepository.findAllMsMaincode(dto.getMsDatagb(), dto.getMsChasu(), dto.getMsSdate(), dto.getMsEdate()); List<Long> msMaincodes = residentAndDisabledDao.findAllMsMaincode(dto);
msMaincodes.forEach(msMaincode -> { msMaincodes.forEach(msMaincode -> {
//List<MinSimsaUser680Sc> judgeUsers = judgeUserRepository.findByMsuMaincode() //List<MinSimsaUser680Sc> judgeUsers = judgeUserRepository.findByMsuMaincode()
judgeUserRepository.deleteByMsuMaincode(msMaincode); residentAndDisabledDao.deleteJudgeUser(msMaincode);
// 전송상태 -> 미접수(1), 심의결과 -> 접수(1) // 전송상태 -> 미접수(1), 심의결과 -> 접수(1)
gnReacallRepository.updateScTransferAndScState(dto.getMsDatagb(), msMaincode); residentAndDisabledDao.updateScTransferAndScState(dto.getMsDatagb(), msMaincode);
judgeRepository.deleteById(msMaincode); residentAndDisabledDao.deleteJudgeTgt(msMaincode);
}); });
} }

@ -91,6 +91,38 @@ public abstract class BaseMpowerDaoSupport {
} }
} }
public List<Long> selectOneColumnLongList(String sql){
Objects.requireNonNull(sql, "SQL cannot be null");
List<Long> list = new ArrayList<>();
Client client = getConnection();
client.setInput("SQLXML", getQueryXml("select", sql));
try {
client.Request();
String result = client.getString("result", 0, 0);
int row;
if (result.equals("true")){
row = client.getMaxRow("list1");
if(row>0) {
String value = null;
for (int i = 0; i < row; i++) {
list.add(Long.valueOf(client.getString("list1", i, 0)));
}
}
}
return list;
}catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally {
disConnection(client);
}
}
public <T> List<T> selectList(Class<T> type, String sql, String fieldStrs){ public <T> List<T> selectList(Class<T> type, String sql, String fieldStrs){
Objects.requireNonNull(type, "Class cannot be null"); Objects.requireNonNull(type, "Class cannot be null");
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");

@ -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"
) )

@ -6,6 +6,50 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator; import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.lang.NonNull; import org.springframework.lang.NonNull;
/**
*
* <pre>
* API v1, v2
* Bean
* Use : -
*
*
* -------------------------
* Application.java
*
* SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder(Application.class);
* CustomBeanNameGenerator beanNameGenerator = new CustomBeanNameGenerator();
* applicationBuilder.beanNameGenerator(beanNameGenerator);
* applicationBuilder.build().run(args);
* -------------------------
*
* OR
*
* -------------------------
* @ComponentScan(
* nameGenerator = CustomBeanNameGenerator.class,
* basePackages = {"com.xit.biz", "com.xit.core"},
* excludeFilters = @ComponentScan.Filter(
* type = FilterType.ASPECTJ,
* pattern = {
* "com.xit"
* //"com..support.auth.jwt..*"
* }
* )
* )
*
* DatabaseConfig.java
* @MapperScan(
* nameGenerator = CustomBeanNameGenerator.class,
* basePackages = DataSourceConfig.PACKAGE,
* sqlSessionFactoryRef = "sqlSessionFactory"
* )
* static final String PACKAGE = "com.xit.**.mapper";
* --------------------------
*
* </pre>
*
*/
public class CustomBeanNameGenerator implements BeanNameGenerator { public class CustomBeanNameGenerator implements BeanNameGenerator {
@Override @Override
public @NonNull String generateBeanName(@NonNull BeanDefinition definition, @NonNull BeanDefinitionRegistry registry) { public @NonNull String generateBeanName(@NonNull BeanDefinition definition, @NonNull BeanDefinitionRegistry registry) {

@ -50,6 +50,38 @@
) )
</native-query> </native-query>
/* -------------------- 심의목록 삭제 ------------------------- */
<native-query id="selectRemoveJudgeTgtList">
/* parking-mapper|selectRemoveJudgeTgtList|julim */
SELECT ms_maincode
FROM min_simsa680
WHERE ms_chasu = #{msChasu}
AND ms_Sdate = #{msSdate}
AND ms_Edate = #{msEdate}
</native-query>
<native-query id="deleteJudgeUser">
/* parking-mapper|deleteJudgeUser|julim */
DELETE
FROM min_simsa_user680
WHERE msu_maincode = #{msMaincode}
</native-query>
<native-query id="deleteJudgeTgt">
/* parking-mapper|deleteJudgeTgt|julim */
DELETE
FROM min_simsa680
WHERE ms_maincode = #{msMaincode}
</native-query>
<native-query id="updateJudgeTgtReset">
/* parking-mapper|updateJudgeTgtReset|julim */
UPDATE tf680_recall
SET rc_ir_transfer = '1'
, rc_state = '0'
WHERE rc_code = #{msMaincode}
</native-query>
/* -------------------- 심의목록 삭제 ------------------------- */
<native-query id="insertJudgeTargetIntoSelect"> <native-query id="insertJudgeTargetIntoSelect">
/* parking-mapper|insertJudgeTargetIntoSelect|julim */ /* parking-mapper|insertJudgeTargetIntoSelect|julim */
@ -121,21 +153,9 @@
) )
</native-query> </native-query>
<native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu"> <native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu">
/* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */ /* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */
SELECT msu_team AS msuTeam SELECT MS.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

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<entity-mappings namespace="residentAndDisabled"> <entity-mappings namespace="residentAndDisabled">
<native-query id="selectParkingList"> <native-query id="selectJudgeList">
/* residentAndDisabled-mapper|selectParkingList|julim */ /* residentAndDisabled-mapper|selectJudgeList|julim */
SELECT ms_year, SELECT ms_year,
ms_chasu, ms_chasu,
ms_sdate, ms_sdate,
@ -10,6 +10,7 @@
ms_edate, ms_edate,
ms_cdate, ms_cdate,
ms_closesi, ms_closesi,
ms_datagb
cnt cnt
FROM ( FROM (
SELECT R.*, ROWNUM rn SELECT R.*, ROWNUM rn
@ -21,13 +22,15 @@
ms_edate, ms_edate,
ms_cdate, ms_cdate,
ms_closesi, ms_closesi,
ms_datagb,
count(ms_maincode) AS cnt count(ms_maincode) AS cnt
FROM min_simsa680 FROM min_simsa680_sc
WHERE ms_year = #{msYear} WHERE ms_year = #{msYear}
AND ms_datagb = #{msDatagb}
<if test="msChasu != null and msChasu != ''"> <if test="msChasu != null and msChasu != ''">
AND ms_chasu = #{msChasu} AND ms_chasu = #{msChasu}
</if> </if>
GROUP BY ms_year, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi GROUP BY ms_year, ms_datagb, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi
ORDER BY ms_year DESC, ms_chasu DESC ORDER BY ms_year DESC, ms_chasu DESC
) R ) R
WHERE ROWNUM &lt;= (#{page} + 1) * #{size} WHERE ROWNUM &lt;= (#{page} + 1) * #{size}
@ -36,20 +39,56 @@
AND ROWNUM &lt;= #{size} AND ROWNUM &lt;= #{size}
</native-query> </native-query>
<native-query id="selectParkingListCnt"> <native-query id="selectJudgeListCnt">
/* residentAndDisabled-mapper|selectParkingListCnt|julim */ /* residentAndDisabled-mapper|selectJudgeListCnt|julim */
SELECT count(*) AS totalCount SELECT count(*) AS totalCount
FROM ( FROM (
SELECT ms_year SELECT ms_year
FROM min_simsa680 FROM min_simsa680_sc
WHERE ms_year = #{msYear} WHERE ms_year = #{msYear}
AND ms_datagb = #{msDatagb}
<if test="msChasu != null and msChasu != ''"> <if test="msChasu != null and msChasu != ''">
AND ms_chasu = #{msChasu} AND ms_chasu = #{msChasu}
</if> </if>
GROUP BY ms_year, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi GROUP BY ms_year, ms_datagb, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi
) )
</native-query> </native-query>
/* -------------------- 심의목록 삭제 ------------------------- */
<native-query id="selectRemoveJudgeTgtList">
/* residentAndDisabled-mapper|selectRemoveJudgeTgtList|julim */
SELECT ms_maincode
FROM min_simsa680_sc
WHERE ms_datagb = #{msDatagb}
AND ms_chasu = #{msChasu}
AND ms_Sdate = #{msSdate}
AND ms_Edate = #{msEdate}
</native-query>
<native-query id="deleteJudgeUser">
/* residentAndDisabled-mapper|deleteJudgeUser|julim */
DELETE
FROM min_simsa_user680_sc
WHERE msu_maincode = #{msMaincode}
</native-query>
<native-query id="deleteJudgeTgt">
/* residentAndDisabled-mapper|deleteJudgeTgt|julim */
DELETE
FROM min_simsa680_sc
WHERE ms_maincode = #{msMaincode}
</native-query>
<native-query id="updateJudgeTgtReset">
/* residentAndDisabled-mapper|updateJudgeTgtReset|julim */
UPDATE gn_recall_sc_sc
SET sc_transfer = '1'
SET sc_state = '1'
WHERE sc_datagb = #{scDatagb}
AND sc_code = #{msMaincode}
</native-query>
/* -------------------- 심의목록 삭제 ------------------------- */
<native-query id="insertJudgeTargetIntoSelect"> <native-query id="insertJudgeTargetIntoSelect">
/* residentAndDisabled-mapper|insertJudgeTargetIntoSelect|julim */ /* residentAndDisabled-mapper|insertJudgeTargetIntoSelect|julim */
@ -117,50 +156,42 @@
) )
</native-query> </native-query>
<native-query id="selectTotJudgeResultGroupByTeamAndChasu">
/* residentAndDisabled-mapper|selectTotJudgeResultGroupByTeamAndChasu|julim */
SELECT MS.msu_team AS msuTeam
<native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu">
/* residentAndDisabled-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */
SELECT 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 MS FROM min_simsa680_sc MS
, msu680_view MV , msu680_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}
</if> </if>
AND MS.ms_datagb = #{msDatagb}
AND MS.ms_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
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
</native-query> </native-query>
<native-query id="selectParkingJudgeTeamGroupByChasuAndTeamList"> <native-query id="selectJudgeTeamGroupByChasuAndTeamList">
/* residentAndDisabled-mapper|selectParkingJudgeTeamGroupByChasuAndTeamList|julim */ /* residentAndDisabled-mapper|selectJudgeTeamGroupByChasuAndTeamList|julim */
SELECT MV.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 MS FROM min_simsa680_sc MS
, msu680_view MV , msu680_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}
</if> </if>
AND MS.ms_datagb = #{msDatagb}
AND MS.ms_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate} AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate} AND MS.ms_edate = #{msEdate}
@ -168,17 +199,18 @@
ORDER BY MS.ms_chasu, MV.msu_team ORDER BY MS.ms_chasu, MV.msu_team
</native-query> </native-query>
<native-query id="selectTotParkingJudgeResultGroupByUser"> <native-query id="selectTotJudgeResultGroupByUser">
/* residentAndDisabled-mapper|selectTotParkingJudgeResultByUser|julim */ /* residentAndDisabled-mapper|selectTotJudgeResultByUser|julim */
SELECT SUM(DECODE(MSU_RESULT, '2', 1, 0)) as bu SELECT SUM(DECODE(MSU.MSU_RESULT, '2', 1, 0)) as bu
, 0 as seo , 0 as seo
, SUM(DECODE(MSU_RESULT, '1', 1, 0)) as mibu , SUM(DECODE(MSU.MSU_RESULT, '1', 1, 0)) as mibu
, SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) as tot , SUM(DECODE(MSU.MSU_RESULT, '1', 1, '2', 1, 0)) as tot
, MU.name , MU.name
FROM min_simsa680 MS FROM min_simsa680_sc MS
, min_simsa_user680 MSU , min_simsa_user680 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_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate} AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate} AND MS.ms_edate = #{msEdate}
@ -190,14 +222,15 @@
ORDER BY MSU.msu_userid, MU.name ORDER BY MSU.msu_userid, MU.name
</native-query> </native-query>
<native-query id="selectParkingJurgeResultGroupByCarnum"> <native-query id="selectJurgeResultGroupByCarnum">
/* residentAndDisabled-mapper|selectParkingJurgeResultGroupByCarnum|julim */ /* residentAndDisabled-mapper|selectJurgeResultGroupByCarnum|julim */
SELECT MS.ms_maincode AS msMaincode SELECT MS.ms_maincode AS msMaincode
, MS.ms_seq AS msSeq , MS.ms_seq AS msSeq
, MS.ms_carnum AS msCarnum , MS.ms_carnum AS msCarnum
FROM min_simsa680 MS FROM min_simsa680_sc MS
, min_simsa_user680 MSU , min_simsa_user680 MSU
WHERE MS.ms_maincode = MSU.msu_maincode WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_datagb = #{msDatagb}
AND MS.ms_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate} AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate} AND MS.ms_edate = #{msEdate}
@ -208,8 +241,8 @@
ORDER 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>
<native-query id="selectParkingJudgeResultList"> <native-query id="selectJudgeResultList">
/* residentAndDisabled-mapper|selectParkingJudgeResultList|julim */ /* residentAndDisabled-mapper|selectJudgeResultList|julim */
SELECT MS.ms_maincode AS msMaincode SELECT MS.ms_maincode AS msMaincode
, MS.ms_seq AS msSeq , MS.ms_seq AS msSeq
, MS.ms_carnum AS msCarnum , MS.ms_carnum AS msCarnum
@ -227,10 +260,11 @@
AND code_lcd = 'GANGNAM_SIMSA' AND code_lcd = 'GANGNAM_SIMSA'
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 MS FROM min_simsa680_sc MS
, min_simsa_user680 MSU , min_simsa_user680 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_chasu = #{msChasu} AND MS.ms_chasu = #{msChasu}
AND MS.ms_sdate = #{msSdate} AND MS.ms_sdate = #{msSdate}
AND MS.ms_edate = #{msEdate} AND MS.ms_edate = #{msEdate}
@ -243,18 +277,6 @@
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"> <native-query id="selectJudegStdCount">
/* residentAndDisabled-mapper|selectJudegStdCount|julim */ /* residentAndDisabled-mapper|selectJudegStdCount|julim */
SELECT count(msu_code) SELECT count(msu_code)

Loading…
Cancel
Save