단속조별 통계 수정

main
이범준 1 year ago
parent bc3105ac5a
commit 4761765b12

@ -18,26 +18,12 @@ public class CodeConverter {
List<DataObject> deptList = new ArrayList<DataObject>();
List<DataObject> vltnList = new ArrayList<DataObject>();
List<DataObject> userList = new ArrayList<DataObject>();
List<DataObject> teamList = new ArrayList<DataObject>();
public CodeConverter(Map<String, List<CommonCode>> commonCodes){
this.commonCodes = commonCodes;
}
public void putSgg(DataObject dataobject){
this.sggList.add(dataobject);
}
public void putDept(DataObject dataobject){
this.deptList.add(dataobject);
}
public void putVltn(DataObject dataobject){
this.vltnList.add(dataobject);
}
public void putUser(DataObject dataobject){
this.userList.add(dataobject);
}
/** .
* @param codeGroupName , value
@ -124,65 +110,54 @@ public class CodeConverter {
return result;
}
/** ID .
* @param vltnId ID
* @return
*/
public String vltnIdToValue(String vltnId){
String result = "";
for(int i = 0; i < vltnList.size(); i++) {
if(vltnId.equals(vltnList.get(i).string("VLTN_ID"))) {
result = vltnList.get(i).string("VLTN_NM");
}
public void putOtherCode(String type, DataObject dataobject){
switch(type) {
case "SGG_CD" :
this.sggList.add(dataobject);
break;
case "DEPT_CD" :
this.deptList.add(dataobject);
break;
case "VLTN_ID" :
this.vltnList.add(dataobject);
break;
case "USER_ID" :
this.userList.add(dataobject);
break;
case "TEAM_ID" :
this.teamList.add(dataobject);
break;
}
return result;
}
/** .
* @param sggCd
* @return
*/
public String sggCodeToValue(String sggCd){
public String uniqOtherCodeToValue(String type, String uniqId) {
String result = "";
for(int i = 0; i < sggList.size(); i++) {
if(sggCd.equals(sggList.get(i).string("SGG_CD"))) {
result = sggList.get(i).string("SGG_NM");
}
List<DataObject> otherCodeList = null;
switch(type) {
case "SGG_CD" :
otherCodeList = this.sggList;
break;
case "DEPT_CD" :
otherCodeList = this.deptList;
break;
case "VLTN_ID" :
otherCodeList = this.vltnList;
break;
case "USER_ID" :
otherCodeList = this.userList;
break;
case "TEAM_ID" :
otherCodeList = this.teamList;
break;
}
return result;
}
/** .
* @param deptCd
* @return
*/
public String deptCodeToValue(String deptCd){
String result = "";
for(int i = 0; i < deptList.size(); i++) {
if(deptCd.equals(deptList.get(i).string("DEPT_CD"))) {
result = deptList.get(i).string("DEPT_NM");
}
if(otherCodeList == null) {
return result;
}
return result;
}
/** ID .
* @param userId ID
* @return
*/
public String userIdToUserName(String userId){
String result = "";
for(int i = 0; i < userList.size(); i++) {
if(userId.equals(userList.get(i).string("USER_ID"))) {
result = userList.get(i).string("USER_NM");
for(int i = 0; i < otherCodeList.size(); i++) {
if(uniqId.equals(otherCodeList.get(i).string(type))) {
result = otherCodeList.get(i).string("NAME");
}
}

@ -16,4 +16,6 @@ public interface StatMapper extends AbstractMapper {
DataObject selectUserById(String userId);
DataObject selectTeamById(String teamId);
}

@ -402,52 +402,19 @@ public class StatBean extends AbstractComponent {
}
itemName = codeConverter.vltnCdToValue(taskSeCd, compositeItemId[i]);
} else if(dtlCtgr.equals("VLTN_ID")) {
String find = codeConverter.vltnIdToValue(compositeItemId[i]);
if(!find.equals("")) {
itemName = find;
} else {
DataObject findRow = statMapper.selectVltnById(compositeItemId[i]);
if(findRow != null){
itemName = findRow.string("VLTN_NM");
codeConverter.putVltn(findRow);
}
}
} else if(dtlCtgr.equals("SGG_CD")) {
String find = codeConverter.sggCodeToValue(compositeItemId[i]);
if(!find.equals("")) {
itemName = find;
} else {
DataObject findRow = statMapper.selectSggByCode(compositeItemId[i]);
if(findRow != null){
itemName = findRow.string("SGG_NM");
codeConverter.putSgg(findRow);
}
}
} else if(dtlCtgr.equals("DEPT_CD")) {
String find = codeConverter.deptCodeToValue(compositeItemId[i]);
if(!find.equals("")) {
itemName = find;
} else {
DataObject findRow = statMapper.selectDeptByCode(compositeItemId[i]);
} else if(dtlCtgr.equals("VLTN_ID") || dtlCtgr.equals("TEAM_ID")
|| dtlCtgr.equals("SGG_CD") || dtlCtgr.equals("DEPT_CD") || dtlCtgr.equals("USER_ID")) {
if(findRow != null){
itemName = findRow.string("DEPT_NM");
codeConverter.putDept(findRow);
}
}
} else if(dtlCtgr.equals("USER_ID")) {
String find = codeConverter.userIdToUserName(compositeItemId[i]);
String find = codeConverter.uniqOtherCodeToValue(dtlCtgr,compositeItemId[i]);
if(!find.equals("")) {
itemName = find;
} else {
DataObject findRow = statMapper.selectUserById(compositeItemId[i]);
DataObject findRow = this.selectOtherCode(dtlCtgr, compositeItemId[i]);
if(findRow != null){
itemName = findRow.string("USER_NM");
codeConverter.putUser(findRow);
itemName = findRow.string("NAME");
codeConverter.putOtherCode(dtlCtgr, findRow);
}
}
}
@ -455,9 +422,6 @@ public class StatBean extends AbstractComponent {
}
compositeItemName[i] = itemName;
}
statItem.setItemName(compositeItemName);
@ -505,6 +469,30 @@ public class StatBean extends AbstractComponent {
}
public DataObject selectOtherCode(String type, String uniqId) {
DataObject result = null;
switch(type) {
case "SGG_CD" :
result = statMapper.selectSggByCode(uniqId);
break;
case "DEPT_CD" :
result = statMapper.selectDeptByCode(uniqId);
break;
case "VLTN_ID" :
result = statMapper.selectVltnById(uniqId);
break;
case "USER_ID" :
result = statMapper.selectUserById(uniqId);
break;
case "TEAM_ID" :
result = statMapper.selectTeamById(uniqId);
break;
}
return result;
}
/** .
* @param stat
* @return

@ -4,30 +4,37 @@
<select id="selectVltnById" parameterType="string" resultType="dataobject">
SELECT VLTN_ID
, VLTN_NM
, VLTN_NM AS NAME
FROM TB_VLTN_INFO
WHERE VLTN_ID = #{vltnId}
</select>
<select id="selectSggByCode" parameterType="string" resultType="dataobject">
SELECT SGG_CD
, SGG_NM
, SGG_NM AS NAME
FROM TB_SGG_INFO
WHERE SGG_CD = #{sggCd}
</select>
<select id="selectDeptByCode" parameterType="string" resultType="dataobject">
SELECT DEPT_CD
, DEPT_NM
, DEPT_NM AS NAME
FROM TB_DEPT_INFO
WHERE DEPT_CD = #{deptCd}
</select>
<select id="selectUserById" parameterType="string" resultType="dataobject">
SELECT USER_ID
, USER_NM
, USER_NM AS NAME
FROM TB_USER
WHERE USER_ID = #{userId}
</select>
<select id="selectTeamById" parameterType="string" resultType="dataobject">
SELECT TEAM_ID
, TEAM_NM AS NAME
FROM TB_TEAM_INFO
WHERE TEAM_ID = #{teamId}
</select>
</mapper>

@ -56,7 +56,7 @@
data-ref-col="TASK_SE_CD" data-ctgr-type="code" data-dtl-ctgr="FIM054"
>과태료</option>
<option value="crdnTeam"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr=""
data-ref-col="TEAM_ID" data-ctgr-type="otherCode" data-dtl-ctgr="TEAM_ID"
>단속조</option>
<option value="crdnPlc"
data-ref-col="CRDN_PLC" data-ctgr-type="" data-dtl-ctgr=""
@ -74,7 +74,7 @@
data-ref-col="CRDN_YMD" data-ctgr-type="date" data-dtl-ctgr="DAY_OF_WEEK"
>단속요일</option>
<option value="crdnHour"
data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH"
data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH"
>단속시간대</option>
<option value="crdnLine"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr=""
@ -89,8 +89,8 @@
data-ref-col="CRDN_ROAD_NM" data-ctgr-type="" data-dtl-ctgr=""
>도로명</option>
<option value="userId"
data-ref-col="USER_ID" data-ctgr-type="otherCode" data-dtl-ctgr="USER_ID"
>사용자</option>
data-ref-col="RGTR" data-ctgr-type="otherCode" data-dtl-ctgr="USER_ID"
>자료입력사용자</option>
<option value="crdnSttsCd"
data-ref-col="CRDN_STTS_CD" data-ctgr-type="code" data-dtl-ctgr="FIM010"
>처리상태</option>

@ -56,7 +56,7 @@
data-ref-col="TASK_SE_CD" data-ctgr-type="code" data-dtl-ctgr="FIM054"
>과태료</option>
<option value="crdnTeam"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr=""
data-ref-col="TEAM_ID" data-ctgr-type="otherCode" data-dtl-ctgr="TEAM_ID"
>단속조</option>
<option value="crdnPlc"
data-ref-col="CRDN_PLC" data-ctgr-type="" data-dtl-ctgr=""
@ -74,23 +74,14 @@
data-ref-col="CRDN_YMD" data-ctgr-type="date" data-dtl-ctgr="DAY_OF_WEEK"
>단속요일</option>
<option value="crdnHour"
data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH"
data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH"
>단속시간대</option>
<option value="crdnLine"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr=""
>단속노선</option>
<option value="vhrno"
data-ref-col="VHRNO" data-ctgr-type="" data-dtl-ctgr=""
>차량번호</option>
<option value="crdnStdgNm"
data-ref-col="CRDN_STDNG_NM" data-ctgr-type="" data-dtl-ctgr=""
>단속동</option>
<option value="crdnRoadNm"
data-ref-col="CRDN_ROAD_NM" data-ctgr-type="" data-dtl-ctgr=""
>도로명</option>
<option value="userId"
data-ref-col="USER_ID" data-ctgr-type="otherCode" data-dtl-ctgr="USER_ID"
>사용자</option>
<option value="crdnSttsCd"
data-ref-col="CRDN_STTS_CD" data-ctgr-type="code" data-dtl-ctgr="FIM010"
>처리상태</option>

Loading…
Cancel
Save