자동이체 - 수입 완료 (형태 변경 아직 필요)

This commit is contained in:
주우성
2025-06-17 20:13:45 +09:00
parent 9a215b1221
commit 3f9b74d1f6
37 changed files with 920 additions and 28 deletions

View File

@@ -0,0 +1,57 @@
<?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.front.usecase.info.bank.createBank.adapters.persistence.CreateBankMapper">
<insert id="createBank" keyProperty="id">
<selectKey keyProperty="id" order="BEFORE" resultType="long">
SELECT nextval('bank_auto_transfer_seq')
</selectKey>
INSERT INTO bank_auto_transfer (
id,
household_seq,
transfer_type,
crop_code,
transfer_category_code,
transfer_category,
income_code,
expense_code,
source_purpose,
count,
unit_code,
price,
month,
monthly_input_status_id,
created_at,
created_by,
updated_at,
updated_by,
is_deleted
) VALUES (
#{id},
#{householdSeq},
#{transferType},
#{cropCode},
#{transferCategoryCode},
#{transferCategory},
#{incomeCode},
#{expenseCode},
#{sourcePurpose},
#{count},
#{unitCode},
#{price},
#{month},
#{monthlyInputStatusId},
#{createdAt},
#{createdBy},
#{createdAt},
#{createdBy},
false
)
</insert>
</mapper>

View File

@@ -0,0 +1,67 @@
<?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.front.usecase.info.bank.getBanks.adapters.persistence.GetBanksMapper">
<select id="getBanks"
resultType="app.module.front.usecase.info.bank.getBanks.adapters.persistence.model.GetBanksDto">
SELECT
a.id AS id,
a.household_seq AS householdSeq,
a.transfer_type AS transferType,
a.crop_code AS cropCode,
a.transfer_category_code AS transferCategoryCode,
a.transfer_category AS transferCategory,
a.income_code AS incomeCode,
a.expense_code AS expenseCode,
a.source_purpose AS sourcePurpose,
a.count AS count,
a.unit_code AS unitCode,
a.price AS price,
a.month AS month,
a.monthly_input_status_id AS monthlyInputStatusId,
a.created_at AS createdAt,
a.created_by AS createdBy,
a.updated_at AS updatedAt,
a.updated_by AS updatedBy,
COUNT(*) OVER () AS total
FROM bank_auto_transfer a
WHERE a.is_deleted = false
<if test="cmd.monthlyInputStatusId != null">
AND a.monthly_input_status_id = #{cmd.monthlyInputStatusId}
</if>
<if test="cmd.householdSeq != null">
AND a.household_seq = #{cmd.householdSeq}
</if>
<if test="pageable.sort != null and !pageable.sort.isEmpty()">
ORDER BY
<foreach collection="pageable.sort" item="order" separator=",">
<choose>
<when test="order.property eq 'household'">a.household_seq</when>
<when test="order.property eq 'updatedBy'">a.updated_by</when>
<when test="order.property eq 'updatedAt'">a.updated_at</when>
<when test="order.property eq 'createdBy'">a.created_by</when>
<when test="order.property eq 'createdAt'">a.created_at</when>
<otherwise>a.id</otherwise>
</choose>
<choose>
<when test="order.direction.toString() eq 'DESC'">DESC</when>
<otherwise>ASC</otherwise>
</choose>
</foreach>
OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY
</if>
</select>
</mapper>

View File

@@ -0,0 +1,16 @@
<?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.front.usecase.info.bank.removeBanks.adapters.persistence.RemoveBanksMapper">
<update id="deleteBanks">
UPDATE bank_auto_transfer
SET <include refid="common.fields.DeleteBaseSet" />
WHERE
household_seq = #{householdSeq}
AND monthly_input_status_id = #{monthlyInputStatusId}
AND transfer_type = #{transferType}
</update>
</mapper>

View File

@@ -7,7 +7,7 @@
<insert id="createForestProduct" keyProperty="id">
<!-- createForestProduct 게시글 등록 -->
<selectKey keyProperty="id" order="BEFORE" resultType="long">
SELECT nextval('notice_seq')
SELECT nextval('monthly_input_status_seq')
</selectKey>
INSERT INTO forest_product (

View File

@@ -9,7 +9,7 @@
SET <include refid="common.fields.DeleteBaseSet" />
WHERE
household_seq = #{householdSeq}
AND monthly_input_status_id = #{id}
AND monthly_input_status_id = #{monthlyInputStatusId}
</update>