2024-02-14 15:44 청소년 강사 자동 배정 수정
This commit is contained in:
parent
35b8ce4377
commit
b7fc658540
@ -858,7 +858,11 @@ public class CommonWebController {
|
||||
for (int i=0;i<vEEduAplctVOList.size();i++) {
|
||||
|
||||
//chasiord, aplctord, hopedt & loginVO
|
||||
p = p + this.setTngrInstrAsgnm20231115(vEEduAplctVOList.get(i), loginVO);
|
||||
//p = p + this.setTngrInstrAsgnm20231115(vEEduAplctVOList.get(i), loginVO);
|
||||
|
||||
p = p + this.setTngrInstrAsgnm20231115_re_20240213(vEEduAplctVOList.get(i), loginVO);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1449,6 +1453,302 @@ public class CommonWebController {
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 연강 적용여부 확인
|
||||
*
|
||||
* 안사용하면 skip
|
||||
* 사용하는 경우
|
||||
*
|
||||
*1.해당 차시의 연강여부 확인
|
||||
**3.1-2연강이 아니면 해당 조건 skip
|
||||
*
|
||||
*2.1-1연강이면 연강이 가능한 강사를 우선 배정
|
||||
* 연강 가능 강사중 연강 차시에 기존 배정이 있으면 해당 강사 배정
|
||||
*
|
||||
* 없으면 연강 강사중에 배정
|
||||
*
|
||||
* 결과 테이블 만들어서 조인하고, 우선 조건으로 연강 적용(order by )
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* 거주지 강사 우선
|
||||
*
|
||||
* 거주지 적용여부 확인
|
||||
*
|
||||
* 안사용하면 skip
|
||||
* 사용하는 경우
|
||||
*
|
||||
* 1.거주지로 해당 차시 지역 비교 하여 맞는 강사 검색
|
||||
* 없으면 skip
|
||||
*
|
||||
* 2.해당 강사 중 본인 배정 비율 확인해서 넘으면 제거
|
||||
* 없으면 skip
|
||||
*
|
||||
* 결과 테이블 만들어서 조인하고, 우선 조건으로 연강 적용(order by )
|
||||
*
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
//강사배정-대상 강사가 있어야 강사를 할당한다.
|
||||
if (vEInstrAssiEduAplctVOList.size()>0) {
|
||||
VEInstrAsgnmVO p_vEInstrAsgnmVO = new VEInstrAsgnmVO();
|
||||
p_vEInstrAsgnmVO.setEduAplctOrd(p_tChasiInfo.getEduAplctOrd());
|
||||
p_vEInstrAsgnmVO.setEduChasiOrd(p_tChasiInfo.getEduChasiOrd());
|
||||
|
||||
p_vEInstrAsgnmVO.setUserId(vEInstrAssiEduAplctVOList.get(0).getUserId()); //배정 강사
|
||||
p_vEInstrAsgnmVO.setRmrks("배정기준1순위");
|
||||
|
||||
p_vEInstrAsgnmVO.setFrstRegisterId(p_loginVO.getUniqId());
|
||||
p_vEInstrAsgnmVO.setAsgnmAprvlCd("10"); //수락요청전
|
||||
p_vEInstrAsgnmVO.setAsgnmAprvlId(p_loginVO.getUniqId());
|
||||
|
||||
|
||||
System.out.println("===//강사배정-대상 강사가 있어야 강사를 할당한다.===");
|
||||
|
||||
//저장
|
||||
vEEduChasiInstrAsgnmService.insert(p_vEInstrAsgnmVO);
|
||||
|
||||
//저장여부 확인
|
||||
//step3-1.해당 차시에 강사 배정이 있는지 확인
|
||||
VEInstrAsgnmVO vEInstrAsgnmVOTmp = vEEduChasiInstrAsgnmService.selectDetail(p_vEInstrAsgnmVO);
|
||||
if (vEInstrAsgnmVOTmp!=null) {
|
||||
System.out.println("===O저장확인===");
|
||||
i_ret = 1;
|
||||
|
||||
}else {
|
||||
System.out.println("===X저장안됨===");
|
||||
}
|
||||
}
|
||||
|
||||
return i_ret;
|
||||
}
|
||||
|
||||
|
||||
//청소년 강사 배정 - 20231115
|
||||
private int setTngrInstrAsgnm20231115_re_20240213(
|
||||
VEEduAplctVO p_tChasiInfo //대상 차시 정보
|
||||
, LoginVO p_loginVO //등록자 정보
|
||||
) throws Exception{
|
||||
|
||||
int i_ret = 0; //성공시 1 ret
|
||||
|
||||
//eduChasiOrd, 희망일자가 필요
|
||||
//VEEduAplctVO tChasiInfo = vEEduAplctVOList.get(i);
|
||||
|
||||
String s_eduHopeDt = p_tChasiInfo.getEduHopeDt(); //교육희망일자
|
||||
String s_eduSlctCd = p_tChasiInfo.getEduSlctCd(); //온라인 10, 오프라인 20
|
||||
//String s_addr = tChasiInfo.getAddr(); //지역명
|
||||
|
||||
System.out.println(s_eduHopeDt);
|
||||
//System.out.println(s_addr);
|
||||
|
||||
|
||||
//파라미터
|
||||
VEAutoAsgnmVO vEAutoAsgnmVO = null;
|
||||
|
||||
String s_user_id = "'aaa'";
|
||||
|
||||
//대상 강사 리스트
|
||||
List<VEAutoAsgnmVO> vEInstrAssiEduAplctVOList = null;
|
||||
|
||||
//필수 조건(월별시수제한, 요일, 희망지역)
|
||||
{
|
||||
System.out.println("===step2-1.가능 강사중 월별 시수이상을 받지 않은자 & 해당 요일에 수업 가능한 강사 리스트(필)===");
|
||||
//step2-1.가능 강사중 월별 시수이상을 받지 않은자 & 해당 요일에 수업 가능한 강사 리스트(필)
|
||||
vEAutoAsgnmVO = new VEAutoAsgnmVO();
|
||||
vEAutoAsgnmVO.setEduHopeMnt(s_eduHopeDt.substring(5,7));
|
||||
vEAutoAsgnmVO.setYr(s_eduHopeDt.substring(0,4));
|
||||
vEAutoAsgnmVO.setInstrDiv("10"); //10-청소년, 20-성인
|
||||
vEAutoAsgnmVO.setEduChasiOrd(p_tChasiInfo.getEduChasiOrd());
|
||||
|
||||
vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrMntAsgnmtChasiList(vEAutoAsgnmVO);
|
||||
|
||||
|
||||
//step2-1-1.동일일자 시간대에 배정이 없는강사찾기
|
||||
for (int j=0;j<vEInstrAssiEduAplctVOList.size();j++) {
|
||||
s_user_id = s_user_id + ",'" + vEInstrAssiEduAplctVOList.get(j).getUserId()+"'";
|
||||
}
|
||||
|
||||
if (!"'aaa'".equals(s_user_id)) { //대상 강사가 있을때만 다음을 실행한다.
|
||||
System.out.println("===O있음===");
|
||||
|
||||
System.out.println("===////step2-1-1.동일일자 시간대에 배정이 없는강사찾기(필)===");
|
||||
vEAutoAsgnmVO.setUserIds(s_user_id);
|
||||
|
||||
vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrTimeDupFilterList(vEAutoAsgnmVO);
|
||||
|
||||
}else {
|
||||
System.out.println("===X없음===");
|
||||
}
|
||||
|
||||
|
||||
//step2-2.희망 지역 강사 검색(필)
|
||||
//오프라인, 온라인 구분해서 희망 지역 체크가 필요하다.
|
||||
//오프라인의 경우 (완)
|
||||
//온라인인 경우 (해당 강사의 zoom 가능 여부 체크)
|
||||
|
||||
s_user_id = "'aaa'";
|
||||
|
||||
for (int j=0;j<vEInstrAssiEduAplctVOList.size();j++) {
|
||||
s_user_id = s_user_id + ",'" + vEInstrAssiEduAplctVOList.get(j).getUserId()+"'";
|
||||
}
|
||||
|
||||
if (!"'aaa'".equals(s_user_id)) { //대상 강사가 있을때만 다음을 실행한다.
|
||||
System.out.println("===O있음===");
|
||||
|
||||
System.out.println("===////step2-2.희망 지역 강사 검색(필)===");
|
||||
vEAutoAsgnmVO.setUserIds(s_user_id);
|
||||
|
||||
if("10".equals(s_eduSlctCd)) { //온라인인 경우
|
||||
vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrHopeAreaZoomList(vEAutoAsgnmVO);
|
||||
}else {//오프라인인 경우
|
||||
vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrHopeAreaList(vEAutoAsgnmVO);
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
System.out.println("===X없음===");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//거주지별 비율
|
||||
{
|
||||
System.out.println("===//step3-4.월별시수대비할당이적은자 우선(필)===");
|
||||
|
||||
s_user_id = "'aaa'";
|
||||
for (int j=0;j<vEInstrAssiEduAplctVOList.size();j++) {
|
||||
s_user_id = s_user_id + ",'" + vEInstrAssiEduAplctVOList.get(j).getUserId()+"'";
|
||||
}
|
||||
|
||||
|
||||
//step2-1-0.거주지별 배정 비율 가능한 강사 리스트(필)
|
||||
if (!"'aaa'".equals(s_user_id)) { //대상 강사가 있을때만 다음을 실행한다.
|
||||
System.out.println("===O있음===");
|
||||
|
||||
vEAutoAsgnmVO = new VEAutoAsgnmVO();
|
||||
vEAutoAsgnmVO.setEduHopeMnt(s_eduHopeDt.substring(5,7));
|
||||
vEAutoAsgnmVO.setYr(s_eduHopeDt.substring(0,4));
|
||||
vEAutoAsgnmVO.setInstrDiv("10"); //10-청소년, 20-성인
|
||||
vEAutoAsgnmVO.setEduChasiOrd(p_tChasiInfo.getEduChasiOrd());
|
||||
vEAutoAsgnmVO.setEduSlctAreaCd(p_tChasiInfo.getEduSlctAreaCd());
|
||||
vEAutoAsgnmVO.setEduSlctCd(s_eduSlctCd);
|
||||
|
||||
|
||||
vEAutoAsgnmVO.setUserIds(s_user_id);
|
||||
|
||||
vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrMntAreaChasiList(vEAutoAsgnmVO);
|
||||
|
||||
|
||||
}else {
|
||||
System.out.println("===X없음===");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//우선순위
|
||||
{
|
||||
//step3-1.거주지 강사 우선(월별배정 비율 적용)
|
||||
//step3-2.연강가능여부(같은날 연강은 연강강사가 우선 배정)
|
||||
//step3-3.패널티(패널티 없는 사람이 우선순위 높게)
|
||||
|
||||
/*
|
||||
* 하기 테이블을 left outer 로 조인하고, 우선 순위에 적용해서 배정(order by)
|
||||
* 패널티 1순위
|
||||
* 연강 2순위
|
||||
* 거주지 3순위
|
||||
*/
|
||||
|
||||
|
||||
//패널티 사용
|
||||
/*
|
||||
* 패널티 적용여부 확인
|
||||
*
|
||||
* 안사용하면 skip
|
||||
* 사용하는 경우
|
||||
*
|
||||
* 하기 테이블 조인하고, 우선 조건으로 패널티 적용(order by )
|
||||
*
|
||||
* */
|
||||
|
||||
VEAStngVO vEAStngVO_10 = new VEAStngVO();
|
||||
VEAStngVO vEAStngVO_20 = new VEAStngVO();
|
||||
VEAStngVO vEAStngVO_30 = new VEAStngVO();
|
||||
|
||||
vEAStngVO_10.setAsgnmCd("10"); //거주지
|
||||
vEAStngVO_10 = vEAStngService.selectDetail_VEAIAC(vEAStngVO_10);
|
||||
|
||||
vEAStngVO_20.setAsgnmCd("20"); //연강
|
||||
vEAStngVO_20 = vEAStngService.selectDetail_VEAIAC(vEAStngVO_20);
|
||||
|
||||
vEAStngVO_30.setAsgnmCd("30"); //패널티
|
||||
vEAStngVO_30 = vEAStngService.selectDetail_VEAIAC(vEAStngVO_30);
|
||||
|
||||
|
||||
//step3-4.월별시수대비할당이적은자 우선(필)
|
||||
|
||||
s_user_id = "'aaa'";
|
||||
for (int j=0;j<vEInstrAssiEduAplctVOList.size();j++) {
|
||||
s_user_id = s_user_id + ",'" + vEInstrAssiEduAplctVOList.get(j).getUserId()+"'";
|
||||
}
|
||||
|
||||
System.out.println("===////step2-1-0.거주지별 배정 비율 가능한 강사 리스트(필)===");
|
||||
|
||||
if (!"'aaa'".equals(s_user_id)) { //대상 강사가 있을때만 다음을 실행한다.
|
||||
System.out.println("===O있음===");
|
||||
|
||||
String s_orderByQuery = " ";
|
||||
|
||||
//거주지 쿼리 적용
|
||||
if ("Y".equals(vEAStngVO_10.getUseYn())) {
|
||||
s_orderByQuery = s_orderByQuery + " sign( CASE WHEN instr(zzz.addr, substr(ddd.rsdne, 0, 2))>0 THEN 1 ELSE 0 END " +
|
||||
" + CASE WHEN instr(ddd.rsdne, substr(zzz.addr, 0, 2))>0 THEN 1 ELSE 0 END " +
|
||||
" ) desc , ";
|
||||
}
|
||||
|
||||
//연강 쿼리 적용
|
||||
if ("Y".equals(vEAStngVO_20.getUseYn())) {
|
||||
s_orderByQuery = s_orderByQuery + " NVL(eee.cntnsCnt,0) DESC, DECODE(ccc0.cntnsLctrPsblYn,'Y',1,0) desc , ";
|
||||
}
|
||||
|
||||
//패널티 쿼리 적용
|
||||
if ("Y".equals(vEAStngVO_20.getUseYn())) {
|
||||
s_orderByQuery = s_orderByQuery + " NVL(bbb.pnltyCnt, 0) asc , ";
|
||||
}
|
||||
|
||||
s_orderByQuery = s_orderByQuery + " NVL(aaa.instrSumChasi*10000,0)/(aaa.asgnmTm+1) asc, ccc0.areaCnt ASC, ccc0.weekCnt asc ";
|
||||
|
||||
//거주지 비교를 위해서 학교 주소에 필요
|
||||
vEAutoAsgnmVO.setEduAplctOrd(p_tChasiInfo.getEduAplctOrd());
|
||||
|
||||
//대상장 강사에 대해서만 검사
|
||||
vEAutoAsgnmVO.setUserIds(s_user_id);
|
||||
|
||||
|
||||
|
||||
|
||||
//기본 정렬 쿼리 - 월별시수대비할당이적은자
|
||||
vEAutoAsgnmVO.setOrderByQuery(" ORDER BY "+s_orderByQuery);
|
||||
|
||||
vEInstrAssiEduAplctVOList = vEAutoAsgnmMIXService.selectInstrPriorityList(vEAutoAsgnmVO);
|
||||
}else {
|
||||
System.out.println("===X없음===");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
SELECT a.user_id AS userId
|
||||
, count(*) AS pnltyCnt
|
||||
FROM ve_edu_pnlty a
|
||||
GROUP BY a.user_id
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 연강 적용여부 확인
|
||||
*
|
||||
|
||||
@ -7,6 +7,9 @@ public interface VEAutoAsgnmMIXService {
|
||||
//step2-1.가능 강사중 월별 시수이상을 받지 않은자 & 해당 요일에 수업 가능한 강사 리스트(필)
|
||||
List<VEAutoAsgnmVO> selectInstrMntAsgnmtChasiList(VEAutoAsgnmVO paramVO) throws Exception;
|
||||
|
||||
//step2-1-0.거주지별 배정 비율 가능한 강사 리스트(필)
|
||||
List<VEAutoAsgnmVO> selectInstrMntAreaChasiList(VEAutoAsgnmVO paramVO) throws Exception;
|
||||
|
||||
//해당 차시 학교에 거주하는 강사
|
||||
List<VEAutoAsgnmVO> selectRsdneInstrList(VEAutoAsgnmVO paramVO) throws Exception;
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ public class VEAutoAsgnmVO extends ComDefaultVO implements Serializable {
|
||||
private String hopeEduFld; //희망교육부분
|
||||
private String asgnmTm; //할당된시간
|
||||
|
||||
private String eduAplctOrd; //신청 고유 순번
|
||||
private String eduChasiOrd; //차시 고유 순번
|
||||
|
||||
private String userIds; //강사아이디들
|
||||
@ -83,6 +84,11 @@ public class VEAutoAsgnmVO extends ComDefaultVO implements Serializable {
|
||||
|
||||
private String orderByQuery; //배정을 위한 우선 순위 order by 쿼리
|
||||
|
||||
private String eduSlctAreaCd; //강사거주지별배정비율설정코드
|
||||
private String eduSlctCd; //온/오프라인여부 10-온라인, 20-오프라인
|
||||
|
||||
|
||||
|
||||
public String getPnltyQuery() {
|
||||
return pnltyQuery;
|
||||
}
|
||||
@ -523,6 +529,30 @@ public class VEAutoAsgnmVO extends ComDefaultVO implements Serializable {
|
||||
this.achvmRt = achvmRt;
|
||||
}
|
||||
|
||||
public String getEduSlctAreaCd() {
|
||||
return eduSlctAreaCd;
|
||||
}
|
||||
|
||||
public void setEduSlctAreaCd(String eduSlctAreaCd) {
|
||||
this.eduSlctAreaCd = eduSlctAreaCd;
|
||||
}
|
||||
|
||||
public String getEduSlctCd() {
|
||||
return eduSlctCd;
|
||||
}
|
||||
|
||||
public void setEduSlctCd(String eduSlctCd) {
|
||||
this.eduSlctCd = eduSlctCd;
|
||||
}
|
||||
|
||||
public String getEduAplctOrd() {
|
||||
return eduAplctOrd;
|
||||
}
|
||||
|
||||
public void setEduAplctOrd(String eduAplctOrd) {
|
||||
this.eduAplctOrd = eduAplctOrd;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,9 @@ public interface VEEduMIXService {
|
||||
|
||||
List<VEEduAplctVO> selectTngrRsltPagingList(VEEduAplctVO paramVO) throws Exception;
|
||||
|
||||
//연강 우선으로 쿼리 변경
|
||||
List<VEEduAplctVO> selectTngrCntnsPagingList(VEEduAplctVO paramVO) throws Exception;
|
||||
|
||||
//대량강사자동배정대상 - step0,1 - 개별
|
||||
List<VEEduAplctVO> selectTngrRsltPagingList_EA(VEEduAplctVO paramVO) throws Exception;
|
||||
|
||||
|
||||
@ -16,6 +16,12 @@ public class VEAutoAsgnmMIXDAO extends EgovAbstractDAO {
|
||||
return tlist;
|
||||
}
|
||||
|
||||
public List<VEAutoAsgnmVO> selectInstrMntAreaChasiList(VEAutoAsgnmVO paramVO) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<VEAutoAsgnmVO> tlist = (List<VEAutoAsgnmVO>) list("VEAutoAsgnmDAO.selectInstrMntAreaChasiList", paramVO);
|
||||
return tlist;
|
||||
}
|
||||
|
||||
public List<VEAutoAsgnmVO> selectRsdneInstrList(VEAutoAsgnmVO paramVO) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<VEAutoAsgnmVO> tlist = (List<VEAutoAsgnmVO>) list("VEAutoAsgnmDAO.selectRsdneInstrList", paramVO);
|
||||
|
||||
@ -23,6 +23,11 @@ public class VEAutoAsgnmMIXServiceImpl implements VEAutoAsgnmMIXService {
|
||||
return vEAutoAsgnmMIXDAO.selectInstrMntAsgnmtChasiList(paramVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VEAutoAsgnmVO> selectInstrMntAreaChasiList(VEAutoAsgnmVO paramVO) throws Exception{
|
||||
return vEAutoAsgnmMIXDAO.selectInstrMntAreaChasiList(paramVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VEAutoAsgnmVO> selectRsdneInstrList(VEAutoAsgnmVO paramVO) throws Exception{
|
||||
return vEAutoAsgnmMIXDAO.selectRsdneInstrList(paramVO);
|
||||
|
||||
@ -68,6 +68,12 @@ public class VEEduMIXDAO extends EgovAbstractDAO {
|
||||
return tlist;
|
||||
}
|
||||
|
||||
public List<VEEduAplctVO> selectTngrCntnsPagingList(VEEduAplctVO paramVO) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<VEEduAplctVO> tlist = (List<VEEduAplctVO>) list("VEEduMIXDAO.selectTngrCntnsPagingList", paramVO);
|
||||
return tlist;
|
||||
}
|
||||
|
||||
public List<VEEduAplctVO> selectTngrRsltPagingList_EA(VEEduAplctVO paramVO) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<VEEduAplctVO> tlist = (List<VEEduAplctVO>) list("VEEduMIXDAO.selectTngrRsltPagingList_EA", paramVO);
|
||||
|
||||
@ -60,6 +60,11 @@ public class VEEduMIXServiceImpl implements VEEduMIXService {
|
||||
return vEEduMIXDAO.selectTngrRsltPagingList(paramVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VEEduAplctVO> selectTngrCntnsPagingList(VEEduAplctVO paramVO) throws Exception{
|
||||
return vEEduMIXDAO.selectTngrCntnsPagingList(paramVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VEEduAplctVO> selectTngrRsltPagingList_EA(VEEduAplctVO paramVO) throws Exception{
|
||||
return vEEduMIXDAO.selectTngrRsltPagingList_EA(paramVO);
|
||||
|
||||
@ -486,7 +486,9 @@ public class NewEduCnfrmMngTngrController {
|
||||
//강사할당이 없는 배정 대상 차시를 가져온다.
|
||||
|
||||
if (!"".equals(s_searchStartDt) && !"".equals(s_searchEndDt)) {
|
||||
vEEduAplctVOList = vEEduMIXService.selectTngrRsltPagingList(vEEduAplctVO);
|
||||
//vEEduAplctVOList = vEEduMIXService.selectTngrRsltPagingList(vEEduAplctVO);
|
||||
vEEduAplctVOList = vEEduMIXService.selectTngrCntnsPagingList(vEEduAplctVO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -335,6 +335,122 @@
|
||||
END
|
||||
</select>
|
||||
|
||||
<!-- //해당 배정 차시의 달에 강사에게 할당된 차시 정보 L page -->
|
||||
<select id="VEAutoAsgnmDAO.selectInstrMntAreaChasiList" parameterClass="VEAutoAsgnmVO" resultClass="VEAutoAsgnmVO" remapResults="true">
|
||||
/* VEAutoAsgnmDAO.selectInstrMntAreaChasiList */
|
||||
SELECT aaa.*
|
||||
FROM(
|
||||
|
||||
SELECT
|
||||
dd.EDU_APLCT_ORD
|
||||
, dd.EDU_CHASI_ORD
|
||||
, dd.EDU_HOPE_DT
|
||||
, DECODE(ee.MON_LCTR_YN,'Y',1,0)
|
||||
+ DECODE(ee.TUE_LCTR_YN,'Y',1,0)
|
||||
+ DECODE(ee.WED_LCTR_YN,'Y',1,0)
|
||||
+ DECODE(ee.THU_LCTR_YN,'Y',1,0)
|
||||
+ DECODE(ee.FRI_LCTR_YN,'Y',1,0) AS daySum
|
||||
|
||||
|
||||
, NVL(aa.instrSumChasi,0) AS instrSumChasi /* 해당 강사 할당된 총차시 */
|
||||
, ee.user_id AS userId
|
||||
, COUNT(1) OVER() AS totCnt
|
||||
|
||||
, nvl(
|
||||
CASE
|
||||
WHEN '01'=#eduHopeMnt# THEN m01_tm
|
||||
WHEN '02'=#eduHopeMnt# THEN m02_tm
|
||||
WHEN '03'=#eduHopeMnt# THEN m03_tm
|
||||
WHEN '04'=#eduHopeMnt# THEN m04_tm
|
||||
WHEN '05'=#eduHopeMnt# THEN m05_tm
|
||||
WHEN '06'=#eduHopeMnt# THEN m06_tm
|
||||
WHEN '07'=#eduHopeMnt# THEN m07_tm
|
||||
WHEN '08'=#eduHopeMnt# THEN m08_tm
|
||||
WHEN '09'=#eduHopeMnt# THEN m09_tm
|
||||
WHEN '10'=#eduHopeMnt# THEN m10_tm
|
||||
WHEN '11'=#eduHopeMnt# THEN m11_tm
|
||||
WHEN '12'=#eduHopeMnt# THEN m12_tm
|
||||
|
||||
|
||||
END
|
||||
,0)
|
||||
AS asgnmTm
|
||||
|
||||
FROM
|
||||
ve_edu_chasi dd
|
||||
, ve_lctr_stng ee
|
||||
, vea_instr_indvd_mnt_tm bb /* 강사의 월별 배정가능한 시수 */
|
||||
LEFT OUTER JOIN
|
||||
(
|
||||
/* 강사에게 교육이 할당(확정, 반려, 요청전, 요첮우 모두 포함)된 차시수 */
|
||||
SELECT
|
||||
d.user_id,
|
||||
sum(NVL(b.chasi, 0)) AS instrSumChasi
|
||||
FROM ve_edu_aplct a ,
|
||||
ve_edu_chasi b
|
||||
LEFT OUTER JOIN ve_edu_chasi_instr_asgnm d
|
||||
ON (
|
||||
b.edu_aplct_ord=d.edu_aplct_ord
|
||||
AND b.edu_chasi_ord=d.edu_chasi_ord
|
||||
)
|
||||
WHERE 1 =1
|
||||
AND a.edu_aplct_ord =b.edu_aplct_ord
|
||||
AND NVL(A.USE_YN, 'Y') <![CDATA[ <> ]]> 'N'
|
||||
AND a.LCTR_DIV_CD = '10'
|
||||
AND a.aprvl_cd = '60'
|
||||
AND 1 =1
|
||||
AND b.edu_hope_dt LIKE #yr#||'.'||#eduHopeMnt#||'%'
|
||||
AND a.edu_slct_area_cd =#eduSlctAreaCd#
|
||||
GROUP BY d.user_id
|
||||
)aa
|
||||
on(
|
||||
aa.user_id=bb.user_id
|
||||
|
||||
)
|
||||
WHERE 1=1
|
||||
AND dd.EDU_CHASI_ORD =#eduChasiOrd#
|
||||
AND bb.YR=substring(dd.edu_hope_dt,0,4)
|
||||
|
||||
AND ee.use_yn='Y'
|
||||
AND ee.user_id=bb.user_id
|
||||
|
||||
AND bb.user_id IN ($userIds$)
|
||||
|
||||
|
||||
/* 대상 조건 1. 해당 월의 배정된 차시가 최대 차시 이내인 강사만 대상임 */
|
||||
AND NVL(
|
||||
CASE
|
||||
WHEN '01'=#eduHopeMnt# THEN m01_tm
|
||||
WHEN '02'=#eduHopeMnt# THEN m02_tm
|
||||
WHEN '03'=#eduHopeMnt# THEN m03_tm
|
||||
WHEN '04'=#eduHopeMnt# THEN m04_tm
|
||||
WHEN '05'=#eduHopeMnt# THEN m05_tm
|
||||
WHEN '06'=#eduHopeMnt# THEN m06_tm
|
||||
WHEN '07'=#eduHopeMnt# THEN m07_tm
|
||||
WHEN '08'=#eduHopeMnt# THEN m08_tm
|
||||
WHEN '09'=#eduHopeMnt# THEN m09_tm
|
||||
WHEN '10'=#eduHopeMnt# THEN m10_tm
|
||||
WHEN '11'=#eduHopeMnt# THEN m11_tm
|
||||
WHEN '12'=#eduHopeMnt# THEN m12_tm
|
||||
|
||||
END
|
||||
,0)>NVL(aa.instrSumChasi,0)
|
||||
)aaa
|
||||
,
|
||||
(
|
||||
SELECT *
|
||||
FROM vea_instr_rsdnc_ratio
|
||||
WHERE
|
||||
('10'=#eduSlctCd# AND area_cd='400')
|
||||
OR ('20'=#eduSlctCd# AND area_cd=#eduSlctAreaCd#)
|
||||
)bbb
|
||||
WHERE
|
||||
/* 지역별제한차시를 넘지 않았는지 확인 */
|
||||
decode(daysum,5,bbb.ratio_5,decode(daysum,4,bbb.ratio_4,decode(daysum,3,bbb.ratio_3,decode(daysum,2,bbb.ratio_2,decode(daysum,1,bbb.ratio_1,100)))))*asgnmtm/100
|
||||
>=
|
||||
instrsumchasi
|
||||
</select>
|
||||
|
||||
<!-- //해당 차시 학교에 거주하는 강사 L page -->
|
||||
<select id="VEAutoAsgnmDAO.selectRsdneInstrList" parameterClass="VEAutoAsgnmVO" resultClass="VEAutoAsgnmVO" remapResults="true">
|
||||
/* VEAutoAsgnmDAO.selectRsdneInstrList */
|
||||
@ -662,7 +778,21 @@
|
||||
, aaa.instrSumChasi
|
||||
, aaa.asgnmTm
|
||||
, rownum
|
||||
|
||||
/*연강여부*/
|
||||
, eee.cntnsCnt
|
||||
, ccc0.cntnsLctrPsblYn
|
||||
/*패널티*/
|
||||
, NVL(bbb.pnltyCnt, 0) AS pnltyCnt
|
||||
, zzz.addr
|
||||
, ddd.rsdne
|
||||
/*거주지 우선*/
|
||||
, sign( CASE WHEN instr(zzz.addr, substr(ddd.rsdne, 0, 2))>0 THEN 1 ELSE 0 END
|
||||
+ CASE WHEN instr(ddd.rsdne, substr(zzz.addr, 0, 2))>0 THEN 1 ELSE 0 END
|
||||
) AS inArea
|
||||
|
||||
FROM (
|
||||
/* 배정시간현황 */
|
||||
SELECT
|
||||
aa.user_id
|
||||
, bb.userId
|
||||
@ -721,12 +851,25 @@
|
||||
)aaa
|
||||
|
||||
/* 패널티 적용시 쿼리 추가됨 - 시작 */
|
||||
$pnltyQuery$
|
||||
/* 패널티 */
|
||||
LEFT OUTER JOIN (
|
||||
SELECT
|
||||
a.user_id AS userId
|
||||
, count(*) AS pnltyCnt
|
||||
FROM
|
||||
ve_edu_pnlty a
|
||||
GROUP BY
|
||||
a.user_id
|
||||
)bbb ON
|
||||
( aaa.user_id = bbb.userId )
|
||||
/* 패널티 적용시 쿼리 추가됨 - 끝 */
|
||||
|
||||
/* 지역이 적은 사람, 주간 교육 가능일수가 적은 사람을 위해 추가 */
|
||||
LEFT OUTER JOIN (
|
||||
SELECT aa.user_id AS userId, aa.areaCnt, bb.weekCnt
|
||||
SELECT aa.user_id AS userId
|
||||
, aa.areaCnt
|
||||
, bb.weekCnt
|
||||
, bb.cntnsLctrPsblYn
|
||||
FROM (
|
||||
SELECT a.user_id, count(*) AS areaCnt
|
||||
FROM ve_lctr_area a
|
||||
@ -737,6 +880,7 @@
|
||||
,(
|
||||
SELECT a0.user_id
|
||||
, max(weekCnt) AS weekCnt
|
||||
, max(cntnsLctrPsblYn) AS cntnsLctrPsblYn
|
||||
FROM (
|
||||
SELECT a.user_id
|
||||
,decode(a.mon_lctr_yn,'Y',1,0)
|
||||
@ -744,6 +888,7 @@
|
||||
+decode(a.wed_lctr_yn,'Y',1,0)
|
||||
+decode(a.thu_lctr_yn,'Y',1,0)
|
||||
+decode(a.fri_lctr_yn,'Y',1,0) AS weekCnt
|
||||
, cntns_lctr_psbl_yn AS cntnsLctrPsblYn
|
||||
FROM ve_lctr_stng a
|
||||
WHERE a.use_yn='Y'
|
||||
AND a.instr_div='10'
|
||||
@ -756,6 +901,46 @@
|
||||
)ccc0
|
||||
on ( aaa.user_id = ccc0.userId )
|
||||
|
||||
/* 강사 거주지 찾기 */
|
||||
LEFT OUTER JOIN (
|
||||
|
||||
SELECT user_id, max(rsdne) AS rsdne
|
||||
FROM (
|
||||
SELECT user_id
|
||||
, regexp_substr(rsdne,'[^(]+',1,1) AS rsdne
|
||||
FROM
|
||||
ve_instr_detail a
|
||||
WHERE
|
||||
a.use_yn = 'Y'
|
||||
AND a.instr_div = '10'
|
||||
AND a.user_id IN ($userIds$)
|
||||
)aa
|
||||
GROUP BY user_id
|
||||
|
||||
)ddd
|
||||
on(aaa.user_id = ddd.user_id)
|
||||
|
||||
LEFT OUTER JOIN (
|
||||
|
||||
SELECT user_id, count(*) cntnsCnt
|
||||
FROM ve_edu_chasi_instr_asgnm
|
||||
WHERE 1=1
|
||||
AND edu_aplct_ord=#eduAplctOrd#
|
||||
GROUP BY user_id
|
||||
|
||||
)eee
|
||||
on
|
||||
(aaa.user_id = eee.user_id)
|
||||
|
||||
,
|
||||
(
|
||||
/* 해당차시의 지역정보 */
|
||||
SELECT regexp_substr(addr,'[^ ]+',1,1) AS addr
|
||||
FROM ve_edu_aplct
|
||||
WHERE 1=1
|
||||
AND edu_aplct_ord=#eduAplctOrd#
|
||||
)zzz
|
||||
|
||||
WHERE 1=1
|
||||
|
||||
/*
|
||||
@ -898,7 +1083,9 @@
|
||||
AND a.LCTR_DIV_CD = '10'
|
||||
AND a.aprvl_cd = '60'
|
||||
|
||||
/*
|
||||
AND d.asgnm_aprvl_cd = '30'
|
||||
*/
|
||||
|
||||
AND 1 =1
|
||||
|
||||
|
||||
@ -2853,13 +2853,99 @@
|
||||
</isNotEqual>
|
||||
</select>
|
||||
|
||||
<!-- 청소년 교육 결과 L page -->
|
||||
<select id="VEEduMIXDAO.selectTngrCntnsPagingList" parameterClass="VEEduAplctVO" resultClass="VEEduAplctVO" remapResults="true">
|
||||
/* VEEduMIXDAO.selectTngrCntnsPagingList */
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT aaa.edu_aplct_ord AS eduAplctOrd
|
||||
, aaa.edu_chasi_ord AS eduChasiOrd
|
||||
, sum(un_ov) AS unOv
|
||||
FROM (
|
||||
SELECT aa.*
|
||||
<![CDATA[
|
||||
, CASE WHEN aa.edu_hope_dt=bb.edu_hope_dt AND aa.strt_tm <=bb.strt_tm AND aa.end_tm <=bb.strt_tm THEN 1 ELSE 0 END
|
||||
+ CASE WHEN aa.edu_hope_dt=bb.edu_hope_dt AND aa.strt_tm >=bb.end_tm AND aa.end_tm >=bb.end_tm THEN 1 ELSE 0 END
|
||||
+ CASE WHEN aa.edu_chasi_ord=bb.edu_chasi_ord THEN 1 ELSE 0 END
|
||||
AS un_ov
|
||||
]]>
|
||||
, bb.strt_tm
|
||||
, bb.end_tm
|
||||
|
||||
FROM (
|
||||
SELECT
|
||||
b.edu_aplct_ord
|
||||
, b.edu_chasi_ord
|
||||
, b.edu_hope_dt
|
||||
, b.strt_tm
|
||||
, b.end_tm
|
||||
|
||||
|
||||
FROM ve_edu_aplct a
|
||||
, ve_edu_chasi b
|
||||
|
||||
LEFT OUTER JOIN ve_edu_chasi_instr_asgnm d
|
||||
ON( b.edu_aplct_ord=d.edu_aplct_ord
|
||||
AND b.edu_chasi_ord=d.edu_chasi_ord)
|
||||
WHERE 1=1
|
||||
AND a.edu_aplct_ord=b.edu_aplct_ord
|
||||
AND NVL(A.USE_YN, 'Y') <![CDATA[ <> ]]> 'N'
|
||||
<isNotEmpty property="lctrDivCd">
|
||||
AND a.LCTR_DIV_CD = #lctrDivCd#
|
||||
</isNotEmpty>
|
||||
<isNotEmpty property="aprvlCd">
|
||||
AND a.aprvl_cd = #aprvlCd#
|
||||
</isNotEmpty>
|
||||
|
||||
<isNotEmpty property="searchAsgnmAprvlCd">
|
||||
<isEqual property="searchAsgnmAprvlCd" compareValue="90">
|
||||
AND d.asgnm_aprvl_cd is null
|
||||
</isEqual>
|
||||
<isNotEqual property="searchAsgnmAprvlCd" compareValue="90">
|
||||
AND d.asgnm_aprvl_cd = #searchAsgnmAprvlCd#
|
||||
</isNotEqual>
|
||||
</isNotEmpty>
|
||||
|
||||
<isNotEmpty property="searchStartDt">
|
||||
|
||||
AND b.EDU_HOPE_DT <![CDATA[ >= ]]> #searchStartDt#
|
||||
</isNotEmpty>
|
||||
|
||||
<isNotEmpty property="searchEndDt">
|
||||
|
||||
AND b.EDU_HOPE_DT <![CDATA[ <= ]]> #searchEndDt#
|
||||
</isNotEmpty>
|
||||
|
||||
<isNotEmpty property="searchScholNm">
|
||||
AND A.schol_Instt_Nm LIKE '%' || #searchScholNm# || '%'
|
||||
</isNotEmpty>
|
||||
|
||||
<isEmpty property="searchStartDt">
|
||||
<isEmpty property="searchEndDt">
|
||||
AND 1=1
|
||||
</isEmpty>
|
||||
</isEmpty>
|
||||
) AA
|
||||
|
||||
LEFT OUTER JOIN ve_edu_chasi bb
|
||||
on(aa.edu_aplct_ord=bb.edu_aplct_ord
|
||||
)
|
||||
|
||||
)aaa
|
||||
GROUP BY aaa.edu_aplct_ord, aaa.edu_chasi_ord
|
||||
)aaaa
|
||||
ORDER BY aaaa.unOv desc , aaaa.eduChasiOrd
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 청소년 교육 결과 L page -->
|
||||
<select id="VEEduMIXDAO.selectTngrRsltPagingList_EA" parameterClass="VEEduAplctVO" resultClass="VEEduAplctVO" remapResults="true">
|
||||
/* VEEduMIXDAO.selectTngrRsltPagingList_EA */
|
||||
SELECT b.edu_aplct_ord AS eduAplctOrd
|
||||
, b.edu_chasi_ord AS eduChasiOrd
|
||||
, b.edu_hope_dt AS eduHopeDt
|
||||
, a.EDU_SLCT_CD AS eduSlctCd /* 온라인 10, 오프라인 20 */
|
||||
SELECT b.edu_aplct_ord AS eduAplctOrd
|
||||
, b.edu_chasi_ord AS eduChasiOrd
|
||||
, b.edu_hope_dt AS eduHopeDt
|
||||
, a.EDU_SLCT_CD AS eduSlctCd /* 온라인 10, 오프라인 20 */
|
||||
, a.EDU_SLCT_AREA_CD AS eduSlctAreaCd /* 지역코드 */
|
||||
from ve_edu_aplct a
|
||||
, ve_edu_chasi b
|
||||
, (
|
||||
|
||||
@ -888,7 +888,7 @@
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<c:if test="${empty pnltyList}">
|
||||
<tr><td colspan="5"><spring:message code="common.nodata.msg" /></td></tr>
|
||||
<tr><td colspan="6"><spring:message code="common.nodata.msg" /></td></tr>
|
||||
</c:if>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -960,7 +960,7 @@
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<c:if test="${empty selectListVEAIHM}">
|
||||
<tr><td colspan="6"><spring:message code="common.nodata.msg" /></td></tr>
|
||||
<tr><td colspan="7"><spring:message code="common.nodata.msg" /></td></tr>
|
||||
</c:if>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user