[BO] 임가현황 작업 중 (9)
This commit is contained in:
@@ -41,6 +41,7 @@ public class AdminDetailsService implements UserDetailsService {
|
||||
boolean accountDisabled = Optional.ofNullable(adminUser.getAccountDisabled()).orElse(false);
|
||||
|
||||
return new AdminUser(
|
||||
adminUser.getSeq(),
|
||||
adminUser.getId(),
|
||||
adminUser.getPassword(),
|
||||
adminUser.getRoles().stream().map(CoreRole::getId).findFirst().orElse(null),
|
||||
|
||||
@@ -7,10 +7,12 @@ import org.springframework.security.core.userdetails.User;
|
||||
|
||||
@Getter
|
||||
public class AdminUser extends User {
|
||||
private Long seq;
|
||||
private String roleId;
|
||||
private long remainPasswordDays;
|
||||
|
||||
public AdminUser(
|
||||
Long seq,
|
||||
String username,
|
||||
String password,
|
||||
String roleId,
|
||||
@@ -28,6 +30,7 @@ public class AdminUser extends User {
|
||||
credentialsNonExpired,
|
||||
accountNonLocked,
|
||||
authorities);
|
||||
this.seq = seq;
|
||||
this.roleId = roleId;
|
||||
this.remainPasswordDays = remainPasswordDays;
|
||||
}
|
||||
|
||||
@@ -33,4 +33,14 @@ public class AdminUtil {
|
||||
AdminUser user = (AdminUser) authentication.getPrincipal();
|
||||
return user.getRoleId().isEmpty() ? null : user.getRoleId();
|
||||
}
|
||||
|
||||
public static Long getLoginUserSeq() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication == null || !(authentication.getPrincipal() instanceof AdminUser)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AdminUser user = (AdminUser) authentication.getPrincipal();
|
||||
return user.getSeq();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferExpenseRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferIncomeRecords;
|
||||
import java.util.Collections;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecordsCmd;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.GetBankAutoTransferRecordsPortOut;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetBankAutoTransferRecordsDao implements GetBankAutoTransferRecordsPortOut {
|
||||
private final GetBankAutoTransferRecordsMapper mapper;
|
||||
|
||||
@Override
|
||||
public GetBankAutoTransferRecords operate(GetBankAutoTransferRecordsCmd cmd) {
|
||||
return new GetBankAutoTransferRecords(
|
||||
mapper.getBankAutoTransferIncomeRecords(cmd), // 수입
|
||||
mapper.getBankAutoTransferExpenseRecords(cmd)); // 지출
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferExpenseRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferIncomeRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecordsCmd;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetBankAutoTransferRecordsMapper {
|
||||
// 은행자동이체 수입
|
||||
List<GetBankAutoTransferIncomeRecords> getBankAutoTransferIncomeRecords(
|
||||
GetBankAutoTransferRecordsCmd cmd);
|
||||
// 은행자동이체 지출
|
||||
List<GetBankAutoTransferExpenseRecords> getBankAutoTransferExpenseRecords(
|
||||
GetBankAutoTransferRecordsCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.GetBankAutoTransferRecordsPortIn;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecordsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.web.model.GetAutoTransferRecordsReqVO;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.web.model.GetAutoTransferRecordsResVO;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class GetBankAutoTransferRecordsController {
|
||||
private final GetBankAutoTransferRecordsPortIn portIn;
|
||||
|
||||
@GetMapping(path = "/api/household/bankAutoTransfer")
|
||||
ResponseEntity<GetBankAutoTransferRecords> operate(GetAutoTransferRecordsReqVO reqVO) {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(portIn.operate(
|
||||
new GetBankAutoTransferRecordsCmd(reqVO.getHouseholdSeq(), reqVO.getRecordMonth())));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetAutoTransferRecordsReqVO {
|
||||
private Long householdSeq;
|
||||
private String recordMonth;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetAutoTransferRecordsResVO {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.ports;
|
||||
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecordsCmd;
|
||||
import java.util.List;
|
||||
|
||||
public interface GetBankAutoTransferRecordsPortIn {
|
||||
GetBankAutoTransferRecords operate(GetBankAutoTransferRecordsCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.ports;
|
||||
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecordsCmd;
|
||||
import java.util.List;
|
||||
|
||||
public interface GetBankAutoTransferRecordsPortOut {
|
||||
GetBankAutoTransferRecords operate(GetBankAutoTransferRecordsCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecords;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferRecordsCmd;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.GetBankAutoTransferRecordsPortIn;
|
||||
import app.module.admin.usecase.household.getBankAutoTransferRecords.ports.GetBankAutoTransferRecordsPortOut;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetBankAutoTransferRecordsService implements GetBankAutoTransferRecordsPortIn {
|
||||
private final GetBankAutoTransferRecordsPortOut portOut;
|
||||
|
||||
@Override
|
||||
public GetBankAutoTransferRecords operate(GetBankAutoTransferRecordsCmd cmd) {
|
||||
return portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetBankAutoTransferExpenseRecords {
|
||||
private Long id;
|
||||
private String categoryText;
|
||||
private String categorySelf;
|
||||
private String sourcePurpose;
|
||||
private Integer count;
|
||||
private String unitText;
|
||||
private Integer price;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetBankAutoTransferIncomeRecords {
|
||||
private Long id;
|
||||
private String cropText;
|
||||
private String categoryText;
|
||||
private String categorySelf;
|
||||
private String sourcePurpose;
|
||||
private Integer count;
|
||||
private String unitText;
|
||||
private Integer price;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetBankAutoTransferRecords {
|
||||
List<GetBankAutoTransferIncomeRecords> incomes;
|
||||
List<GetBankAutoTransferExpenseRecords> expenses;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetBankAutoTransferRecordsCmd {
|
||||
private Long householdSeq;
|
||||
private String recordMonth;
|
||||
}
|
||||
@@ -14,12 +14,12 @@ public class GetDailyExpenseRecords {
|
||||
private Long id;
|
||||
private String inputType;
|
||||
private Boolean isCredit;
|
||||
private String categoryCode;
|
||||
private String categorySelf;
|
||||
private String sourcePurpose;
|
||||
private BigDecimal quantity;
|
||||
private String unitCode;
|
||||
private String unitText;
|
||||
private String unitSelf;
|
||||
private String price;
|
||||
private String estimatedValue;
|
||||
private String updatedBy;
|
||||
|
||||
@@ -16,12 +16,12 @@ public class GetDailyIncomeRecords {
|
||||
private Boolean isCredit;
|
||||
private String cropCode;
|
||||
private String cropText;
|
||||
private String categoryCode;
|
||||
private String categorySelf;
|
||||
private String sourcePurpose;
|
||||
private BigDecimal quantity;
|
||||
private String unitCode;
|
||||
private String unitText;
|
||||
private String unitSelf;
|
||||
private String price;
|
||||
private String estimatedValue;
|
||||
private String updatedBy;
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.module.admin.usecase.household.getForestProductsStatus.adapters.pers
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.GetForestProductsStatusPortOut;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatus;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusResult;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -13,7 +14,13 @@ class GetForestProductsStatusDao implements GetForestProductsStatusPortOut {
|
||||
private final GetForestProductsStatusMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<GetForestProductsStatus> operate(GetForestProductsStatusCmd cmd) {
|
||||
return mapper.getForestProductsStatus(cmd);
|
||||
public GetForestProductsStatusResult operate(GetForestProductsStatusCmd cmd) {
|
||||
|
||||
// 임산물 등록 상태 조회
|
||||
String monthlyStatus = mapper.getMonthlyStatus(cmd);
|
||||
// 임산물 목록 조회
|
||||
List<GetForestProductsStatus> forestProducts = mapper.getForestProductsStatus(cmd);
|
||||
|
||||
return new GetForestProductsStatusResult(monthlyStatus, forestProducts);
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetForestProductsStatusMapper {
|
||||
String getMonthlyStatus(GetForestProductsStatusCmd cmd);
|
||||
List<GetForestProductsStatus> getForestProductsStatus(GetForestProductsStatusCmd cmd);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.module.admin.usecase.household.getForestProductsStatus.adapters.web;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.GetForestProductsStatusPortIn;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatus;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusResult;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -18,10 +19,10 @@ class GetForestProductsStatusController {
|
||||
private final GetForestProductsStatusPortIn portIn;
|
||||
|
||||
@GetMapping(path = "/api/household/forestProducts")
|
||||
ResponseEntity<List<GetForestProductsStatus>> operate(
|
||||
ResponseEntity<GetForestProductsStatusResult> operate(
|
||||
GetForestProductsStatusReqVO reqVO) {
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(portIn.operate(
|
||||
new GetForestProductsStatusCmd(reqVO.getHouseholdSeq(), reqVO.getMonth())));
|
||||
new GetForestProductsStatusCmd(reqVO.getHouseholdSeq(), reqVO.getRecordMonth())));
|
||||
}
|
||||
}
|
||||
@@ -11,5 +11,5 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductsStatusReqVO {
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private String recordMonth;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package app.module.admin.usecase.household.getForestProductsStatus.ports;
|
||||
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatus;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd;
|
||||
import java.util.List;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusResult;
|
||||
|
||||
public interface GetForestProductsStatusPortIn {
|
||||
List<GetForestProductsStatus> operate(GetForestProductsStatusCmd cmd);
|
||||
GetForestProductsStatusResult operate(GetForestProductsStatusCmd cmd);
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package app.module.admin.usecase.household.getForestProductsStatus.ports;
|
||||
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatus;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd;
|
||||
import java.util.List;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusResult;
|
||||
|
||||
public interface GetForestProductsStatusPortOut {
|
||||
List<GetForestProductsStatus> operate(GetForestProductsStatusCmd cmd);
|
||||
GetForestProductsStatusResult operate(GetForestProductsStatusCmd cmd);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
package app.module.admin.usecase.household.getForestProductsStatus.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatus;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.GetForestProductsStatusPortIn;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.GetForestProductsStatusPortOut;
|
||||
import java.util.List;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusCmd;
|
||||
import app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatusResult;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -14,7 +13,7 @@ class GetForestProductsStatusService implements GetForestProductsStatusPortIn {
|
||||
private final GetForestProductsStatusPortOut portOut;
|
||||
|
||||
@Override
|
||||
public List<GetForestProductsStatus> operate(GetForestProductsStatusCmd cmd) {
|
||||
public GetForestProductsStatusResult operate(GetForestProductsStatusCmd cmd) {
|
||||
return portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -11,5 +11,5 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductsStatusCmd {
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private String recordMonth;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductsStatusResult {
|
||||
private String monthlyStatus;
|
||||
private List<GetForestProductsStatus> forestProducts;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.persistence;
|
||||
|
||||
import java.util.Collections;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfos;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfosCmd;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.GetHouseholdVisitInfosPortOut;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetHouseholdVisitInfosDao implements GetHouseholdVisitInfosPortOut {
|
||||
private final GetHouseholdVisitInfosMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<GetHouseholdVisitInfos> operate(GetHouseholdVisitInfosCmd cmd) {
|
||||
return mapper.getHouseholdVisitInfos(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfos;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfosCmd;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetHouseholdVisitInfosMapper {
|
||||
List<GetHouseholdVisitInfos> getHouseholdVisitInfos(GetHouseholdVisitInfosCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.GetHouseholdVisitInfosPortIn;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfos;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfosCmd;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.web.model.GetHouseholdVisitInfosReqVO;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.web.model.GetHouseholdVisitInfosResVO;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class GetHouseholdVisitInfosController {
|
||||
private final GetHouseholdVisitInfosPortIn portIn;
|
||||
|
||||
@GetMapping(path = "/api/household/visitInfos")
|
||||
ResponseEntity<List<GetHouseholdVisitInfos>> operate(
|
||||
GetHouseholdVisitInfosReqVO reqVO) {
|
||||
return ResponseEntity.status(HttpStatus.OK).body(portIn.operate(
|
||||
new GetHouseholdVisitInfosCmd(reqVO.getHouseholdSeq(), reqVO.getRecordMonth())));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetHouseholdVisitInfosReqVO {
|
||||
private Long householdSeq;
|
||||
private String recordMonth;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetHouseholdVisitInfosResVO {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.ports;
|
||||
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfos;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfosCmd;
|
||||
import java.util.List;
|
||||
|
||||
public interface GetHouseholdVisitInfosPortIn {
|
||||
List<GetHouseholdVisitInfos> operate(GetHouseholdVisitInfosCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.ports;
|
||||
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfos;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfosCmd;
|
||||
import java.util.List;
|
||||
|
||||
public interface GetHouseholdVisitInfosPortOut {
|
||||
List<GetHouseholdVisitInfos> operate(GetHouseholdVisitInfosCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfos;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfosCmd;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.GetHouseholdVisitInfosPortIn;
|
||||
import app.module.admin.usecase.household.getHouseholdVisitInfos.ports.GetHouseholdVisitInfosPortOut;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetHouseholdVisitInfosService implements GetHouseholdVisitInfosPortIn {
|
||||
private final GetHouseholdVisitInfosPortOut portOut;
|
||||
|
||||
@Override
|
||||
public List<GetHouseholdVisitInfos> operate(GetHouseholdVisitInfosCmd cmd) {
|
||||
return portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetHouseholdVisitInfos {
|
||||
private Long id;
|
||||
private String visitDate;
|
||||
private String managementType;
|
||||
private String content;
|
||||
private Boolean isGiftSent;
|
||||
private String updatedBy;
|
||||
private String updatedAt;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetHouseholdVisitInfosCmd {
|
||||
private Long householdSeq;
|
||||
private String recordMonth;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.module.admin.usecase.household.getHouseholdsStatus.adapters.web;
|
||||
|
||||
import app.module.admin.config.application.util.AdminUtil;
|
||||
import app.module.admin.usecase.household.getHouseholdsStatus.ports.GetHouseholdsStatusPortIn;
|
||||
import app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatus;
|
||||
import app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatusCmd;
|
||||
@@ -42,6 +43,7 @@ class GetHouseholdsStatusController {
|
||||
reqVO.getResearcherField(),
|
||||
reqVO.getResearcherValue(),
|
||||
reqVO.getIsPanel(),
|
||||
AdminUtil.getLoginUserSeq(),
|
||||
reqVO.getUserRole(),
|
||||
reqVO.getUserRegionMainCode()
|
||||
))
|
||||
|
||||
@@ -11,7 +11,8 @@ import lombok.Setter;
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetHouseholdsStatus {
|
||||
private Integer householdSeq;
|
||||
private Long adminSeq;
|
||||
private Long householdSeq;
|
||||
private String householdNum;
|
||||
private String householdName;
|
||||
private String householdPhone;
|
||||
|
||||
@@ -40,6 +40,8 @@ public class GetHouseholdsStatusCmd {
|
||||
private String researcherValue;
|
||||
// 패널 유지 여부
|
||||
private Boolean isPanel;
|
||||
// 로그인한 유저 seq
|
||||
private Long adminSeq;
|
||||
// 로그인한 유저 역할
|
||||
private String userRole;
|
||||
// 로그인한 유저 실사 지역
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.household.getBankAutoTransferRecords.adapters.persistence.GetBankAutoTransferRecordsMapper">
|
||||
<select id="getBankAutoTransferIncomeRecords"
|
||||
resultType="app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferIncomeRecords">
|
||||
/* getBankAutoTransferIncomeRecords : 은행자동이체 (수입) 내역 목록 조회 */
|
||||
SELECT bat.id, /* 수입 id */
|
||||
ui_crop.code_text AS cropText, /* 재배형태 */
|
||||
ui_category.code_text AS categoryText, /* 수입의 종류 (코드명) */
|
||||
bat.transfer_category AS categorySelf, /* 수입의 종류 (텍스트입력) */
|
||||
bat.source_purpose AS sourcePurpose, /* 수입원 */
|
||||
bat.count, /* 수량 */
|
||||
ui_unit.code_text AS unitText, /* 단위 */
|
||||
bat.price /* 현금(원) */
|
||||
FROM bank_auto_transfer bat
|
||||
LEFT JOIN uicode ui_crop ON ui_crop.parent_id = 'code.record.crop' AND ui_crop.id = bat.crop_code
|
||||
LEFT JOIN uicode ui_unit ON ui_unit.parent_id = 'code.record.unit' AND ui_unit.id = bat.unit_code
|
||||
LEFT JOIN uicode ui_category ON ui_category.parent_id = 'code.bank.input' AND ui_category.id = bat.transfer_category_code
|
||||
WHERE bat.transfer_type = 'code.bank.input'
|
||||
AND bat.household_seq = #{householdSeq}
|
||||
AND bat.month = #{recordMonth}
|
||||
</select>
|
||||
|
||||
<select id="getBankAutoTransferExpenseRecords"
|
||||
resultType="app.module.admin.usecase.household.getBankAutoTransferRecords.ports.application.domain.GetBankAutoTransferExpenseRecords">
|
||||
/* getBankAutoTransferExpenseRecords : 은행자동이체 (지출) 내역 목록 조회 */
|
||||
SELECT bat.id, /* 지출 id */
|
||||
ui_category.code_text AS cropText, /* 지출의 종류 (코드명) */
|
||||
bat.transfer_category AS categorySelf, /* 지출의 종류 (텍스트입력) */
|
||||
bat.source_purpose AS sourcePurpose, /* 용도 */
|
||||
bat.count, /* 수량 */
|
||||
ui_unit.code_text AS unitText, /* 단위 */
|
||||
bat.price /* 현금(원) */
|
||||
FROM bank_auto_transfer bat
|
||||
LEFT JOIN uicode ui_unit ON ui_unit.parent_id = 'code.record.unit' AND ui_unit.id = bat.unit_code
|
||||
LEFT JOIN uicode ui_category ON ui_category.parent_id = 'code.bank.input' AND ui_category.id = bat.transfer_category_code
|
||||
WHERE bat.transfer_type = 'code.bank.output'
|
||||
AND bat.household_seq = #{householdSeq}
|
||||
AND bat.month = #{recordMonth}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -26,12 +26,12 @@
|
||||
di.is_credit, /* 외상판매여부 */
|
||||
di.crop_code, /* 재배형태 코드 */
|
||||
ui_crop.code_text AS crop_text, /* 재배형태 코드 텍스트 */
|
||||
di.category_code, /* 수입 종류 코드 */ -- TODO(ks) : 수입의 종류 코드형태 맞는지 체크할 것
|
||||
di.category_self, /* 수입 종류(직접입력) */
|
||||
di.source_purpose, /* 수입원(용도) */
|
||||
di.quantity, /* 수량 */
|
||||
di.unit_code, /* 단위 코드 */
|
||||
ui_unit.code_text AS unit_text, /* 단위 코드 텍스트 */
|
||||
di.unit_self, /* 단위(직접입력) */
|
||||
di.price, /* 현금 */
|
||||
di.estimated_value, /* 현물평가액 */
|
||||
di.updated_by, /* 최종수정자 */
|
||||
@@ -77,12 +77,12 @@
|
||||
SELECT de.id, /* 지출 id */
|
||||
de.input_type, /* 입력구분 */
|
||||
de.is_credit, /* 외상판매여부 */
|
||||
de.category_code, /* 재배형태 코드 */
|
||||
de.category_self, /* 지출 종류 코드 */
|
||||
de.source_purpose, /* 지출원(용도) */
|
||||
de.quantity, /* 수량 */
|
||||
de.unit_code, /* 단위 */
|
||||
ui_unit.code_text AS unit_text, /* 단위 코드 텍스트 */
|
||||
de.unit_self, /* 단위(직접입력) */
|
||||
de.price, /* 현금 */
|
||||
de.estimated_value, /* 현물평가액 */
|
||||
de.updated_by, /* 최종수정자 */
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.household.getForestProductsStatus.adapters.persistence.GetForestProductsStatusMapper">
|
||||
|
||||
<select id="getMonthlyStatus" resultType="java.lang.String">
|
||||
/* getMonthlyStatus : 임산물 현황 등록 상태 조회 */
|
||||
SELECT forest_product_status
|
||||
FROM monthly_input_status mis
|
||||
WHERE household_seq = #{householdSeq}
|
||||
AND month = #{recordMonth}
|
||||
AND is_deleted = false
|
||||
</select>
|
||||
|
||||
<select id="getForestProductsStatus"
|
||||
resultType="app.module.admin.usecase.household.getForestProductsStatus.ports.application.domain.GetForestProductsStatus">
|
||||
/* getForestProductsStatus : 임가 현황의 임산물 현황 목록 조회 */
|
||||
@@ -28,7 +38,7 @@
|
||||
LEFT JOIN uicode ui_sub_yield ON ui_sub_yield.parent_id = 'code.record.unit' AND ui_sub_yield.id = df.sub_yield_unit_code
|
||||
LEFT JOIN uicode ui_sub_sale ON ui_sub_sale.parent_id = 'code.record.unit' AND ui_sub_sale.id = df.sub_sale_unit_code
|
||||
WHERE df.household_seq = #{householdSeq}
|
||||
AND df.month = #{month}
|
||||
AND df.month = #{recordMonth}
|
||||
AND df.is_deleted = false
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.admin.usecase.household.getHouseholdVisitInfos.adapters.persistence.GetHouseholdVisitInfosMapper">
|
||||
<select id="getHouseholdVisitInfos"
|
||||
resultType="app.module.admin.usecase.household.getHouseholdVisitInfos.ports.application.domain.GetHouseholdVisitInfos">
|
||||
/* getHouseholdVisitInfos : 임가방문정보 리스트 조회 */
|
||||
SELECT hv.id,
|
||||
hv.visit_date,
|
||||
hv.management_type,
|
||||
hv.content,
|
||||
hv.is_gift_sent,
|
||||
hv.updated_by,
|
||||
TO_CHAR(hv.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
|
||||
FROM household_visit hv
|
||||
WHERE household_seq = #{householdSeq}
|
||||
AND TO_CHAR(visit_date, 'YYYYMM') = #{recordMonth}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -26,6 +26,7 @@
|
||||
COUNT(*) OVER () AS total
|
||||
FROM (
|
||||
SELECT
|
||||
r.admin_seq AS adminSeq,
|
||||
h.seq AS householdSeq,
|
||||
h.household_num AS householdNum,
|
||||
h.owner_name AS householdName,
|
||||
@@ -179,6 +180,11 @@
|
||||
</if>
|
||||
</where>
|
||||
|
||||
<if test="cmd.userRole != null and cmd.userRole == 'ROLE_RESEARCHER'">
|
||||
/* 조사원일 경우 매핑된 임가만 노출 */
|
||||
AND hvr.adminSeq = #{cmd.adminSeq}
|
||||
</if>
|
||||
|
||||
ORDER BY hvr.householdNum ASC
|
||||
OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY
|
||||
</select>
|
||||
|
||||
@@ -42,25 +42,28 @@ let uiUtil = {
|
||||
curPageNo = parseInt(curPageNo);
|
||||
const firstPage = 0;
|
||||
|
||||
const isFirstPage = curPageNo === 0;
|
||||
let frag1 =
|
||||
`
|
||||
<div class="row">
|
||||
<nav class="component-pagination" aria-label="Page navigation example">
|
||||
|
||||
<a href="#" class="page-link pagination-item first"
|
||||
<a href="#" class="page-link pagination-item first ${isFirstPage ? 'disabled' : ''}""
|
||||
aria-label="First" data-target-page="${firstPage}">
|
||||
<span class="hide-txt">첫 페이지로 이동</span>
|
||||
</a>
|
||||
|
||||
<a href="#" class="page-link pagination-item prev"
|
||||
<a href="#" class="page-link pagination-item prev ${isFirstPage ? 'disabled' : ''}""
|
||||
aria-label="Previous" data-target-page="${curPageNo === 0 ? null : curPageNo - 1}">
|
||||
<span class="hide-txt">이전 페이지로 이동</span>
|
||||
</a>
|
||||
`;
|
||||
|
||||
const pageSize = 10; // 보여줄 페이지 개수
|
||||
const safeTotalPages = totalPages > 0 ? totalPages : 1;
|
||||
|
||||
let startPage = Math.floor(curPageNo / pageSize) * pageSize; // 시작 페이지
|
||||
let endPage = Math.min(startPage + pageSize - 1, totalPages - 1); // 끝 페이지
|
||||
let endPage = Math.min(startPage + pageSize - 1, safeTotalPages - 1); // 끝 페이지
|
||||
|
||||
let frag2 = ``;
|
||||
for (let i = startPage; i <= endPage; i++) {
|
||||
@@ -75,13 +78,14 @@ let uiUtil = {
|
||||
}
|
||||
}
|
||||
|
||||
const isLastPage = curPageNo === totalPages - 1 || totalPages === 0;
|
||||
let frag3 =
|
||||
`
|
||||
<a href="#" class="page-link pagination-item next"
|
||||
<a href="#" class="page-link pagination-item next ${isLastPage ? 'disabled' : ''}""
|
||||
aria-label="Next" data-target-page="${curPageNo == totalPages - 1 || totalPages == 0 ? null : curPageNo + 1}">
|
||||
<span class="hide-txt">다음 페이지로 이동</span>
|
||||
</a>
|
||||
<a href="#" class="page-link pagination-item last"
|
||||
<a href="#" class="page-link pagination-item last ${isLastPage ? 'disabled' : ''}""
|
||||
aria-label="Last" data-target-page="${totalPages - 1}">
|
||||
<span class="hide-txt">마지막 페이지로 이동</span>
|
||||
</a>
|
||||
@@ -92,11 +96,18 @@ let uiUtil = {
|
||||
|
||||
let el = $(frag1 + frag2 + frag3);
|
||||
el.find('.page-link').on('click', (evt) => {
|
||||
let _this = evt.target;
|
||||
let targetPage = $(_this).data('target-page');
|
||||
const $link = $(evt.currentTarget);
|
||||
|
||||
if ($link.hasClass('disabled')) {
|
||||
evt.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
let targetPage = $link.data('target-page');
|
||||
if (targetPage.toString() === 'null') {
|
||||
return false;
|
||||
}
|
||||
|
||||
moveHandler(targetPage);
|
||||
});
|
||||
|
||||
@@ -446,4 +457,9 @@ const ifNullDash = (value, fallback = '-') => {
|
||||
return value !== null && value !== undefined && value !== '' ? value : fallback;
|
||||
}
|
||||
|
||||
const formatNumberWithComma = (value) => {
|
||||
if (value == null || isNaN(value)) return '-';
|
||||
return Number(value).toLocaleString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -475,13 +475,110 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" data-tab-value="tab3">
|
||||
<div class="tab-content bank-auto-transfer" data-tab-value="tab3">
|
||||
<div class="content-inner">
|
||||
<div class="content-inner">
|
||||
<!-- 수입 -->
|
||||
<section class="table-group">
|
||||
<div class="table-tit-group">
|
||||
<h3>수입 <strong>(<span id="bankIncomeCount">0</span>건)</strong></h3>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table-bank-income">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>선택</th>
|
||||
<th>재배형태</th>
|
||||
<th>수입의 종류</th>
|
||||
<th>대상</th>
|
||||
<th>수입원</th>
|
||||
<th>수량</th>
|
||||
<th>단위</th>
|
||||
<th>현금(원)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<!-- 지출 -->
|
||||
<section class="table-group">
|
||||
<div class="table-tit-group">
|
||||
<h3>지출 <strong>(<span id="bankExpenseCount">0</span>건)</strong></h3>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table-bank-expense">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>선택</th>
|
||||
<th>지출의 종류</th>
|
||||
<th>용도</th>
|
||||
<th>수량</th>
|
||||
<th>단위</th>
|
||||
<th>현금(원)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" data-tab-value="tab4">
|
||||
<div class="tab-content household-visit" data-tab-value="tab4">
|
||||
<div class="content-inner">
|
||||
<section class="table-group">
|
||||
<div class="table-tit-group">
|
||||
<h3></h3>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="household-visit">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>선택</th>
|
||||
<th>방문일</th>
|
||||
<th>관리분야</th>
|
||||
<th>내용</th>
|
||||
<th>최종 수정자</th>
|
||||
<th>답례품 전달</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -530,6 +627,12 @@
|
||||
className: 'gray'
|
||||
}
|
||||
};
|
||||
|
||||
const managementType = {
|
||||
VISIT: "방문조사",
|
||||
CALL: "전화상담",
|
||||
ETC: "기타"
|
||||
};
|
||||
</script>
|
||||
|
||||
<script>
|
||||
@@ -563,11 +666,11 @@
|
||||
break;
|
||||
case 'bank-auto-transfer': // 은행자동이체내역
|
||||
console.log("은행자동이체내역");
|
||||
// getAutoTransferStatus();
|
||||
getBankAutoTransfer();
|
||||
break;
|
||||
case 'household-visit': // 임가방문정보
|
||||
console.log("임가방문정보");
|
||||
// getVisitStatus();
|
||||
getVisitInfo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -649,7 +752,7 @@
|
||||
'/api/household/dailyRecordStatus',
|
||||
{ recordSeq: id },
|
||||
function(response) { // 성공
|
||||
console.log("일계부 등록 상세 데이터~ : ", response);
|
||||
console.log("일계부 등록 상세 데이터 : ", response);
|
||||
gridIncomeTable(response.status.incomeStatus, response.incomes);
|
||||
gridWorkTable(response.status.workStatus, response.works);
|
||||
gridExpenseTable(response.status.expenseStatus, response.expenses);
|
||||
@@ -672,7 +775,7 @@
|
||||
|
||||
$('#incomeCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, status, 10);
|
||||
noDataDaily(tbody, status, 10);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -690,13 +793,12 @@
|
||||
</td>
|
||||
<td>${item.isCredit ? "Y" : "N"}</td> <!-- 외상판매 -->
|
||||
<td>${ifNullDash(item.cropText)}</td><!-- 재배형태 -->
|
||||
<!-- TODO(ks) : 수입의 종류 코드형태로 들어오고 있음, 텍스트형태로 바뀌는 건지 체크!! -->
|
||||
<td class="underline">${ifNullDash(item.categorySelf)}</td><!-- 수입의 종류 -->
|
||||
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 수입원 -->
|
||||
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${ifNullDash(item.price)}</td><!-- 현금(원) -->
|
||||
<td class="align-right">${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td>${item.unitSelf != null && item.unitSelf !== '' ? item.unitSelf : ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
|
||||
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td>
|
||||
${item.updatedBy}<br>
|
||||
(${item.updatedAt})
|
||||
@@ -715,7 +817,7 @@
|
||||
|
||||
$('#workCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, status, 18);
|
||||
noDataDaily(tbody, status, 18);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -764,7 +866,7 @@
|
||||
|
||||
$('#expenseCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, status, 9);
|
||||
noDataDaily(tbody, status, 9);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -781,13 +883,12 @@
|
||||
</div>
|
||||
</td>
|
||||
<td>${item.isCredit ? "Y" : "N"}</td> <!-- 외상 또는 카드구입 -->
|
||||
<!-- TODO(ks) : 지출의 종류 코드형태로 들어오고 있음, 텍스트형태로 바뀌는 건지 체크!! -->
|
||||
<td class="underline">${ifNullDash(item.categorySelf)}</td><!-- 지출의 종류 -->
|
||||
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 용도 -->
|
||||
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${ifNullDash(item.price)}</td><!-- 현금(원) -->
|
||||
<td class="align-right">${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td>${item.unitSelf != null && item.unitSelf !== '' ? item.unitSelf : ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
|
||||
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td>
|
||||
${item.updatedBy}<br>
|
||||
(${item.updatedAt})
|
||||
@@ -806,7 +907,7 @@
|
||||
|
||||
$('#powerCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, status, 5);
|
||||
noDataDaily(tbody, status, 5);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -843,7 +944,7 @@
|
||||
|
||||
$('#forestryCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, status, 7);
|
||||
noDataDaily(tbody, status, 7);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -863,7 +964,7 @@
|
||||
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
|
||||
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td>
|
||||
${item.updatedBy}<br>
|
||||
(${item.updatedAt})
|
||||
@@ -882,7 +983,7 @@
|
||||
|
||||
$('#farmingCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, status, 7);
|
||||
noDataDaily(tbody, status, 7);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -902,7 +1003,7 @@
|
||||
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
|
||||
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||
<td>
|
||||
${item.updatedBy}<br>
|
||||
(${item.updatedAt})
|
||||
@@ -916,6 +1017,7 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 임산물 현황 탭 조회
|
||||
const getForestProductsStatus = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
@@ -923,16 +1025,21 @@
|
||||
'/api/household/forestProducts',
|
||||
{
|
||||
householdSeq: f.householdSeq.value,
|
||||
month: f.recordMonth.value
|
||||
recordMonth: f.recordMonth.value
|
||||
},
|
||||
function(response) { // 성공
|
||||
(response) => { // 성공
|
||||
console.log("임산물 현황 리스트 조회 : ", response);
|
||||
const tbody = $('.tab-content.forest-product').find('tbody');
|
||||
const tbody = $('.tab-content.forest-product tbody');
|
||||
|
||||
tbody.empty();
|
||||
|
||||
if(response.forestProducts.length === 0) {
|
||||
noDataMonthly(tbody, response.status, 15);
|
||||
return;
|
||||
}
|
||||
|
||||
let tmpl = '';
|
||||
$(response).each((idx, item) => {
|
||||
$(response.forestProducts).each((idx, item) => {
|
||||
tmpl +=
|
||||
`
|
||||
<tr>
|
||||
@@ -973,12 +1080,172 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// nodata 처리
|
||||
const noData = (target, status, length) => {
|
||||
// 임가 방문정보 조회
|
||||
const getVisitInfo = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/household/visitInfos',
|
||||
{
|
||||
householdSeq: f.householdSeq.value,
|
||||
recordMonth: f.recordMonth.value
|
||||
},
|
||||
(response) => { // 성공
|
||||
console.log("임가 방문정보 조회 : ", response);
|
||||
const tbody = $('.tab-content.household-visit tbody');
|
||||
|
||||
tbody.empty();
|
||||
|
||||
if(response.length === 0) {
|
||||
tbody.append(`<tr><td colspan="6" style="text-align: center;">등록된 내용이 없습니다.</td></tr>`);
|
||||
return;
|
||||
}
|
||||
|
||||
let tmpl = '';
|
||||
$(response).each((idx, item) => {
|
||||
tmpl +=
|
||||
`
|
||||
<tr>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="temp_checkbox_000${item.id}" name="temp_checkbox_000${item.id}" value="${item.id}">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>${ifNullDash(item.visitDate)}</td> <!-- 방문일 -->
|
||||
<td>${ifNullDash(managementType[item.managementType])}</td> <!-- 관리분야 -->
|
||||
<td>${ifNullDash(item.content)}</td> <!-- 내용 -->
|
||||
<td>
|
||||
${item.updatedBy}<br>
|
||||
(${item.updatedAt})
|
||||
</td><!-- 최종 수정자 -->
|
||||
<td>${item.isGiftSent ? "전달 완료" : "미전달"}</td> <!-- 답례품 전달 -->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
},
|
||||
function (code, rstData) { // 실패
|
||||
console.log("error : ", code);
|
||||
},
|
||||
'get',
|
||||
'json'
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 은행자동이체내역 조회
|
||||
const getBankAutoTransfer = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/household/bankAutoTransfer',
|
||||
{
|
||||
householdSeq: f.householdSeq.value,
|
||||
recordMonth: f.recordMonth.value
|
||||
},
|
||||
(response) => { // 성공
|
||||
console.log("은행자동이체내역 조회 : ", response);
|
||||
gridBankIncomeTable(response.incomes);
|
||||
gridBankExpenseTable(response.expenses);
|
||||
},
|
||||
function (code, rstData) { // 실패
|
||||
console.log("error : ", code);
|
||||
},
|
||||
'get',
|
||||
'json'
|
||||
);
|
||||
}
|
||||
|
||||
const gridBankIncomeTable = (data) => {
|
||||
const tbody = $('#table-bank-income tbody');
|
||||
tbody.empty();
|
||||
|
||||
$('#bankIncomeCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
tbody.append(`<tr><td colspan="8" style="text-align: center;">등록된 내용이 없습니다.</td></tr>`);
|
||||
return;
|
||||
}
|
||||
|
||||
let tmpl = '';
|
||||
$(data).each((idx, item) => {
|
||||
tmpl +=
|
||||
`
|
||||
<tr>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="temp_checkbox_000${item.id}" name="temp_checkbox_000${item.id}" value="${item.id}">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>${ifNullDash(item.cropText)}</td> <!-- 재배형태 -->
|
||||
<td class="underline">${ifNullDash(item.categoryText)}</td> <!-- 수입의 종류 -->
|
||||
<td>${ifNullDash(item.categorySelf)}</td><!-- 대상 -->
|
||||
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 수입원 -->
|
||||
<td>${ifNullDash(item.count)}</td><!-- 수량 -->
|
||||
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
|
||||
const gridBankExpenseTable = (data) => {
|
||||
const tbody = $('#table-bank-expense tbody');
|
||||
tbody.empty();
|
||||
|
||||
$('#bankExpenseCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
tbody.append(`<tr><td colspan="6" style="text-align: center;">등록된 내용이 없습니다.</td></tr>`);
|
||||
return;
|
||||
}
|
||||
|
||||
let tmpl = '';
|
||||
$(data).each((idx, item) => {
|
||||
tmpl +=
|
||||
`
|
||||
<tr>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="temp_checkbox_000${item.id}" name="temp_checkbox_000${item.id}" value="${item.id}">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td class="underline">${item.categorySelf != null && item.categorySelf !== '' ?
|
||||
item.categorySelf : ifNullDash(item.categoryText)}</td> <!-- 지출의 종류 -->
|
||||
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 용도 -->
|
||||
<td>${ifNullDash(item.count)}</td><!-- 수량 -->
|
||||
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 일계부 등록 현황 nodata 처리
|
||||
const noDataDaily = (target, status, length) => {
|
||||
const noDataText = status === 'TARGET' ? '등록이 필요합니다.' : '등록없음';
|
||||
|
||||
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">${noDataText}</td></tr>`);
|
||||
}
|
||||
|
||||
// 임산물 현황 noData 처리
|
||||
const noDataMonthly = (target, status, length) => {
|
||||
const noDataText = status === 'NOTHING' ? '등록없음' : '등록이 필요합니다.';
|
||||
|
||||
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">${noDataText}</td></tr>`);
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ DROP TABLE IF EXISTS notice_has_upload_file;
|
||||
DROP TABLE IF EXISTS notice;
|
||||
|
||||
-- 조사원(관리자) 연관 테이블
|
||||
DROP TABLE IF EXISTS researcher_household_visit;
|
||||
DROP TABLE IF EXISTS researcher_has_household;
|
||||
DROP TABLE IF EXISTS researcher_has_area;
|
||||
DROP TABLE IF EXISTS research_area;
|
||||
@@ -64,6 +63,7 @@ DROP TABLE IF EXISTS front_user;
|
||||
-- household
|
||||
DROP TABLE IF EXISTS household_has_role;
|
||||
DROP TABLE IF EXISTS household;
|
||||
DROP TABLE IF EXISTS household_visit;
|
||||
|
||||
-- article
|
||||
DROP TABLE IF EXISTS article_has_upload_file;
|
||||
@@ -90,7 +90,6 @@ DROP SEQUENCE IF EXISTS address_seq;
|
||||
DROP SEQUENCE IF EXISTS input_day_group_seq;
|
||||
DROP SEQUENCE IF EXISTS operation_log_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS researcher_household_visit_seq;
|
||||
DROP SEQUENCE IF EXISTS researcher_has_household_seq;
|
||||
DROP SEQUENCE IF EXISTS researcher_has_area_seq;
|
||||
DROP SEQUENCE IF EXISTS research_area_seq;
|
||||
@@ -119,6 +118,7 @@ DROP SEQUENCE IF EXISTS front_user_social_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS household_seq;
|
||||
DROP SEQUENCE IF EXISTS household_has_role_seq;
|
||||
DROP SEQUENCE IF EXISTS household_visit_seq;
|
||||
|
||||
DROP SEQUENCE IF EXISTS article_seq;
|
||||
DROP SEQUENCE IF EXISTS article_comment_seq;
|
||||
|
||||
@@ -1008,48 +1008,47 @@ COMMENT ON COLUMN researcher_has_household.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN researcher_has_household.is_deleted IS '삭제여부';
|
||||
|
||||
|
||||
-- 3. researcher_household_visit
|
||||
-- 3. household_visit
|
||||
-- ============================================
|
||||
-- TABLE : researcher_household_visit
|
||||
-- DESC : 조사원 임가 방문 정보 테이블
|
||||
-- TABLE : household_visit
|
||||
-- DESC : 임가 방문 정보 테이블
|
||||
-- ============================================
|
||||
CREATE SEQUENCE researcher_household_visit_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
CREATE SEQUENCE household_visit_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
||||
|
||||
CREATE TABLE researcher_household_visit (
|
||||
id bigint DEFAULT nextval('researcher_household_visit_seq') NOT NULL, -- 조사원임가방문정보 ID (PK)
|
||||
admin_seq bigint NOT NULL, -- 관리자 일련번호 (조사원)
|
||||
household_seq bigint NOT NULL, -- 임가 일련번호
|
||||
is_gift_sent boolean, -- 답례품 전달 여부
|
||||
memo varchar(255), -- 메모
|
||||
visit_date date, -- 방문 날짜(yyyy-mm-dd)
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제 여부
|
||||
CREATE TABLE household_visit (
|
||||
id bigint DEFAULT nextval('household_visit_seq') NOT NULL, -- 조사원임가방문정보 ID (PK)
|
||||
household_seq bigint NOT NULL, -- 임가 일련번호
|
||||
management_type varchar(20) NOT NULL, -- 관리분야 (VISIT, CALL, ETC)
|
||||
is_gift_sent boolean, -- 답례품 전달 여부
|
||||
content varchar(255), -- 메모
|
||||
visit_date date, -- 방문 날짜(yyyy-mm-dd)
|
||||
created_at timestamp(6), -- 생성일
|
||||
created_by varchar(255), -- 생성자
|
||||
updated_at timestamp(6), -- 수정일
|
||||
updated_by varchar(255), -- 수정자
|
||||
deleted_at timestamp(6), -- 삭제일
|
||||
deleted_by varchar(255), -- 삭제자
|
||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제 여부
|
||||
|
||||
CONSTRAINT researcher_household_visit_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_researcher_household_visit__admin FOREIGN KEY (admin_seq) REFERENCES admin(seq),
|
||||
CONSTRAINT fk_researcher_household_visit__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
CONSTRAINT household_visit_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_household_visit__household FOREIGN KEY (household_seq) REFERENCES household(seq)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE researcher_household_visit IS '조사원 임가 방문 정보 테이블';
|
||||
COMMENT ON TABLE household_visit IS '조사원 임가 방문 정보 테이블';
|
||||
|
||||
COMMENT ON COLUMN researcher_household_visit.id IS '조사원임가방문정보 ID';
|
||||
COMMENT ON COLUMN researcher_household_visit.admin_seq IS '관리자 일련번호(조사원)';
|
||||
COMMENT ON COLUMN researcher_household_visit.household_seq IS '임가 일련번호';
|
||||
COMMENT ON COLUMN researcher_household_visit.is_gift_sent IS '답례품 전달 여부';
|
||||
COMMENT ON COLUMN researcher_household_visit.memo IS '메모';
|
||||
COMMENT ON COLUMN researcher_household_visit.visit_date IS '방문날짜(yyyy-mm-dd)';
|
||||
COMMENT ON COLUMN researcher_household_visit.created_at IS '생성일';
|
||||
COMMENT ON COLUMN researcher_household_visit.created_by IS '생성자';
|
||||
COMMENT ON COLUMN researcher_household_visit.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN researcher_household_visit.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN researcher_household_visit.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN researcher_household_visit.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN researcher_household_visit.is_deleted IS '삭제여부';
|
||||
COMMENT ON COLUMN household_visit.id IS '조사원임가방문정보 ID';
|
||||
COMMENT ON COLUMN household_visit.household_seq IS '임가 일련번호';
|
||||
COMMENT ON COLUMN household_visit.management_type IS '관리분야 (VISIT, CALL, ETC)';
|
||||
COMMENT ON COLUMN household_visit.is_gift_sent IS '답례품 전달 여부';
|
||||
COMMENT ON COLUMN household_visit.content IS '내용';
|
||||
COMMENT ON COLUMN household_visit.visit_date IS '방문날짜(yyyy-mm-dd)';
|
||||
COMMENT ON COLUMN household_visit.created_at IS '생성일';
|
||||
COMMENT ON COLUMN household_visit.created_by IS '생성자';
|
||||
COMMENT ON COLUMN household_visit.updated_at IS '수정일';
|
||||
COMMENT ON COLUMN household_visit.updated_by IS '수정자';
|
||||
COMMENT ON COLUMN household_visit.deleted_at IS '삭제일';
|
||||
COMMENT ON COLUMN household_visit.deleted_by IS '삭제자';
|
||||
COMMENT ON COLUMN household_visit.is_deleted IS '삭제여부';
|
||||
|
||||
-- 조사원 연관 테이블 종료
|
||||
|
||||
|
||||
@@ -74,9 +74,10 @@ GROUP BY rhh.household_seq;
|
||||
-- ============================================
|
||||
CREATE VIEW v_household_researcher AS
|
||||
SELECT
|
||||
rhh.household_seq,
|
||||
a.name AS researcher_name,
|
||||
a.phone AS researcher_phone
|
||||
a.seq AS admin_seq,
|
||||
rhh.household_seq AS household_seq,
|
||||
a.name AS researcher_name,
|
||||
a.phone AS researcher_phone
|
||||
FROM researcher_has_household rhh
|
||||
JOIN admin a ON rhh.admin_seq = a.seq
|
||||
WHERE rhh.is_deleted = false;
|
||||
Reference in New Issue
Block a user