104 lines
3.6 KiB
XML
104 lines
3.6 KiB
XML
<?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">
|
|
|
|
<update id="createHousehold">
|
|
/* createHousehold : 임가 등록 */
|
|
<selectKey keyProperty="seq" resultType="long" order="BEFORE">
|
|
SELECT nextval('household_seq')
|
|
</selectKey>
|
|
|
|
INSERT INTO household (
|
|
seq,
|
|
household_num,
|
|
owner_name,
|
|
owner_age,
|
|
tel,
|
|
phone,
|
|
password,
|
|
region_main_code,
|
|
region_sub_code,
|
|
region_detail_code,
|
|
address,
|
|
industry_large_code,
|
|
industry_middle_code,
|
|
industry_sub_middle,
|
|
industry_detail,
|
|
is_panel,
|
|
usage_type,
|
|
employment_type,
|
|
<if test="memo != null and memo != ''">
|
|
memo,
|
|
</if>
|
|
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
|
) VALUES (
|
|
#{seq},
|
|
#{householdNum},
|
|
#{ownerName},
|
|
#{ownerAge},
|
|
#{tel},
|
|
#{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>
|
|
#{isPanel},
|
|
#{usageType},
|
|
#{employmentType},
|
|
<if test="memo != null and memo != ''">
|
|
#{memo},
|
|
</if>
|
|
<include refid="common.fields.CreateUpdateBaseValues"/>
|
|
)
|
|
</update>
|
|
|
|
<insert id="createHouseholdHasRole">
|
|
/* 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>
|
|
|
|
<insert id="createResearcherHasHousehold">
|
|
/* createResearcherHasHousehold : 임가 등록 시 담당 조사원 매핑 */
|
|
INSERT INTO researcher_has_household
|
|
(
|
|
id,
|
|
household_seq,
|
|
admin_seq,
|
|
<include refid="common.fields.CreateUpdateBaseColumns"/>
|
|
)
|
|
VALUES
|
|
(
|
|
nextval('researcher_has_household_seq'),
|
|
#{householdSeq},
|
|
#{researcherSeq},
|
|
<include refid="common.fields.CreateUpdateBaseValues"/>
|
|
)
|
|
</insert>
|
|
</mapper> |