[FO] 일계부 항목 등록, 수입내역 등록 wip
This commit is contained in:
@@ -2,36 +2,29 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="app.module.front.usecase.daily.income.persistence.DailyIncomeMapper">
|
||||
|
||||
<select id="getDailyIncomeExistCount" resultType="int">
|
||||
select count(ds.*)
|
||||
from daily_income ds
|
||||
<select id="getDailyIncomeList"
|
||||
resultType="app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto">
|
||||
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit
|
||||
, ds.crop_code, ds.category_code, ds.category_self, ds.source_purpose
|
||||
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
|
||||
from daily_income ds
|
||||
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
where ds.is_deleted = false
|
||||
<if test="incomeId != null and incomeId != ''">
|
||||
and ds.id = ${incomeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDailyIncomeList">
|
||||
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, created_at, created_by
|
||||
from daily_income
|
||||
where is_deleted = false
|
||||
and daily_record_seq = 1
|
||||
and id = 1
|
||||
</select>
|
||||
|
||||
<select id="getDailyIncome">
|
||||
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, created_at, created_by
|
||||
from daily_income
|
||||
where is_deleted = false
|
||||
and daily_record_seq = 1
|
||||
and id = 1
|
||||
<select id="getDailyIncomeExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_income ds
|
||||
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
</select>
|
||||
|
||||
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into daily_income (
|
||||
daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
|
||||
daily_record_seq, is_credit, crop_code, category_code, category_self, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, created_at, created_by, is_deleted
|
||||
) values (
|
||||
@@ -49,7 +42,7 @@
|
||||
, is_credit = #{isCredit}
|
||||
, crop_code = #{cropCode}
|
||||
, category_code = #{categoryCode}
|
||||
, category_name = #{categoryName}
|
||||
, category_self = #{categorySelf}
|
||||
, source_purpose = #{sourcePurpose}
|
||||
, quantity = #{quantity}
|
||||
, unit_code = #{unitCode}
|
||||
|
||||
@@ -16,27 +16,25 @@
|
||||
and ddg.group_no = #{groupNo}
|
||||
</select>
|
||||
|
||||
<select id="getDailyRecordExistCount"
|
||||
resultType="int">
|
||||
/* 일계부 데이터 존재 여부 getDailyRecordExistCount */
|
||||
select count(*) as exist
|
||||
from daily_record dr
|
||||
where dr.household_seq = 2
|
||||
and dr.is_deleted = false
|
||||
and dr.record_month = '2025-06'
|
||||
and dr.day_group_no = 3
|
||||
<select id="getDailyRecordExistCount" resultType="int">
|
||||
select count(1) as exist
|
||||
from daily_record dr
|
||||
where dr.is_deleted = false
|
||||
and dr.household_seq = #{householdSeq}
|
||||
and dr.record_month = #{searchMonth}
|
||||
and dr.day_group_no = #{groupNo}
|
||||
</select>
|
||||
|
||||
<insert id="createDailyRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into daily_record (
|
||||
household_seq, record_month, day_group_no, start_date, end_date
|
||||
, all_status, income_status, work_status, expense_status, power_status, forestry_status
|
||||
, all_status, income_status, work_status, expense_status, power_status, forestry_status, farming_status
|
||||
, is_deleted
|
||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) values (
|
||||
#{householdSeq}
|
||||
, #{recordMonth}, #{dayGroupNo}, #{startDate}, #{endDate}
|
||||
, #{allStatus}, #{incomeStatus}, #{workStatus}, #{expenseStatus}, #{powerStatus}, #{forestryStatus}
|
||||
, #{allStatus}, #{incomeStatus}, #{workStatus}, #{expenseStatus}, #{powerStatus}, #{forestryStatus}, #{farmingStatus}
|
||||
, false
|
||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
@@ -62,11 +60,10 @@
|
||||
</update>
|
||||
|
||||
<sql id="InnerJoinByDailyRecord">
|
||||
/* TODO */
|
||||
inner join daily_record dr on
|
||||
dr.id = ds.daily_record_seq
|
||||
and dr.is_deleted = false
|
||||
and dr.recordMonth = #{recordMonth} and dr.day_group_no = #{dayGroupNo}
|
||||
and dr.record_month = #{searchMonth} and dr.day_group_no = #{groupNo}
|
||||
and dr.household_seq = #{householdSeq}
|
||||
</sql>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user