일단 front 내정보쪽 core->front로 이관,, 하나로 합칠지는 조금 생각해보고 정리하겠음

This commit is contained in:
주우성
2025-06-16 16:24:47 +09:00
parent f31de2ba00
commit 049afa82d7
229 changed files with 1309 additions and 1098 deletions

View File

@@ -0,0 +1,31 @@
<?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.monthly.getMonthlyInputStatus.adapters.persistence.GetMonthlyInputStatusMapper">
<select id="getMonthlyInputStatus"
resultType="app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus">
<if test="id != null">
SELECT
a.id AS id,
a.household_seq AS householdSeq,
a.month AS month,
a.forest_product_status AS forestProductStatus,
a.bank_auto_transfer_input_status AS bankAutoTransferInputStatus,
a.bank_auto_transfer_output_status AS bankAutoTransferOutputStatus,
a.created_at AS createdAt,
a.created_by AS createdBy,
a.updated_at AS updatedAt,
a.updated_by AS updatedBy
FROM monthly_input_status a
WHERE a.id = #{id}
AND a.is_deleted = false
<if test="householdSeq != null">
AND a.household_seq = #{householdSeq}
</if>
</if>
</select>
</mapper>

View File

@@ -0,0 +1,65 @@
<?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.monthly.getMonthlyInputStatuss.adapters.persistence.GetMonthlyInputStatussMapper">
<select id="getMonthlyInputStatuss"
resultType="app.module.front.usecase.info.monthly.getMonthlyInputStatuss.adapters.persistence.model.GetMonthlyInputStatussDto">
SELECT
a.id AS id,
a.household_seq AS householdSeq,
a.month AS month,
a.forest_product_status AS forestProductStatus,
a.bank_auto_transfer_input_status AS bankAutoTransferInputStatus,
a.bank_auto_transfer_output_status AS bankAutoTransferOutputStatus,
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 monthly_input_status a
WHERE a.is_deleted = false
<if test="cmd.householdSeq != null">
AND a.household_seq = ${cmd.householdSeq}
</if>
<if test="cmd.searchField != null and cmd.searchField != ''">
<choose>
<when test="cmd.searchField eq 'month'">
AND a.month ILIKE '%' || #{cmd.searchValue} || '%'
</when>
<when test="cmd.searchField eq 'household'">
AND a.household_seq = #{cmd.searchValue}
</when>
<when test="cmd.searchField eq 'updatedBy'">
AND a.updated_by ILIKE '%' || #{cmd.searchValue} || '%'
</when>
</choose>
</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,34 @@
<?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.monthly.getPrevMonthlyInputStatus.adapters.persistence.GetPrevMonthlyInputStatusMapper">
<select id="getPrevMonthlyInputStatus"
resultType="app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus">
<if test="id != null">
SELECT
a.id AS id,
a.household_seq AS householdSeq,
a.month AS month,
a.forest_product_status AS forestProductStatus,
a.bank_auto_transfer_input_status AS bankAutoTransferInputStatus,
a.bank_auto_transfer_output_status AS bankAutoTransferOutputStatus,
a.created_at AS createdAt,
a.created_by AS createdBy,
a.updated_at AS updatedAt,
a.updated_by AS updatedBy
FROM monthly_input_status a
WHERE a.is_deleted = false
AND a.forest_product_status != 'NONE'
AND a.household_seq = #{householdSeq}
AND a.month = (
SELECT TO_CHAR(TO_DATE(month, 'YYYY-MM') - INTERVAL '1 month', 'YYYY-MM')
FROM monthly_input_status
WHERE is_deleted = false AND id = #{id}
);
</if>
</select>
</mapper>

View File

@@ -0,0 +1,21 @@
<?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.monthly.updateMonthlyInputStatus.adapters.persistence.UpdateMonthlyInputStatusMapper">
<update id="updateMonthlyInputStatus">
/* updateNotice 게시글 수정 */
UPDATE monthly_input_status
SET
household_seq = #{householdSeq},
month = #{month},
forest_product_status = #{forestProductStatus},
bank_auto_transfer_input_status = #{bankAutoTransferInputStatus},
bank_auto_transfer_output_status = #{bankAutoTransferOutputStatus},
<include refid="common.fields.UpdateBaseSet"/>
WHERE id = #{id}
</update>
</mapper>