[BO] 임가 현황 - 임가 상세 작업 중 (6)
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.adapters.persistence;
|
|
||||||
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyExpenseRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyForestryRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyIncomeRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyPowerRecords;
|
|
||||||
import java.util.List;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatus;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatusCmd;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.GetDailyRecordStatusPortOut;
|
|
||||||
import java.util.Optional;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
class GetDailyRecordStatusDao implements GetDailyRecordStatusPortOut {
|
|
||||||
private final GetDailyRecordStatusMapper mapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<GetDailyRecordStatus> operate(GetDailyRecordStatusCmd cmd) {
|
|
||||||
|
|
||||||
List<GetDailyIncomeRecords> incomes = mapper.getDailyIncomeRecords(cmd);
|
|
||||||
List<GetDailyExpenseRecords> expenses = mapper.getDailyExpenseRecords(cmd);
|
|
||||||
List<GetDailyPowerRecords> powers = mapper.getDailyPowerRecords(cmd);
|
|
||||||
List<GetDailyForestryRecords> forestries = mapper.getDailyForestryRecords(cmd);
|
|
||||||
|
|
||||||
return Optional.of(new GetDailyRecordStatus(incomes, expenses, powers, forestries));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.adapters.persistence;
|
|
||||||
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyExpenseRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyForestryRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyIncomeRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyPowerRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatusCmd;
|
|
||||||
import java.util.List;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface GetDailyRecordStatusMapper {
|
|
||||||
List<GetDailyIncomeRecords> getDailyIncomeRecords(GetDailyRecordStatusCmd cmd);
|
|
||||||
List<GetDailyExpenseRecords> getDailyExpenseRecords(GetDailyRecordStatusCmd cmd);
|
|
||||||
List<GetDailyPowerRecords> getDailyPowerRecords(GetDailyRecordStatusCmd cmd);
|
|
||||||
List<GetDailyForestryRecords> getDailyForestryRecords(GetDailyRecordStatusCmd cmd);
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.adapters.web;
|
|
||||||
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.adapters.web.model.GetDailyRecordStatusReqVO;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.GetDailyRecordStatusPortIn;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatus;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatusCmd;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
class GetDailyRecordStatusController {
|
|
||||||
private final GetDailyRecordStatusPortIn portIn;
|
|
||||||
|
|
||||||
@GetMapping(path = "/api/household/dailyRecordStatus")
|
|
||||||
ResponseEntity<GetDailyRecordStatus> operate(
|
|
||||||
GetDailyRecordStatusReqVO reqVO) {
|
|
||||||
|
|
||||||
GetDailyRecordStatus recordView =
|
|
||||||
portIn.operate(new GetDailyRecordStatusCmd(reqVO.getHouseholdSeq(), reqVO.getRecordSeq(),
|
|
||||||
reqVO.getRecordMonth())).orElse(null);
|
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(recordView);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.adapters.web.model;
|
|
||||||
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyExpenseRecords;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyIncomeRecords;
|
|
||||||
import java.util.List;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode
|
|
||||||
public class GetDailyRecordStatusResVO {
|
|
||||||
List<GetDailyIncomeRecords> incomes; // 수입
|
|
||||||
List<GetDailyExpenseRecords> expenses; // 지출
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatus;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatusCmd;
|
|
||||||
|
|
||||||
public interface GetDailyRecordStatusPortIn {
|
|
||||||
Optional<GetDailyRecordStatus> operate(GetDailyRecordStatusCmd cmd);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatus;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatusCmd;
|
|
||||||
|
|
||||||
public interface GetDailyRecordStatusPortOut {
|
|
||||||
Optional<GetDailyRecordStatus> operate(GetDailyRecordStatusCmd cmd);
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports.application;
|
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatus;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyRecordStatusCmd;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.GetDailyRecordStatusPortIn;
|
|
||||||
import app.module.admin.usecase.household.getDailyRecordStatus.ports.GetDailyRecordStatusPortOut;
|
|
||||||
import java.util.Optional;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
class GetDailyRecordStatusService implements GetDailyRecordStatusPortIn {
|
|
||||||
private final GetDailyRecordStatusPortOut portOut;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<GetDailyRecordStatus> operate(GetDailyRecordStatusCmd cmd) {
|
|
||||||
return portOut.operate(cmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyExpenseRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyFarmingRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyForestryRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyIncomeRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyPowerRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatus;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyWorkRecords;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusDetail;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusCmd;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.GetDailyRecordStatusDetailPortOut;
|
||||||
|
import java.util.Optional;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
class GetDailyRecordStatusDetailDao implements GetDailyRecordStatusDetailPortOut {
|
||||||
|
private final GetDailyRecordStatusDetailMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<GetDailyRecordStatusDetail> operate(GetDailyRecordStatusCmd cmd) {
|
||||||
|
|
||||||
|
GetDailyRecordStatus status = mapper.getDailyRecordStatus(cmd);
|
||||||
|
List<GetDailyIncomeRecords> incomes = mapper.getDailyIncomeRecords(cmd);
|
||||||
|
List<GetDailyWorkRecords> works = mapper.getDailyWorkRecords(cmd);
|
||||||
|
List<GetDailyExpenseRecords> expenses = mapper.getDailyExpenseRecords(cmd);
|
||||||
|
List<GetDailyPowerRecords> powers = mapper.getDailyPowerRecords(cmd);
|
||||||
|
List<GetDailyForestryRecords> forestries = mapper.getDailyForestryRecords(cmd);
|
||||||
|
List<GetDailyFarmingRecords> farmings = mapper.getDailyFarmingRecords(cmd);
|
||||||
|
|
||||||
|
return Optional.of(
|
||||||
|
new GetDailyRecordStatusDetail(status, incomes, works, expenses, powers, forestries,
|
||||||
|
farmings));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyExpenseRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyFarmingRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyForestryRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyIncomeRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyPowerRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusCmd;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatus;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyWorkRecords;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface GetDailyRecordStatusDetailMapper {
|
||||||
|
GetDailyRecordStatus getDailyRecordStatus(GetDailyRecordStatusCmd cmd);
|
||||||
|
List<GetDailyIncomeRecords> getDailyIncomeRecords(GetDailyRecordStatusCmd cmd);
|
||||||
|
List<GetDailyWorkRecords> getDailyWorkRecords(GetDailyRecordStatusCmd cmd);
|
||||||
|
List<GetDailyExpenseRecords> getDailyExpenseRecords(GetDailyRecordStatusCmd cmd);
|
||||||
|
List<GetDailyPowerRecords> getDailyPowerRecords(GetDailyRecordStatusCmd cmd);
|
||||||
|
List<GetDailyForestryRecords> getDailyForestryRecords(GetDailyRecordStatusCmd cmd);
|
||||||
|
List<GetDailyFarmingRecords> getDailyFarmingRecords(GetDailyRecordStatusCmd cmd);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.adapters.web;
|
||||||
|
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.adapters.web.model.GetDailyRecordStatusDetailReqVO;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.GetDailyRecordStatusDetailPortIn;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusDetail;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusCmd;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
class GetDailyRecordStatusDetailController {
|
||||||
|
private final GetDailyRecordStatusDetailPortIn portIn;
|
||||||
|
|
||||||
|
@GetMapping(path = "/api/household/dailyRecordStatus")
|
||||||
|
ResponseEntity<GetDailyRecordStatusDetail> operate(
|
||||||
|
GetDailyRecordStatusDetailReqVO reqVO) {
|
||||||
|
|
||||||
|
GetDailyRecordStatusDetail recordView =
|
||||||
|
portIn.operate(new GetDailyRecordStatusCmd(reqVO.getRecordSeq())).orElse(null);
|
||||||
|
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(recordView);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.adapters.web.model;
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.adapters.web.model;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -9,8 +9,6 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
public class GetDailyRecordStatusReqVO {
|
public class GetDailyRecordStatusDetailReqVO {
|
||||||
private Long householdSeq;
|
|
||||||
private Long recordSeq;
|
private Long recordSeq;
|
||||||
private String recordMonth;
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.adapters.web.model;
|
||||||
|
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyExpenseRecords;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyIncomeRecords;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class GetDailyRecordStatusDetailResVO {
|
||||||
|
List<GetDailyIncomeRecords> incomes; // 수입
|
||||||
|
List<GetDailyExpenseRecords> expenses; // 지출
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusDetail;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusCmd;
|
||||||
|
|
||||||
|
public interface GetDailyRecordStatusDetailPortIn {
|
||||||
|
Optional<GetDailyRecordStatusDetail> operate(GetDailyRecordStatusCmd cmd);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusDetail;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusCmd;
|
||||||
|
|
||||||
|
public interface GetDailyRecordStatusDetailPortOut {
|
||||||
|
Optional<GetDailyRecordStatusDetail> operate(GetDailyRecordStatusCmd cmd);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusDetail;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatusCmd;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.GetDailyRecordStatusDetailPortIn;
|
||||||
|
import app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.GetDailyRecordStatusDetailPortOut;
|
||||||
|
import java.util.Optional;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
class GetDailyRecordStatusDetailService implements GetDailyRecordStatusDetailPortIn {
|
||||||
|
private final GetDailyRecordStatusDetailPortOut portOut;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<GetDailyRecordStatusDetail> operate(GetDailyRecordStatusCmd cmd) {
|
||||||
|
return portOut.operate(cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain;
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -19,6 +19,7 @@ public class GetDailyExpenseRecords {
|
|||||||
private String sourcePurpose;
|
private String sourcePurpose;
|
||||||
private BigDecimal quantity;
|
private BigDecimal quantity;
|
||||||
private String unitCode;
|
private String unitCode;
|
||||||
|
private String unitText;
|
||||||
private String price;
|
private String price;
|
||||||
private String estimatedValue;
|
private String estimatedValue;
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class GetDailyFarmingRecords {
|
||||||
|
private Long id;
|
||||||
|
private String productName;
|
||||||
|
private String usage;
|
||||||
|
private BigDecimal quantity;
|
||||||
|
private String unitCode;
|
||||||
|
private String unitText;
|
||||||
|
private String estimatedValue;
|
||||||
|
private String updatedBy;
|
||||||
|
private String updatedAt;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain;
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -15,6 +15,8 @@ public class GetDailyForestryRecords {
|
|||||||
private String productName;
|
private String productName;
|
||||||
private String usage;
|
private String usage;
|
||||||
private BigDecimal quantity;
|
private BigDecimal quantity;
|
||||||
|
private String unitCode;
|
||||||
|
private String unitText;
|
||||||
private String estimatedValue;
|
private String estimatedValue;
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
private String updatedAt;
|
private String updatedAt;
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain;
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.joda.time.DateTime;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -17,11 +15,13 @@ public class GetDailyIncomeRecords {
|
|||||||
private String inputType;
|
private String inputType;
|
||||||
private Boolean isCredit;
|
private Boolean isCredit;
|
||||||
private String cropCode;
|
private String cropCode;
|
||||||
|
private String cropText;
|
||||||
private String categoryCode;
|
private String categoryCode;
|
||||||
private String categorySelf;
|
private String categorySelf;
|
||||||
private String sourcePurpose;
|
private String sourcePurpose;
|
||||||
private BigDecimal quantity;
|
private BigDecimal quantity;
|
||||||
private String unitCode;
|
private String unitCode;
|
||||||
|
private String unitText;
|
||||||
private String price;
|
private String price;
|
||||||
private String estimatedValue;
|
private String estimatedValue;
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain;
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -13,6 +12,7 @@ import lombok.Setter;
|
|||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
public class GetDailyPowerRecords {
|
public class GetDailyPowerRecords {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private String powerStatus;
|
||||||
private String equipmentName;
|
private String equipmentName;
|
||||||
private BigDecimal ownedHours;
|
private BigDecimal ownedHours;
|
||||||
private BigDecimal leasedHours;
|
private BigDecimal leasedHours;
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class GetDailyRecordStatus {
|
||||||
|
private String incomeStatus;
|
||||||
|
private String workStatus;
|
||||||
|
private String expenseStatus;
|
||||||
|
private String powerStatus;
|
||||||
|
private String forestryStatus;
|
||||||
|
private String farmingStatus;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain;
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -10,7 +10,5 @@ import lombok.Setter;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
public class GetDailyRecordStatusCmd {
|
public class GetDailyRecordStatusCmd {
|
||||||
private Long householdSeq;
|
|
||||||
private Long recordSeq;
|
private Long recordSeq;
|
||||||
private String recordMonth;
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain;
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -10,9 +10,12 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
public class GetDailyRecordStatus {
|
public class GetDailyRecordStatusDetail {
|
||||||
|
GetDailyRecordStatus status;
|
||||||
List<GetDailyIncomeRecords> incomes; // 수입
|
List<GetDailyIncomeRecords> incomes; // 수입
|
||||||
|
List<GetDailyWorkRecords> works; // 임업노동
|
||||||
List<GetDailyExpenseRecords> expenses; // 지출
|
List<GetDailyExpenseRecords> expenses; // 지출
|
||||||
List<GetDailyPowerRecords> powers; // 동력사용시간
|
List<GetDailyPowerRecords> powers; // 동력사용시간
|
||||||
List<GetDailyForestryRecords> forestries; // 자가임업
|
List<GetDailyForestryRecords> forestries; // 자가임업
|
||||||
|
List<GetDailyFarmingRecords> farmings; // 자가농업
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class GetDailyWorkRecords {
|
||||||
|
private Long id;
|
||||||
|
private String itemCode;
|
||||||
|
private String workCode;
|
||||||
|
private String workLandArea;
|
||||||
|
private String harvestQuantity;
|
||||||
|
private String unitCode;
|
||||||
|
private String cropText;
|
||||||
|
private String ownerTime;
|
||||||
|
private String spouseTime;
|
||||||
|
private String familyMHours;
|
||||||
|
private String familyFHours;
|
||||||
|
private String hiredMHours;
|
||||||
|
private String hiredFHours;
|
||||||
|
private String sharedMHours;
|
||||||
|
private String sharedFHours;
|
||||||
|
private String volunteerMHours;
|
||||||
|
private String volunteerFHours;
|
||||||
|
private String updatedBy;
|
||||||
|
private String updatedAt;
|
||||||
|
}
|
||||||
@@ -18,4 +18,5 @@ public class GetDailyRecordsStatus {
|
|||||||
private String expenseStatus;
|
private String expenseStatus;
|
||||||
private String powerStatus;
|
private String powerStatus;
|
||||||
private String forestryStatus;
|
private String forestryStatus;
|
||||||
|
private String farmingStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,146 @@
|
|||||||
|
<?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.getDailyRecordStatusDetail.adapters.persistence.GetDailyRecordStatusDetailMapper">
|
||||||
|
|
||||||
|
<select id="getDailyRecordStatus"
|
||||||
|
resultType="app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyRecordStatus">
|
||||||
|
/* getDailyRecordStatus : 일계부 등록 상태 조회 */
|
||||||
|
SELECT income_status,
|
||||||
|
work_status,
|
||||||
|
expense_status,
|
||||||
|
power_status,
|
||||||
|
forestry_status,
|
||||||
|
farming_status
|
||||||
|
FROM daily_record
|
||||||
|
WHERE id = #{recordSeq}
|
||||||
|
AND is_deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyIncomeRecords"
|
||||||
|
resultType="app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyIncomeRecords">
|
||||||
|
/* getDailyIncomeRecords : 일계부 등록 현황 상세 수입 조회 */
|
||||||
|
SELECT di.id, /* 수입 id */
|
||||||
|
di.input_type, /* 입력구분 */
|
||||||
|
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.price, /* 현금 */
|
||||||
|
di.estimated_value, /* 현물평가액 */
|
||||||
|
di.updated_by, /* 최종수정자 */
|
||||||
|
TO_CHAR(di.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
|
||||||
|
FROM daily_income di
|
||||||
|
LEFT JOIN uicode ui_crop ON ui_crop.parent_id = 'code.record.crop' AND ui_crop.id = di.crop_code
|
||||||
|
LEFT JOIN uicode ui_unit ON ui_unit.parent_id = 'code.record.unit' AND ui_unit.id = di.unit_code
|
||||||
|
WHERE di.daily_record_seq = #{recordSeq}
|
||||||
|
AND di.is_deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyWorkRecords"
|
||||||
|
resultType="app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyWorkRecords">
|
||||||
|
/* getDailyWorkRecords : 일계부 등록 현황 상세 임업노동 투입 내역 조회 */
|
||||||
|
SELECT dw.id,
|
||||||
|
dw.item_code, /* 일단 품목명 매핑코드로 */ -- TODO(ks) : 품목명 코드형태 맞는지 체크할 것
|
||||||
|
dw.work_code, /* 일단 작업명 매핑코드로 */ -- TODO(ks) : 작업명 코드형태 맞는지 체크할 것
|
||||||
|
dw.work_land_area, /* 작업 면적 */ -- TODO(ks) : 작업면적의 코드 추가되어야 하는지 체크할 것
|
||||||
|
dw.harvest_quantity, /* 수확량 */
|
||||||
|
dw.unit_code, /* 단위 */
|
||||||
|
ui_crop.code_text AS crop_text, /* 단위 코드 텍스트 */
|
||||||
|
dw.owner_time, /* 경영주 시간 */
|
||||||
|
dw.spouse_time, /* 배우자 시간 */
|
||||||
|
dw.family_m_hours, /* 가족노동(남) */
|
||||||
|
dw.family_f_hours, /* 가족노동(여) */
|
||||||
|
dw.hired_m_hours, /* 고용노동(남) */
|
||||||
|
dw.hired_f_hours, /* 고용노동(여) */
|
||||||
|
dw.shared_m_hours, /* 품앗이(남) */
|
||||||
|
dw.shared_f_hours, /* 품앗이(여) */
|
||||||
|
dw.volunteer_m_hours, /* 일손돕기(남) */
|
||||||
|
dw.volunteer_f_hours, /* 일손돕기(여) */
|
||||||
|
dw.updated_by, /* 최종수정자 */
|
||||||
|
dw.updated_at /* 최종수정날짜 */
|
||||||
|
FROM daily_work dw
|
||||||
|
LEFT JOIN uicode ui_crop ON ui_crop.parent_id = 'code.record.unit' AND ui_crop.id = dw.unit_code
|
||||||
|
WHERE dw.daily_record_seq = #{recordSeq}
|
||||||
|
AND dw.is_deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyExpenseRecords"
|
||||||
|
resultType="app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyExpenseRecords">
|
||||||
|
/* getDailyExpenseRecords : 일계부 등록 현황 상세 지출 조회 */
|
||||||
|
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.price, /* 현금 */
|
||||||
|
de.estimated_value, /* 현물평가액 */
|
||||||
|
de.updated_by, /* 최종수정자 */
|
||||||
|
TO_CHAR(de.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
|
||||||
|
FROM daily_expense de
|
||||||
|
LEFT JOIN uicode ui_unit ON ui_unit.parent_id = 'code.record.unit' AND ui_unit.id = de.unit_code
|
||||||
|
WHERE de.daily_record_seq = #{recordSeq}
|
||||||
|
AND de.is_deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyPowerRecords"
|
||||||
|
resultType="app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyPowerRecords">
|
||||||
|
/* getDailyPowerRecords : 일계부 등록 현황 상세 동력사용시간 조회 */
|
||||||
|
SELECT dp.id, /* 동력사용시간 id */
|
||||||
|
dp.equipment_name, /* 명칭 */
|
||||||
|
dp.owned_hours, /* 자가 사용시간 */
|
||||||
|
dp.leased_hours, /* 임가 사용시간 */
|
||||||
|
dp.updated_by, /* 최종수정자 */
|
||||||
|
TO_CHAR(dp.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
|
||||||
|
FROM daily_power dp
|
||||||
|
WHERE dp.daily_record_seq = #{recordSeq}
|
||||||
|
AND dp.is_deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyForestryRecords"
|
||||||
|
resultType="app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyForestryRecords">
|
||||||
|
/* getDailyForestryRecords : 일계부 등록 현황 상세 자가임업 생산물 중 자가소비량 조회 */
|
||||||
|
SELECT df.id, /* 자가임업 id */
|
||||||
|
df.product_name, /* 생산물 */
|
||||||
|
df.usage, /* 용도 */
|
||||||
|
df.quantity, /* 수량 */
|
||||||
|
df.unit_code, /* 단위 코드 */
|
||||||
|
ui_unit.code_text AS unit_text, /* 단위 코드 텍스트 */
|
||||||
|
df.estimated_value, /* 현물평가액 */
|
||||||
|
df.updated_by, /* 최종수정자 */
|
||||||
|
TO_CHAR(df.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
|
||||||
|
FROM daily_forestry df
|
||||||
|
LEFT JOIN uicode ui_unit ON ui_unit.parent_id = 'code.record.unit' AND ui_unit.id = df.unit_code
|
||||||
|
WHERE df.daily_record_seq = #{recordSeq}
|
||||||
|
AND df.is_deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyFarmingRecords"
|
||||||
|
resultType="app.module.admin.usecase.household.getDailyRecordStatusDetail.ports.application.domain.GetDailyFarmingRecords">
|
||||||
|
/* getDailyFarmingRecords : 일계부 등록 현황 상세 자가농업 생산물 중 자가소비량 조회 */
|
||||||
|
SELECT df.id, /* 자가농업 id */
|
||||||
|
df.product_name, /* 생산물 */
|
||||||
|
df.usage, /* 용도 */
|
||||||
|
df.quantity, /* 수량 */
|
||||||
|
df.unit_code, /* 단위 코드 */
|
||||||
|
ui_unit.code_text AS unit_text, /* 단위 코드 텍스트 */
|
||||||
|
df.estimated_value, /* 현물평가액 */
|
||||||
|
df.updated_by, /* 최종수정자 */
|
||||||
|
TO_CHAR(df.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
|
||||||
|
FROM daily_farming df
|
||||||
|
LEFT JOIN uicode ui_unit ON ui_unit.parent_id = 'code.record.unit' AND ui_unit.id = df.unit_code
|
||||||
|
WHERE df.daily_record_seq = #{recordSeq}
|
||||||
|
AND df.is_deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
<?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.getDailyRecordStatus.adapters.persistence.GetDailyRecordStatusMapper">
|
|
||||||
<select id="getDailyIncomeRecords"
|
|
||||||
resultType="app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyIncomeRecords">
|
|
||||||
/* getDailyIncomeRecords : 일계부 등록 현황 상세 수입 조회 */
|
|
||||||
SELECT di.id, /* 수입 id */
|
|
||||||
di.input_type, /* 입력구분 */
|
|
||||||
di.is_credit, /* 외상판매여부 */
|
|
||||||
di.crop_code, /* 재배형태 코드 */
|
|
||||||
di.category_code, /* 수입 종류 코드 */
|
|
||||||
di.category_self, /* 수입 종류(직접입력) */
|
|
||||||
di.source_purpose, /* 수입원(용도) */
|
|
||||||
di.quantity, /* 수량 */
|
|
||||||
di.unit_code, /* 단위 */
|
|
||||||
di.price, /* 현금 */
|
|
||||||
di.estimated_value, /* 현물평가액 */
|
|
||||||
di.updated_by, /* 최종수정자 */
|
|
||||||
di.updated_at /* 최종수정날짜 */
|
|
||||||
FROM daily_record dr
|
|
||||||
JOIN daily_income di ON dr.id = di.daily_record_seq
|
|
||||||
WHERE dr.household_seq = #{householdSeq}
|
|
||||||
AND dr.id = #{recordSeq}
|
|
||||||
AND dr.record_month = #{recordMonth}
|
|
||||||
AND di.is_deleted = false
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDailyExpenseRecords"
|
|
||||||
resultType="app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyExpenseRecords">
|
|
||||||
/* getDailyExpenseRecords : 일계부 등록 현황 상세 지출 조회 */
|
|
||||||
SELECT de.id, /* 지출 id */
|
|
||||||
de.input_type, /* 입력구분 */
|
|
||||||
de.is_credit, /* 외상판매여부 */
|
|
||||||
de.category_code, /* 재배형태 코드 */
|
|
||||||
de.category_self, /* 지출 종류 코드 */
|
|
||||||
de.source_purpose, /* 지출원(용도) */
|
|
||||||
de.quantity, /* 수량 */
|
|
||||||
de.unit_code, /* 단위 */
|
|
||||||
de.price, /* 현금 */
|
|
||||||
de.estimated_value, /* 현물평가액 */
|
|
||||||
de.updated_by, /* 최종수정자 */
|
|
||||||
de.updated_at /* 최종수정날짜 */
|
|
||||||
FROM daily_record dr
|
|
||||||
JOIN daily_expense de ON dr.id = de.daily_record_seq
|
|
||||||
WHERE dr.household_seq = #{householdSeq}
|
|
||||||
AND dr.id = #{recordSeq}
|
|
||||||
AND dr.record_month = #{recordMonth}
|
|
||||||
AND de.is_deleted = false
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDailyPowerRecords"
|
|
||||||
resultType="app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyPowerRecords">
|
|
||||||
/* getDailyPowerRecords : 일계부 등록 현황 상세 동력사용시간 조회 */
|
|
||||||
select dp.id,
|
|
||||||
dp.equipment_name,
|
|
||||||
dp.owned_hours,
|
|
||||||
dp.leased_hours,
|
|
||||||
dp.updated_by,
|
|
||||||
dp.updated_at
|
|
||||||
from daily_record dr
|
|
||||||
join daily_power dp on dr.id = dp.daily_record_seq
|
|
||||||
WHERE dr.household_seq = #{householdSeq}
|
|
||||||
AND dr.id = #{recordSeq}
|
|
||||||
AND dr.record_month = #{recordMonth}
|
|
||||||
AND dp.is_deleted = false
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDailyForestryRecords"
|
|
||||||
resultType="app.module.admin.usecase.household.getDailyRecordStatus.ports.application.domain.GetDailyForestryRecords">
|
|
||||||
/* getDailyForestryRecords : 일계부 등록 현황 상세 자가임업 생산물 중 자가소비량 조회 */
|
|
||||||
SELECT df.id,
|
|
||||||
df.product_name,
|
|
||||||
df.usage,
|
|
||||||
df.quantity,
|
|
||||||
df.unit_code,
|
|
||||||
df.estimated_value,
|
|
||||||
df.updated_by,
|
|
||||||
df.updated_at
|
|
||||||
FROM daily_record dr
|
|
||||||
JOIN daily_forestry df on dr.id = df.daily_record_seq
|
|
||||||
WHERE dr.household_seq = #{householdSeq}
|
|
||||||
AND dr.id = #{recordSeq}
|
|
||||||
AND dr.record_month = #{recordMonth}
|
|
||||||
AND df.is_deleted = false
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -13,14 +13,15 @@
|
|||||||
COUNT(DISTINCT dw.id) AS work_cnt,
|
COUNT(DISTINCT dw.id) AS work_cnt,
|
||||||
COUNT(DISTINCT de.id) AS expense_cnt,
|
COUNT(DISTINCT de.id) AS expense_cnt,
|
||||||
COUNT(DISTINCT dp.id) AS power_cnt,
|
COUNT(DISTINCT dp.id) AS power_cnt,
|
||||||
COUNT(DISTINCT dfs.id) AS forestry_cnt
|
COUNT(DISTINCT dfs.id) AS forestry_cnt,
|
||||||
|
COUNT(distinct dfm.id) AS farming_cnt
|
||||||
FROM daily_record dr
|
FROM daily_record dr
|
||||||
LEFT JOIN daily_income di ON di.daily_record_seq = dr.id AND di.is_deleted = false
|
LEFT JOIN daily_income di ON di.daily_record_seq = dr.id AND di.is_deleted = false
|
||||||
LEFT JOIN daily_work dw ON dw.daily_record_seq = dr.id AND dw.is_deleted = false
|
LEFT JOIN daily_work dw ON dw.daily_record_seq = dr.id AND dw.is_deleted = false
|
||||||
LEFT JOIN daily_expense de ON de.daily_record_seq = dr.id AND de.is_deleted = false
|
LEFT JOIN daily_expense de ON de.daily_record_seq = dr.id AND de.is_deleted = false
|
||||||
LEFT JOIN daily_power dp ON dp.daily_record_seq = dr.id AND dp.is_deleted = false
|
LEFT JOIN daily_power dp ON dp.daily_record_seq = dr.id AND dp.is_deleted = false
|
||||||
LEFT JOIN daily_forestry dfs ON dfs.daily_record_seq = dr.id AND dfs.is_deleted = false
|
LEFT JOIN daily_forestry dfs ON dfs.daily_record_seq = dr.id AND dfs.is_deleted = false
|
||||||
-- TODO : 농업 자가소비량 테이블 수정 후 추가
|
LEFT JOIN daily_farming dfm on dfm.daily_record_seq = dr.id and dfm.is_deleted = false
|
||||||
WHERE dr.household_seq = #{householdSeq}
|
WHERE dr.household_seq = #{householdSeq}
|
||||||
AND dr.record_month = #{recordMonth}
|
AND dr.record_month = #{recordMonth}
|
||||||
AND dr.is_deleted = false
|
AND dr.is_deleted = false
|
||||||
@@ -42,8 +43,14 @@
|
|||||||
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.work_status, dc.work_cnt) AS work_status,
|
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.work_status, dc.work_cnt) AS work_status,
|
||||||
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.expense_status, dc.expense_cnt) AS expense_status,
|
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.expense_status, dc.expense_cnt) AS expense_status,
|
||||||
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.power_status, dc.power_cnt) AS power_status,
|
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.power_status, dc.power_cnt) AS power_status,
|
||||||
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.forestry_status, dc.forestry_cnt) AS forestry_status
|
fn_get_status(mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE), dr.forestry_status, dc.forestry_cnt) AS forestry_status,
|
||||||
-- TODO : 농업 자가소비량 테이블 수정 후 추가
|
fn_get_farming_status(
|
||||||
|
ddg.start_day,
|
||||||
|
dr.record_month,
|
||||||
|
mc.is_current_month AND ddg.start_day > EXTRACT(DAY FROM CURRENT_DATE),
|
||||||
|
dr.farming_status,
|
||||||
|
dc.farming_cnt
|
||||||
|
) AS farming_status
|
||||||
FROM daily_day_group ddg
|
FROM daily_day_group ddg
|
||||||
CROSS JOIN month_check mc
|
CROSS JOIN month_check mc
|
||||||
LEFT JOIN daily_record dr ON ddg.group_no = dr.day_group_no
|
LEFT JOIN daily_record dr ON ddg.group_no = dr.day_group_no
|
||||||
|
|||||||
@@ -442,4 +442,8 @@ const showAudit = (auditItem, createdBy, createdAt, updatedBy, updatedAt) => {
|
|||||||
})
|
})
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
const ifNullDash = (value, fallback = '-') => {
|
||||||
|
return value !== null && value !== undefined && value !== '' ? value : fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<input name="userRegionMainCode" th:value="${userRegionMainCode}" type="hidden"/>
|
<input name="userRegionMainCode" th:value="${userRegionMainCode}" type="hidden"/>
|
||||||
|
|
||||||
<div class="content-inner">
|
<div class="content-inner">
|
||||||
<!-- 필터 영역 -->
|
<!-- 필터 영역 -->5241
|
||||||
<section class="filter-wrap">
|
<section class="filter-wrap">
|
||||||
<div class="form-area">
|
<div class="form-area">
|
||||||
<!-- 연/월 -->
|
<!-- 연/월 -->
|
||||||
@@ -340,14 +340,14 @@
|
|||||||
<td>${ct.regionMainName}</td><!-- 실사 -->
|
<td>${ct.regionMainName}</td><!-- 실사 -->
|
||||||
<td>${ct.regionSubName}</td><!-- 지역 -->
|
<td>${ct.regionSubName}</td><!-- 지역 -->
|
||||||
<td>${ct.regionDetailName}</td><!-- 세부지역 -->
|
<td>${ct.regionDetailName}</td><!-- 세부지역 -->
|
||||||
<td>${isEmpty(ct.industryLargeName)}</td><!-- 업종 대분류 -->
|
<td>${ifNullDash(ct.industryLargeName)}</td><!-- 업종 대분류 -->
|
||||||
<td>${isEmpty(ct.industryMiddleName)}</td><!-- 업종 중분류1 -->
|
<td>${ifNullDash(ct.industryMiddleName)}</td><!-- 업종 중분류1 -->
|
||||||
<td>${ct.progressPercent}%</td><!-- 임가 진행 상황 -->
|
<td>${ct.progressPercent}%</td><!-- 임가 진행 상황 -->
|
||||||
<td>${isEmpty(ct.firstVisitDate)}</td><!-- 1차방문날짜 -->
|
<td>${ifNullDash(ct.firstVisitDate)}</td><!-- 1차방문날짜 -->
|
||||||
<td>${isEmpty(ct.secondVisitDate)}</td><!-- 2차방문날짜 -->
|
<td>${ifNullDash(ct.secondVisitDate)}</td><!-- 2차방문날짜 -->
|
||||||
<td>${ct.isGiftSent ? "전달" : "미전달"}</td> <!-- 답례품 -->
|
<td>${ct.isGiftSent ? "전달" : "미전달"}</td> <!-- 답례품 -->
|
||||||
<td class="hide-role-researcher">${isEmpty(ct.researcherName)}</td> <!-- 조사원이름 -->
|
<td class="hide-role-researcher">${ifNullDash(ct.researcherName)}</td> <!-- 조사원이름 -->
|
||||||
<td class="hide-role-researcher">${isEmpty(ct.researcherPhone)}</td> <!-- 조사원번호 -->
|
<td class="hide-role-researcher">${ifNullDash(ct.researcherPhone)}</td> <!-- 조사원번호 -->
|
||||||
</tr>
|
</tr>
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
@@ -398,13 +398,6 @@
|
|||||||
f.submit();
|
f.submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
// TODO : 이거 공통으로 뺄지 ?
|
|
||||||
function isEmpty(value, fallback = '-') {
|
|
||||||
return value !== null && value !== undefined && value !== '' ? value : fallback;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -130,14 +130,31 @@
|
|||||||
<div class="tab-content daily-record" data-tab-value="tab1">
|
<div class="tab-content daily-record" data-tab-value="tab1">
|
||||||
<!-- 일계부 등록 현황 리스트 -->
|
<!-- 일계부 등록 현황 리스트 -->
|
||||||
<div class="daily-record-content daily-record-list">
|
<div class="daily-record-content daily-record-list">
|
||||||
<div>
|
|
||||||
<span>작성완료: <span id="doneCount">0</span></span>
|
|
||||||
<span>미작성: <span id="emptyCount">0</span></span>
|
|
||||||
<span>미완료: <span id="incompleteCount">0</span></span>
|
|
||||||
<span>대기: <span id="waitingCount">0</span></span>
|
|
||||||
<span> 현황: <span id="progressPercent">0</span>%</span>
|
|
||||||
</div>
|
|
||||||
<div class="content-inner">
|
<div class="content-inner">
|
||||||
|
<article class="summary-area">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<p>작성완료</p>
|
||||||
|
<span><strong id="doneCount">6</strong>건</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>미작성</p>
|
||||||
|
<span><strong id="emptyCount">6</strong>건</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>미완료</p>
|
||||||
|
<span><strong id="incompleteCount">6</strong>건</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>대기</p>
|
||||||
|
<span><strong id="waitingCount">6</strong>건</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>완료율</p>
|
||||||
|
<span><strong id="progressPercent">56.12</strong>%</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</article>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -148,7 +165,7 @@
|
|||||||
<th>지출</th>
|
<th>지출</th>
|
||||||
<th>동력사용시간</th>
|
<th>동력사용시간</th>
|
||||||
<th>임업 자가소비량</th>
|
<th>임업 자가소비량</th>
|
||||||
<!-- <th>농업 자가소비량</th>-->
|
<th>농업 자가소비량</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -160,109 +177,248 @@
|
|||||||
|
|
||||||
<!-- 일계부 등록 현황 상세 -->
|
<!-- 일계부 등록 현황 상세 -->
|
||||||
<div class="daily-record-content daily-record-detail" style="display: none;">
|
<div class="daily-record-content daily-record-detail" style="display: none;">
|
||||||
|
|
||||||
<div class="content-inner">
|
<div class="content-inner">
|
||||||
<table id="table-income">
|
<!-- 수입 -->
|
||||||
<thead>
|
<section class="table-group">
|
||||||
|
<div class="table-tit-group">
|
||||||
|
<h3>수입 <strong>(<span id="incomeCount">0</span>건)</strong></h3>
|
||||||
|
<div class="component-btns bottom-btn-group">
|
||||||
|
<div class="btns-row align-right">
|
||||||
|
<button type="button" class="btn small">
|
||||||
|
<span class="btn-txt">영수증 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn small">
|
||||||
|
<span class="btn-txt">등록여부</span>
|
||||||
|
</button>
|
||||||
|
<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-income">
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="10">수입 (<span id="incomeCount">0</span>건)</th>
|
<th>선택</th>
|
||||||
|
<th>외상판매</th>
|
||||||
|
<th>재배형태</th>
|
||||||
|
<th>수입의 종류</th>
|
||||||
|
<th>수입원</th>
|
||||||
|
<th>수량</th>
|
||||||
|
<th>단위</th>
|
||||||
|
<th>현금(원)</th>
|
||||||
|
<th>현물평가액</th>
|
||||||
|
<th>최종 수정자</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<thead>
|
<tbody>
|
||||||
<!-- <tr>-->
|
|
||||||
<!-- <th colspan="10">수입</th>-->
|
|
||||||
<!-- </tr>-->
|
|
||||||
<tr>
|
|
||||||
<th>선택</th>
|
|
||||||
<th>외상판매</th>
|
|
||||||
<th>재배형태</th>
|
|
||||||
<th>수입의 종류</th>
|
|
||||||
<th>수입원</th>
|
|
||||||
<th>수량</th>
|
|
||||||
<th>단위</th>
|
|
||||||
<th>현금(원)</th>
|
|
||||||
<th>현물평가액</th>
|
|
||||||
<th>최종 수정자</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<!-- 지출 -->
|
<!-- 임업노동 투입 내역 -->
|
||||||
<div class="content-inner">
|
<section class="table-group">
|
||||||
<table id="table-expense">
|
<div class="table-tit-group">
|
||||||
<thead>
|
<h3>임업노동 투입 내역 <strong>(<span id="workCount">0</span>건)</strong></h3>
|
||||||
<tr>
|
<div class="component-btns bottom-btn-group">
|
||||||
<th colspan="9">지출 (<span id="expenseCount">0</span>건)</th>
|
<div class="btns-row align-right">
|
||||||
</tr>
|
<button type="button" class="btn small">
|
||||||
</thead>
|
<span class="btn-txt">등록여부</span>
|
||||||
<thead>
|
</button>
|
||||||
<tr>
|
<button type="button" class="btn small btn-secondary">
|
||||||
<th>선택</th>
|
<span class=" btn-txt">삭제</span>
|
||||||
<th>외상 또는 카드구입</th>
|
</button>
|
||||||
<th>지출의 종류</th>
|
<button type="button" class="btn small btn-primary">
|
||||||
<th>용도</th>
|
<span class="btn-txt">추가</span>
|
||||||
<th>수량</th>
|
</button>
|
||||||
<th>단위</th>
|
</div>
|
||||||
<th>현금(원)</th>
|
</div>
|
||||||
<th>현물평가액</th>
|
</div>
|
||||||
<th>최종 수정자</th>
|
<table id="table-work">
|
||||||
</tr>
|
<thead>
|
||||||
</thead>
|
<tr>
|
||||||
<tbody>
|
<th colspan="7"></th>
|
||||||
|
<th colspan="10">노동투입시간</th>
|
||||||
|
<th colspan="1"></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>선택</th>
|
||||||
|
<th>품목명</th>
|
||||||
|
<th>작업명</th>
|
||||||
|
<th>작업 면적</th>
|
||||||
|
<th>단위</th>
|
||||||
|
<th>수확량</th>
|
||||||
|
<th>단위</th>
|
||||||
|
<th>경영주</th>
|
||||||
|
<th>배우자</th>
|
||||||
|
<th>가족노동(남)</th>
|
||||||
|
<th>가족노동(여)</th>
|
||||||
|
<th>고용노동(남)</th>
|
||||||
|
<th>고용노동(여)</th>
|
||||||
|
<th>품앗이(남)</th>
|
||||||
|
<th>품앗이(여)</th>
|
||||||
|
<th>일손돕기(남)</th>
|
||||||
|
<th>일손돕기(여)</th>
|
||||||
|
<th>최종 수정자</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<!-- 동력사용시간 -->
|
<!-- 지출 -->
|
||||||
<div class="content-inner">
|
<section class="table-group">
|
||||||
<table id="table-power">
|
<div class="table-tit-group">
|
||||||
<thead>
|
<h3>지출 <strong>(<span id="expenseCount">0</span>건)</strong></h3>
|
||||||
<tr>
|
<div class="component-btns bottom-btn-group">
|
||||||
<th colspan="5">동력사용시간 (<span id="powerCount">0</span>건)</th>
|
<div class="btns-row align-right">
|
||||||
</tr>
|
<button type="button" class="btn small">
|
||||||
</thead>
|
<span class="btn-txt">영수증 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||||
<thead>
|
</button>
|
||||||
<tr>
|
<button type="button" class="btn small">
|
||||||
<th>선택</th>
|
<span class="btn-txt">등록여부</span>
|
||||||
<th>명칭</th>
|
</button>
|
||||||
<th>자가 사용시간</th>
|
<button type="button" class="btn small btn-secondary">
|
||||||
<th>임가 사용시간</th>
|
<span class=" btn-txt">삭제</span>
|
||||||
<th>최종 수정자</th>
|
</button>
|
||||||
</tr>
|
<button type="button" class="btn small btn-primary">
|
||||||
</thead>
|
<span class="btn-txt">추가</span>
|
||||||
<tbody>
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="table-expense">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>선택</th>
|
||||||
|
<th>외상 또는 카드구입</th>
|
||||||
|
<th>지출의 종류</th>
|
||||||
|
<th>용도</th>
|
||||||
|
<th>수량</th>
|
||||||
|
<th>단위</th>
|
||||||
|
<th>현금(원)</th>
|
||||||
|
<th>현물평가액</th>
|
||||||
|
<th>최종 수정자</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<!-- 자가임업 -->
|
<!-- 동력사용시간 -->
|
||||||
<div class="content-inner">
|
<section class="table-group">
|
||||||
<table id="table-forestry">
|
<div class="table-tit-group">
|
||||||
<thead>
|
<h3>동력사용시간 <strong>(<span id="powerCount">0</span>건)</strong></h3>
|
||||||
<tr>
|
<div class="component-btns bottom-btn-group">
|
||||||
<th colspan="7">자가임업 생산물 중 자가소비량 (<span id="forestryCount">0</span>건)</th>
|
<div class="btns-row align-right">
|
||||||
</tr>
|
<button type="button" class="btn small">
|
||||||
</thead>
|
<span class="btn-txt">등록여부</span>
|
||||||
<thead>
|
</button>
|
||||||
<tr>
|
<button type="button" class="btn small btn-secondary">
|
||||||
<th>선택</th>
|
<span class=" btn-txt">삭제</span>
|
||||||
<th>생산물</th>
|
</button>
|
||||||
<th>용도</th>
|
<button type="button" class="btn small btn-primary">
|
||||||
<th>수량</th>
|
<span class="btn-txt">추가</span>
|
||||||
<th>단위</th>
|
</button>
|
||||||
<th>현물평가액</th>
|
</div>
|
||||||
<th>최종 수정자</th>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</thead>
|
<table id="table-power">
|
||||||
<tbody>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>선택</th>
|
||||||
|
<th>명칭</th>
|
||||||
|
<th>자가 사용시간</th>
|
||||||
|
<th>임가 사용시간</th>
|
||||||
|
<th>최종 수정자</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 자가임업 -->
|
||||||
|
<section class="table-group">
|
||||||
|
<div class="table-tit-group">
|
||||||
|
<h3>자가임업 생산물 중 자가소비량 <strong>(<span id="forestryCount">0</span>건)</strong></h3>
|
||||||
|
<div class="component-btns bottom-btn-group">
|
||||||
|
<div class="btns-row align-right">
|
||||||
|
<button type="button" class="btn small">
|
||||||
|
<span class="btn-txt">등록여부</span>
|
||||||
|
</button>
|
||||||
|
<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-forestry">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<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="farmingCount">0</span>건)</strong></h3>
|
||||||
|
<div class="component-btns bottom-btn-group">
|
||||||
|
<div class="btns-row align-right">
|
||||||
|
<button type="button" class="btn small">
|
||||||
|
<span class="btn-txt">등록여부</span>
|
||||||
|
</button>
|
||||||
|
<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-farming">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>선택</th>
|
||||||
|
<th>생산물</th>
|
||||||
|
<th>용도</th>
|
||||||
|
<th>수량</th>
|
||||||
|
<th>단위</th>
|
||||||
|
<th>현물평가액</th>
|
||||||
|
<th>최종 수정자</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -413,7 +569,7 @@
|
|||||||
<td>${item.expenseStatus}</td><!-- 지출 -->
|
<td>${item.expenseStatus}</td><!-- 지출 -->
|
||||||
<td>${item.powerStatus}</td><!-- 동력사용시간 -->
|
<td>${item.powerStatus}</td><!-- 동력사용시간 -->
|
||||||
<td>${item.forestryStatus}</td><!-- 임업 자가소비량 -->
|
<td>${item.forestryStatus}</td><!-- 임업 자가소비량 -->
|
||||||
<!-- <td>${item.forestryStatus}</td><!– 농업 자가소비량 –>-->
|
<td>${item.farmingStatus}</td><!-- 농업 자가소비량 -->
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
@@ -444,17 +600,15 @@
|
|||||||
|
|
||||||
ajaxUtil._ajaxMethod(
|
ajaxUtil._ajaxMethod(
|
||||||
'/api/household/dailyRecordStatus',
|
'/api/household/dailyRecordStatus',
|
||||||
{
|
{ recordSeq: id },
|
||||||
householdSeq: f.householdSeq.value,
|
|
||||||
recordSeq: id,
|
|
||||||
recordMonth: f.recordMonth.value
|
|
||||||
},
|
|
||||||
function(response) { // 성공
|
function(response) { // 성공
|
||||||
console.log("일계부 등록 상세 데이터~ : ", response);
|
console.log("일계부 등록 상세 데이터~ : ", response);
|
||||||
gridIncomeTable(response.incomes);
|
gridIncomeTable(response.status.incomeStatus, response.incomes);
|
||||||
gridExpenseTable(response.expenses);
|
gridWorkTable(response.status.workStatus, response.works);
|
||||||
gridPowerTable(response.powers);
|
gridExpenseTable(response.status.expenseStatus, response.expenses);
|
||||||
gridForestryTable(response.forestries);
|
gridPowerTable(response.status.powerStatus, response.powers);
|
||||||
|
gridForestryTable(response.status.forestryStatus, response.forestries);
|
||||||
|
gridFarmingTable(response.status.farmingStatus, response.farmings);
|
||||||
},
|
},
|
||||||
function (code, rstData) { // 실패
|
function (code, rstData) { // 실패
|
||||||
console.log("error : ", code);
|
console.log("error : ", code);
|
||||||
@@ -465,13 +619,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 수입 테이블 그리기
|
// 수입 테이블 그리기
|
||||||
const gridIncomeTable = (data) => {
|
const gridIncomeTable = (status, data) => {
|
||||||
const tbody = $('#table-income tbody');
|
const tbody = $('#table-income tbody');
|
||||||
tbody.empty();
|
tbody.empty();
|
||||||
|
|
||||||
$('#incomeCount').text(data.length);
|
$('#incomeCount').text(data.length);
|
||||||
if(data.length === 0) {
|
if(data.length === 0) {
|
||||||
noData(tbody, 10);
|
noData(tbody, status, 10);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,15 +641,68 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>외상판매</td> <!-- 외상판매 -->
|
<td>${item.isCredit ? "Y" : "N"}</td> <!-- 외상판매 -->
|
||||||
<td>재배형태</td><!-- 재배형태 -->
|
<td>${ifNullDash(item.cropText)}</td><!-- 재배형태 -->
|
||||||
<td>수입의 종류</td><!-- 수입의 종류 -->
|
<!-- TODO(ks) : 수입의 종류 코드형태로 들어오고 있음, 텍스트형태로 바뀌는 건지 체크!! -->
|
||||||
<td>수입원</td><!-- 수입원 -->
|
<td class="underline">${ifNullDash(item.categorySelf)}</td><!-- 수입의 종류 -->
|
||||||
<td>수량</td><!-- 수량 -->
|
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 수입원 -->
|
||||||
<td>단위</td><!-- 단위 -->
|
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||||
<td>현금(원)</td><!-- 현금(원) -->
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||||
<td>현물평가액</td><!-- 현물평가액 -->
|
<td class="align-right">${ifNullDash(item.price)}</td><!-- 현금(원) -->
|
||||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
<td class="align-right">${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||||
|
<td>
|
||||||
|
${item.updatedBy}<br>
|
||||||
|
(${item.updatedAt})
|
||||||
|
</td><!-- 최종 수정자 -->
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
});
|
||||||
|
|
||||||
|
tbody.append(tmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 임업노동 테이블 그리기
|
||||||
|
const gridWorkTable = (status, data) => {
|
||||||
|
const tbody = $('#table-work tbody');
|
||||||
|
tbody.empty();
|
||||||
|
|
||||||
|
$('#workCount').text(data.length);
|
||||||
|
if(data.length === 0) {
|
||||||
|
noData(tbody, status, 18);
|
||||||
|
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.itemCode)}</td><!-- 품목명 -->
|
||||||
|
<td>${ifNullDash(item.workCode)}</td><!-- 작업명 -->
|
||||||
|
<td>${ifNullDash(item.workLandArea)}</td><!-- 작업 면적 -->
|
||||||
|
<td>${ifNullDash(item.harvestQuantity)}</td><!-- 수확량 -->
|
||||||
|
<td>${ifNullDash(item.cropText)}</td><!-- 단위 -->
|
||||||
|
<td>${ifNullDash(item.ownerTime)}</td><!-- 경영주 시간 -->
|
||||||
|
<td>${ifNullDash(item.spouseTime)}</td><!-- 배우자 시간 -->
|
||||||
|
<td>${ifNullDash(item.familyMHours)}</td><!-- 가족노동(남) -->
|
||||||
|
<td>${ifNullDash(item.familyFHours)}</td><!-- 가족노동(여) -->
|
||||||
|
<td>${ifNullDash(item.hiredMHours)}</td><!-- 고용노동(남) -->
|
||||||
|
<td>${ifNullDash(item.hiredFHours)}</td><!-- 고용노동(여) -->
|
||||||
|
<td>${ifNullDash(item.sharedMHours)}</td><!-- 품앗이(남) -->
|
||||||
|
<td>${ifNullDash(item.sharedFHours)}</td><!-- 품앗이(여) -->
|
||||||
|
<td>${ifNullDash(item.volunteerMHours)}</td><!-- 일손돕기(남) -->
|
||||||
|
<td>${ifNullDash(item.volunteerFHours)}</td><!-- 일손돕기(여) -->
|
||||||
|
<td>
|
||||||
|
${item.updatedBy}<br>
|
||||||
|
(${item.updatedAt})
|
||||||
|
</td><!-- 최종 수정자 -->
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
@@ -504,13 +711,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 지출 테이블 그리기
|
// 지출 테이블 그리기
|
||||||
const gridExpenseTable = (data) => {
|
const gridExpenseTable = (status, data) => {
|
||||||
const tbody = $('#table-expense tbody');
|
const tbody = $('#table-expense tbody');
|
||||||
tbody.empty();
|
tbody.empty();
|
||||||
|
|
||||||
$('#expenseCount').text(data.length);
|
$('#expenseCount').text(data.length);
|
||||||
if(data.length === 0) {
|
if(data.length === 0) {
|
||||||
noData(tbody, 9);
|
noData(tbody, status, 9);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,14 +733,18 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>외상 또는 카드구입</td> <!-- 외상 또는 카드구입 -->
|
<td>${item.isCredit ? "Y" : "N"}</td> <!-- 외상 또는 카드구입 -->
|
||||||
<td>지출의 종류</td><!-- 지출의 종류 -->
|
<!-- TODO(ks) : 지출의 종류 코드형태로 들어오고 있음, 텍스트형태로 바뀌는 건지 체크!! -->
|
||||||
<td>용도</td><!-- 용도 -->
|
<td>${ifNullDash(item.categorySelf)}</td><!-- 지출의 종류 -->
|
||||||
<td>수량</td><!-- 수량 -->
|
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 용도 -->
|
||||||
<td>단위</td><!-- 단위 -->
|
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||||
<td>현금(원)</td><!-- 현금(원) -->
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||||
<td>현물평가액</td><!-- 현물평가액 -->
|
<td>${ifNullDash(item.price)}</td><!-- 현금(원) -->
|
||||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
<td>${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||||
|
<td>
|
||||||
|
${item.updatedBy}<br>
|
||||||
|
(${item.updatedAt})
|
||||||
|
</td><!-- 최종 수정자 -->
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
@@ -542,13 +753,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 동력사용시간 테이블 그리기
|
// 동력사용시간 테이블 그리기
|
||||||
const gridPowerTable = (data) => {
|
const gridPowerTable = (status, data) => {
|
||||||
const tbody = $('#table-power tbody');
|
const tbody = $('#table-power tbody');
|
||||||
tbody.empty();
|
tbody.empty();
|
||||||
|
|
||||||
$('#powerCount').text(data.length);
|
$('#powerCount').text(data.length);
|
||||||
if(data.length === 0) {
|
if(data.length === 0) {
|
||||||
noData(tbody, 5);
|
noData(tbody, status, 5);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,10 +775,13 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>명칭</td> <!-- 명칭 -->
|
<td>${ifNullDash(item.equipmentName)}</td> <!-- 명칭 -->
|
||||||
<td>자가 사용시간</td><!-- 자가 사용시간 -->
|
<td>${ifNullDash(item.ownedHours)}</td><!-- 자가 사용시간 -->
|
||||||
<td>임가 사용시간</td><!-- 임가 사용시간 -->
|
<td>${ifNullDash(item.leasedHours)}</td><!-- 임가 사용시간 -->
|
||||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
<td>
|
||||||
|
${item.updatedBy}<br>
|
||||||
|
(${item.updatedAt})
|
||||||
|
</td><!-- 최종 수정자 -->
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
@@ -576,13 +790,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 자가임업 테이블 그리기
|
// 자가임업 테이블 그리기
|
||||||
const gridForestryTable = (data) => {
|
const gridForestryTable = (status, data) => {
|
||||||
const tbody = $('#table-forestry tbody');
|
const tbody = $('#table-forestry tbody');
|
||||||
tbody.empty();
|
tbody.empty();
|
||||||
|
|
||||||
$('#forestryCount').text(data.length);
|
$('#forestryCount').text(data.length);
|
||||||
if(data.length === 0) {
|
if(data.length === 0) {
|
||||||
noData(tbody, 7);
|
noData(tbody, status, 7);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,12 +812,15 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>생산물</td> <!-- 생산물 -->
|
<td>${ifNullDash(item.productName)}</td> <!-- 생산물 -->
|
||||||
<td>용도</td><!-- 용도 -->
|
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
|
||||||
<td>수량</td><!-- 수량 -->
|
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||||
<td>단위</td><!-- 단위 -->
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||||
<td>현물평가액</td><!-- 현물평가액 -->
|
<td>${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
<td>
|
||||||
|
${item.updatedBy}<br>
|
||||||
|
(${item.updatedAt})
|
||||||
|
</td><!-- 최종 수정자 -->
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
@@ -611,8 +828,50 @@
|
|||||||
tbody.append(tmpl);
|
tbody.append(tmpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
const noData = (target, length) => {
|
// 자가농업 테이블 그리기
|
||||||
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">등록없음</td></tr>`);
|
const gridFarmingTable = (status, data) => {
|
||||||
|
const tbody = $('#table-farming tbody');
|
||||||
|
tbody.empty();
|
||||||
|
|
||||||
|
$('#farmingCount').text(data.length);
|
||||||
|
if(data.length === 0) {
|
||||||
|
noData(tbody, status, 7);
|
||||||
|
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.productName)}</td> <!-- 생산물 -->
|
||||||
|
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
|
||||||
|
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
||||||
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
||||||
|
<td>${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
||||||
|
<td>
|
||||||
|
${item.updatedBy}<br>
|
||||||
|
(${item.updatedAt})
|
||||||
|
</td><!-- 최종 수정자 -->
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
});
|
||||||
|
|
||||||
|
tbody.append(tmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// nodata 처리
|
||||||
|
const noData = (target, status, length) => {
|
||||||
|
const noDataText = status === 'TARGET' ? '등록이 필요합니다.' : '등록없음';
|
||||||
|
|
||||||
|
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">${noDataText}</td></tr>`);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1521,7 +1521,7 @@ CREATE TABLE work_input (
|
|||||||
item_code varchar(255),
|
item_code varchar(255),
|
||||||
work_name varchar(30) NOT NULL,
|
work_name varchar(30) NOT NULL,
|
||||||
work_code varchar(255),
|
work_code varchar(255),
|
||||||
word_land_area int,
|
work_land_area int,
|
||||||
harvest_quantity decimal(7,2),
|
harvest_quantity decimal(7,2),
|
||||||
unit_code varchar(10),
|
unit_code varchar(10),
|
||||||
month varchar(7) NOT NULL,
|
month varchar(7) NOT NULL,
|
||||||
@@ -1545,7 +1545,7 @@ COMMENT ON COLUMN work_input.item_name IS '품목명';
|
|||||||
COMMENT ON COLUMN work_input.item_code IS '품목부호 (매핑코드)';
|
COMMENT ON COLUMN work_input.item_code IS '품목부호 (매핑코드)';
|
||||||
COMMENT ON COLUMN work_input.work_name IS '작업명';
|
COMMENT ON COLUMN work_input.work_name IS '작업명';
|
||||||
COMMENT ON COLUMN work_input.work_code IS '작업부호 (매핑코드)';
|
COMMENT ON COLUMN work_input.work_code IS '작업부호 (매핑코드)';
|
||||||
COMMENT ON COLUMN work_input.word_land_area IS '작업면적';
|
COMMENT ON COLUMN work_input.work_land_area IS '작업면적';
|
||||||
COMMENT ON COLUMN work_input.harvest_quantity IS '수확량';
|
COMMENT ON COLUMN work_input.harvest_quantity IS '수확량';
|
||||||
COMMENT ON COLUMN work_input.unit_code IS '단위 (코드매핑)';
|
COMMENT ON COLUMN work_input.unit_code IS '단위 (코드매핑)';
|
||||||
COMMENT ON COLUMN work_input.month IS '조사시행 월 (yyyy-mm)';
|
COMMENT ON COLUMN work_input.month IS '조사시행 월 (yyyy-mm)';
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ CREATE TABLE daily_work (
|
|||||||
item_mark_code varchar(255),
|
item_mark_code varchar(255),
|
||||||
work_code varchar(255) NOT NULL,
|
work_code varchar(255) NOT NULL,
|
||||||
work_mark_code varchar(255),
|
work_mark_code varchar(255),
|
||||||
word_land_area int,
|
work_land_area int,
|
||||||
harvest_quantity decimal(7,2),
|
harvest_quantity decimal(7,2),
|
||||||
unit_code varchar(10),
|
unit_code varchar(10),
|
||||||
owner_time decimal(5,2), -- 경영주 노동시간
|
owner_time decimal(5,2), -- 경영주 노동시간
|
||||||
@@ -288,7 +288,7 @@ COMMENT ON COLUMN daily_work.item_code IS '품목명 (매핑코드)';
|
|||||||
COMMENT ON COLUMN daily_work.item_mark_code IS '품목부호 (매핑코드)';
|
COMMENT ON COLUMN daily_work.item_mark_code IS '품목부호 (매핑코드)';
|
||||||
COMMENT ON COLUMN daily_work.work_code IS '작업명 (매핑코드)';
|
COMMENT ON COLUMN daily_work.work_code IS '작업명 (매핑코드)';
|
||||||
COMMENT ON COLUMN daily_work.work_mark_code IS '작업부호 (매핑코드)';
|
COMMENT ON COLUMN daily_work.work_mark_code IS '작업부호 (매핑코드)';
|
||||||
COMMENT ON COLUMN daily_work.word_land_area IS '작업면적';
|
COMMENT ON COLUMN daily_work.work_land_area IS '작업면적';
|
||||||
COMMENT ON COLUMN daily_work.harvest_quantity IS '수확량';
|
COMMENT ON COLUMN daily_work.harvest_quantity IS '수확량';
|
||||||
COMMENT ON COLUMN daily_work.unit_code IS '단위 (코드매핑)';
|
COMMENT ON COLUMN daily_work.unit_code IS '단위 (코드매핑)';
|
||||||
COMMENT ON COLUMN daily_work.owner_time IS '경영주 노동시간';
|
COMMENT ON COLUMN daily_work.owner_time IS '경영주 노동시간';
|
||||||
@@ -451,6 +451,7 @@ CREATE SEQUENCE daily_farming_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
|
|||||||
|
|
||||||
CREATE TABLE daily_farming (
|
CREATE TABLE daily_farming (
|
||||||
id bigint DEFAULT nextval('daily_farming_seq') NOT NULL, -- 농업 자가소비량 내부키
|
id bigint DEFAULT nextval('daily_farming_seq') NOT NULL, -- 농업 자가소비량 내부키
|
||||||
|
daily_record_seq bigint NOT NULL, -- 일계부 작성상태 일련번호 (FK)
|
||||||
week_date date, -- 입력차수일(yyyy-mm-dd)
|
week_date date, -- 입력차수일(yyyy-mm-dd)
|
||||||
week smallint, -- 입력차수(1,2,3,4)
|
week smallint, -- 입력차수(1,2,3,4)
|
||||||
income_code varchar(255), -- 수입 코드 (매핑코드) TODO : 필요유무
|
income_code varchar(255), -- 수입 코드 (매핑코드) TODO : 필요유무
|
||||||
@@ -469,7 +470,8 @@ CREATE TABLE daily_farming (
|
|||||||
deleted_by varchar(255), -- 삭제자
|
deleted_by varchar(255), -- 삭제자
|
||||||
is_deleted boolean DEFAULT false NOT NULL, -- 삭제여부
|
is_deleted boolean DEFAULT false NOT NULL, -- 삭제여부
|
||||||
|
|
||||||
CONSTRAINT daily_farming_pkey PRIMARY KEY (id)
|
CONSTRAINT daily_farming_pkey PRIMARY KEY (id),
|
||||||
|
CONSTRAINT fk_daily_farming__daily_record FOREIGN KEY (daily_record_seq) REFERENCES daily_record(id)
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE daily_farming IS '자가농업 생산물 중 자가소비량';
|
COMMENT ON TABLE daily_farming IS '자가농업 생산물 중 자가소비량';
|
||||||
|
|||||||
@@ -31,6 +31,50 @@ $$ LANGUAGE plpgsql;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP FUNCTION IF EXISTS fn_get_farming_status(INTEGER, VARCHAR, BOOLEAN, VARCHAR, BIGINT);
|
||||||
|
-- ============================================
|
||||||
|
-- FUNCTION : fn_get_farming_status
|
||||||
|
-- DESC : 일계부 농업 데이터 상태 표시 문자열 반환
|
||||||
|
-- - 농업 대상일(7,14,21,30일, 2월 28일) 체크
|
||||||
|
-- - 미래일/대상아님/등록건수/등록없음/미작성 상태 반환
|
||||||
|
-- PARAMS : start_day(시작일),
|
||||||
|
-- record_month(기록월),
|
||||||
|
-- is_future_day(미래일여부),
|
||||||
|
-- farming_status(농업상태),
|
||||||
|
-- farming_cnt(농업건수)
|
||||||
|
-- RETURN : TEXT (상태 표시 문자열)
|
||||||
|
-- ============================================
|
||||||
|
CREATE OR REPLACE FUNCTION fn_get_farming_status(
|
||||||
|
start_day INTEGER,
|
||||||
|
record_month VARCHAR,
|
||||||
|
is_future_day BOOLEAN,
|
||||||
|
farming_status VARCHAR,
|
||||||
|
farming_cnt BIGINT
|
||||||
|
)
|
||||||
|
RETURNS TEXT AS $$
|
||||||
|
BEGIN
|
||||||
|
-- 농업 대상일 체크
|
||||||
|
IF NOT (
|
||||||
|
start_day IN (7, 14, 21, 30)
|
||||||
|
OR (start_day = 28 AND SUBSTRING(record_month, 5, 2) = '02')
|
||||||
|
) THEN
|
||||||
|
RETURN CASE WHEN is_future_day THEN '-' ELSE '대상아님' END;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- 대상일인 경우 기존 로직
|
||||||
|
IF is_future_day THEN
|
||||||
|
RETURN '-';
|
||||||
|
ELSIF farming_status = 'TARGET' THEN
|
||||||
|
RETURN COALESCE(farming_cnt::text || '건', '0건');
|
||||||
|
ELSIF farming_status IN ('TODAY_NONE', 'NONE') THEN
|
||||||
|
RETURN '등록없음';
|
||||||
|
ELSE
|
||||||
|
RETURN '미작성';
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- ============================================
|
-- ============================================
|
||||||
-- FUNCTION : fn_monthly_input_status
|
-- FUNCTION : fn_monthly_input_status
|
||||||
|
|||||||
Reference in New Issue
Block a user