<?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="com.yd.dal.mapper.customer.AclPractitionerHiringMembershipMapper">
  <resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerHiringMembership">
    <!--@mbg.generated-->
    <!--@Table ag_acl_practitioner_hiring_membership-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="hiring_basic_info_id" jdbcType="BIGINT" property="hiringBasicInfoId" />
    <result column="md_drop_option_id" jdbcType="BIGINT" property="mdDropOptionId" />
    <result column="md_drop_option_name" jdbcType="VARCHAR" property="mdDropOptionName" />
    <result column="mentor_practitioner_id" jdbcType="VARCHAR" property="mentorPractitionerId" />
    <result column="mentor" jdbcType="VARCHAR" property="mentor" />
    <result column="introducer_practitioner_id" jdbcType="VARCHAR" property="introducerPractitionerId" />
    <result column="introducer" jdbcType="VARCHAR" property="introducer" />
    <result column="subsystem_id" jdbcType="VARCHAR" property="subsystemId" />
    <result column="subsystem" jdbcType="VARCHAR" property="subsystem" />
    <result column="subsystem_owner_id" jdbcType="VARCHAR" property="subsystemOwnerId" />
    <result column="subsystem_owner" jdbcType="VARCHAR" property="subsystemOwner" />
    <result column="branch_id" jdbcType="VARCHAR" property="branchId" />
    <result column="branch" jdbcType="VARCHAR" property="branch" />
    <result column="is_active" jdbcType="INTEGER" property="isActive" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="BIGINT" property="createdBy" />
    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
    <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
    <result column="approved_by" jdbcType="BIGINT" property="approvedBy" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, hiring_basic_info_id, md_drop_option_id, md_drop_option_name, mentor_practitioner_id, 
    mentor, introducer_practitioner_id, introducer, subsystem_id, subsystem, subsystem_owner_id, 
    subsystem_owner, branch_id, branch, is_active, created_at, created_by, 
    updated_at, updated_by, approved_by
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from ag_acl_practitioner_hiring_membership
    where id = #{id,jdbcType=BIGINT}
  </select>

  <select id="queryByhiringBasicInfoId" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from ag_acl_practitioner_hiring_membership
    where hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from ag_acl_practitioner_hiring_membership
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerHiringMembership" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ag_acl_practitioner_hiring_membership (hiring_basic_info_id, md_drop_option_id, 
      md_drop_option_name, mentor_practitioner_id, 
      mentor, introducer_practitioner_id, introducer, 
      subsystem_id, subsystem, subsystem_owner_id, 
      subsystem_owner, branch_id, branch, 
      is_active, created_at, created_by, 
      updated_at, updated_by)
    values (#{hiringBasicInfoId,jdbcType=BIGINT}, #{mdDropOptionId,jdbcType=BIGINT}, 
      #{mdDropOptionName,jdbcType=VARCHAR}, #{mentorPractitionerId,jdbcType=VARCHAR}, 
      #{mentor,jdbcType=VARCHAR}, #{introducerPractitionerId,jdbcType=VARCHAR}, #{introducer,jdbcType=VARCHAR}, 
      #{subsystemId,jdbcType=VARCHAR}, #{subsystem,jdbcType=VARCHAR}, #{subsystemOwnerId,jdbcType=VARCHAR}, 
      #{subsystemOwner,jdbcType=VARCHAR}, #{branchId,jdbcType=VARCHAR}, #{branch,jdbcType=VARCHAR}, 
      #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, 
      #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerHiringMembership" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ag_acl_practitioner_hiring_membership
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="hiringBasicInfoId != null">
        hiring_basic_info_id,
      </if>
      <if test="mdDropOptionId != null">
        md_drop_option_id,
      </if>
      <if test="mdDropOptionName != null">
        md_drop_option_name,
      </if>
      <if test="mentorPractitionerId != null">
        mentor_practitioner_id,
      </if>
      <if test="mentor != null">
        mentor,
      </if>
      <if test="introducerPractitionerId != null">
        introducer_practitioner_id,
      </if>
      <if test="introducer != null">
        introducer,
      </if>
      <if test="subsystemId != null">
        subsystem_id,
      </if>
      <if test="subsystem != null">
        subsystem,
      </if>
      <if test="subsystemOwnerId != null">
        subsystem_owner_id,
      </if>
      <if test="subsystemOwner != null">
        subsystem_owner,
      </if>
      <if test="branchId != null">
        branch_id,
      </if>
      <if test="branch != null">
        branch,
      </if>
      <if test="isActive != null">
        is_active,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="updatedAt != null">
        updated_at,
      </if>
      <if test="updatedBy != null">
        updated_by,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="hiringBasicInfoId != null">
        #{hiringBasicInfoId,jdbcType=BIGINT},
      </if>
      <if test="mdDropOptionId != null">
        #{mdDropOptionId,jdbcType=BIGINT},
      </if>
      <if test="mdDropOptionName != null">
        #{mdDropOptionName,jdbcType=VARCHAR},
      </if>
      <if test="mentorPractitionerId != null">
        #{mentorPractitionerId,jdbcType=BIGINT},
      </if>
      <if test="mentor != null">
        #{mentor,jdbcType=VARCHAR},
      </if>
      <if test="introducerPractitionerId != null">
        #{introducerPractitionerId,jdbcType=BIGINT},
      </if>
      <if test="introducer != null">
        #{introducer,jdbcType=VARCHAR},
      </if>
      <if test="subsystemId != null">
        #{subsystemId,jdbcType=BIGINT},
      </if>
      <if test="subsystem != null">
        #{subsystem,jdbcType=VARCHAR},
      </if>
      <if test="subsystemOwnerId != null">
        #{subsystemOwnerId,jdbcType=BIGINT},
      </if>
      <if test="subsystemOwner != null">
        #{subsystemOwner,jdbcType=VARCHAR},
      </if>
      <if test="branchId != null">
        #{branchId,jdbcType=BIGINT},
      </if>
      <if test="branch != null">
        #{branch,jdbcType=VARCHAR},
      </if>
      <if test="isActive != null">
        #{isActive,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="updatedAt != null">
        #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerHiringMembership">
    <!--@mbg.generated-->
    update ag_acl_practitioner_hiring_membership
    <set>
      <if test="hiringBasicInfoId != null">
        hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT},
      </if>
      <if test="mdDropOptionId != null">
        md_drop_option_id = #{mdDropOptionId,jdbcType=BIGINT},
      </if>
      <if test="mdDropOptionName != null">
        md_drop_option_name = #{mdDropOptionName,jdbcType=VARCHAR},
      </if>
      <if test="mentorPractitionerId != null">
        mentor_practitioner_id = #{mentorPractitionerId,jdbcType=VARCHAR},
      </if>
      <if test="mentor != null">
        mentor = #{mentor,jdbcType=VARCHAR},
      </if>
      <if test="introducerPractitionerId != null">
        introducer_practitioner_id = #{introducerPractitionerId,jdbcType=VARCHAR},
      </if>
      <if test="introducer != null">
        introducer = #{introducer,jdbcType=VARCHAR},
      </if>
      <if test="subsystemId != null">
        subsystem_id = #{subsystemId,jdbcType=VARCHAR},
      </if>
      <if test="subsystem != null">
        subsystem = #{subsystem,jdbcType=VARCHAR},
      </if>
      <if test="subsystemOwnerId != null">
        subsystem_owner_id = #{subsystemOwnerId,jdbcType=VARCHAR},
      </if>
      <if test="subsystemOwner != null">
        subsystem_owner = #{subsystemOwner,jdbcType=VARCHAR},
      </if>
      <if test="branchId != null">
        branch_id = #{branchId,jdbcType=VARCHAR},
      </if>
      <if test="branch != null">
        branch = #{branch,jdbcType=VARCHAR},
      </if>
      <if test="isActive != null">
        is_active = #{isActive,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="updatedAt != null">
        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        updated_by = #{updatedBy,jdbcType=BIGINT},
      </if>
      <if test="approvedBy != null">
        approved_by = #{approvedBy,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerHiringMembership">
    <!--@mbg.generated-->
    update ag_acl_practitioner_hiring_membership
    set hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT},
      md_drop_option_id = #{mdDropOptionId,jdbcType=BIGINT},
      md_drop_option_name = #{mdDropOptionName,jdbcType=VARCHAR},
      mentor_practitioner_id = #{mentorPractitionerId,jdbcType=VARCHAR},
      mentor = #{mentor,jdbcType=VARCHAR},
      introducer_practitioner_id = #{introducerPractitionerId,jdbcType=VARCHAR},
      introducer = #{introducer,jdbcType=VARCHAR},
      subsystem_id = #{subsystemId,jdbcType=VARCHAR},
      subsystem = #{subsystem,jdbcType=VARCHAR},
      subsystem_owner_id = #{subsystemOwnerId,jdbcType=VARCHAR},
      subsystem_owner = #{subsystemOwner,jdbcType=VARCHAR},
      branch_id = #{branchId,jdbcType=VARCHAR},
      branch = #{branch,jdbcType=VARCHAR},
      is_active = #{isActive,jdbcType=INTEGER},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      updated_by = #{updatedBy,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ag_acl_practitioner_hiring_membership
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="hiring_basic_info_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.hiringBasicInfoId,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="md_drop_option_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.mdDropOptionId,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="md_drop_option_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.mdDropOptionName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="mentor_practitioner_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.mentorPractitionerId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="mentor = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.mentor,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="introducer_practitioner_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.introducerPractitionerId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="introducer = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.introducer,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="subsystem_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.subsystemId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="subsystem = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.subsystem,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="subsystem_owner_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.subsystemOwnerId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="subsystem_owner = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.subsystemOwner,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="branch_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.branchId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="branch = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.branch,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="is_active = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="created_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="created_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="updated_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="updated_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ag_acl_practitioner_hiring_membership
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="hiring_basic_info_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.hiringBasicInfoId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.hiringBasicInfoId,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="md_drop_option_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.mdDropOptionId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.mdDropOptionId,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="md_drop_option_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.mdDropOptionName != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.mdDropOptionName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="mentor_practitioner_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.mentorPractitionerId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.mentorPractitionerId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="mentor = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.mentor != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.mentor,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="introducer_practitioner_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.introducerPractitionerId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.introducerPractitionerId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="introducer = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.introducer != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.introducer,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="subsystem_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.subsystemId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.subsystemId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="subsystem = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.subsystem != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.subsystem,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="subsystem_owner_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.subsystemOwnerId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.subsystemOwnerId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="subsystem_owner = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.subsystemOwner != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.subsystemOwner,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="branch_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.branchId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.branchId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="branch = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.branch != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.branch,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="is_active = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.isActive != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="created_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createdAt != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="created_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createdBy != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="updated_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updatedAt != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="updated_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updatedBy != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
  <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ag_acl_practitioner_hiring_membership
    (hiring_basic_info_id, md_drop_option_id, md_drop_option_name, mentor_practitioner_id, 
      mentor, introducer_practitioner_id, introducer, subsystem_id, subsystem, subsystem_owner_id, 
      subsystem_owner, branch_id, branch, is_active, created_at, created_by, 
      updated_at, updated_by)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.hiringBasicInfoId,jdbcType=BIGINT}, #{item.mdDropOptionId,jdbcType=BIGINT}, 
        #{item.mdDropOptionName,jdbcType=VARCHAR}, #{item.mentorPractitionerId,jdbcType=VARCHAR}, 
        #{item.mentor,jdbcType=VARCHAR}, #{item.introducerPractitionerId,jdbcType=VARCHAR}, 
        #{item.introducer,jdbcType=VARCHAR}, #{item.subsystemId,jdbcType=VARCHAR}, #{item.subsystem,jdbcType=VARCHAR}, 
        #{item.subsystemOwnerId,jdbcType=VARCHAR}, #{item.subsystemOwner,jdbcType=VARCHAR}, 
        #{item.branchId,jdbcType=VARCHAR}, #{item.branch,jdbcType=VARCHAR}, 
        #{item.isActive,jdbcType=INTEGER}, #{item.createdAt,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=BIGINT}, 
        #{item.updatedAt,jdbcType=TIMESTAMP}, #{item.updatedBy,jdbcType=BIGINT})
    </foreach>
  </insert>

  <select id="selectByHiringBasicInfoId" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from ag_acl_practitioner_hiring_membership
    where hiring_basic_info_id = #{basicInfoId,jdbcType=BIGINT}
  </select>

  <select id="isMentor" resultType="java.lang.Integer">
    select count(1)
    from ag_acl_practitioner_hiring_membership m
    where m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}
  </select>

  <select id="isSystemOwner" resultType="java.lang.Integer">
    select count(1)
    from ag_acl_practitioner_hiring_membership m
    where m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}
  </select>

</mapper>