[BO] 임가 현황 - 임가 등록 작업 중 (5)
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
<?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.createHousehold.adapters.persistence.CreateHouseholdMapper">
|
||||
|
||||
<insert id="createHousehold">
|
||||
<selectKey keyProperty="seq" resultType="long" order="BEFORE">
|
||||
SELECT nextval('household_seq')
|
||||
</selectKey>
|
||||
|
||||
INSERT INTO household (
|
||||
seq,
|
||||
household_num,
|
||||
owner_name,
|
||||
owner_age,
|
||||
<if test="tel != null and tel != ''">
|
||||
tel,
|
||||
</if>
|
||||
phone,
|
||||
password,
|
||||
region_main_code,
|
||||
region_sub_code,
|
||||
region_detail_code,
|
||||
address,
|
||||
<if test="industryLargeCode != null and industryLargeCode != ''">
|
||||
industry_large_code,
|
||||
</if>
|
||||
<if test="industryMiddleCode != null and industryMiddleCode != ''">
|
||||
industry_middle_code,
|
||||
</if>
|
||||
<if test="industrySubMiddle != null and industrySubMiddle != ''">
|
||||
industry_sub_middle,
|
||||
</if>
|
||||
<if test="industryDetail != null and industryDetail != ''">
|
||||
industry_detail,
|
||||
</if>
|
||||
<!-- <if test="employmentCode != null or employmentCode != ''">-->
|
||||
<!-- employment_code,-->
|
||||
<!-- </if>-->
|
||||
is_panel,
|
||||
<if test="memo != null and memo != ''">
|
||||
memo,
|
||||
</if>
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) VALUES (
|
||||
#{seq},
|
||||
#{householdNum},
|
||||
#{ownerName},
|
||||
#{ownerAge},
|
||||
<if test="tel != null and tel != ''">
|
||||
#{tel},
|
||||
</if>
|
||||
#{phone},
|
||||
#{encodedPassword},
|
||||
#{regionMainCode},
|
||||
#{regionSubCode},
|
||||
#{regionDetailCode},
|
||||
#{address},
|
||||
<if test="industryLargeCode != null and industryLargeCode != ''">
|
||||
#{industryLargeCode},
|
||||
</if>
|
||||
<if test="industryMiddleCode != null and industryMiddleCode != ''">
|
||||
#{industryMiddleCode},
|
||||
</if>
|
||||
<if test="industrySubMiddle != null and industrySubMiddle != ''">
|
||||
#{industrySubMiddle},
|
||||
</if>
|
||||
<if test="industryDetail != null and industryDetail != ''">
|
||||
#{industryDetail},
|
||||
</if>
|
||||
<!-- <if test="employmentCode != null or employmentCode != ''">-->
|
||||
<!-- #{employmentCode},-->
|
||||
<!-- </if>-->
|
||||
#{isPanel},
|
||||
<if test="memo != null and memo != ''">
|
||||
#{memo},
|
||||
</if>
|
||||
<include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="createHouseholdHasRole">
|
||||
INSERT INTO household_has_role (id,
|
||||
household_seq,
|
||||
role_id,
|
||||
<include refid="common.fields.CreateUpdateBaseColumns"/>)
|
||||
VALUES
|
||||
<foreach collection="roleIds" item="roleId" separator=",">
|
||||
(
|
||||
nextval('household_has_role_seq'),
|
||||
#{householdSeq},
|
||||
#{roleId},
|
||||
<include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user