<?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.xxfc.platform.universal.mapper.MemberInfoMapper">
  <resultMap id="BaseResultMap" type="com.xxfc.platform.universal.entity.MemberInfo">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="sex" jdbcType="BIT" property="sex" />
    <result column="card_number" jdbcType="VARCHAR" property="cardNumber" />
    <result column="birthday" jdbcType="TIMESTAMP" property="birthday" />
    <result column="id_number" jdbcType="VARCHAR" property="idNumber" />
    <result column="certificate_address" jdbcType="VARCHAR" property="certificateAddress" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="wx" jdbcType="VARCHAR" property="wx" />
    <result column="member_type" jdbcType="TINYINT" property="memberType" />
    <result column="telephone" jdbcType="VARCHAR" property="telephone" />
    <result column="mobile_phone" jdbcType="VARCHAR" property="mobilePhone" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="workplace" jdbcType="VARCHAR" property="workplace" />
    <result column="job" jdbcType="VARCHAR" property="job" />
    <result column="inviter" jdbcType="VARCHAR" property="inviter" />
    <result column="profession" jdbcType="VARCHAR" property="profession" />
    <result column="pay_type" jdbcType="TINYINT" property="payType" />
    <result column="member_signature_date" jdbcType="TIMESTAMP" property="memberSignatureDate" />
    <result column="manager" jdbcType="VARCHAR" property="manager" />
    <result column="manager_signature_date" jdbcType="TIMESTAMP" property="managerSignatureDate" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="create_user_id" jdbcType="INTEGER" property="createUserId" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="state" jdbcType="TINYINT" property="state" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    id, name, sex, card_number, birthday, id_number, certificate_address, email, wx, 
    member_type, telephone, mobile_phone, address, workplace, job, inviter, profession, 
    pay_type, member_signature_date, manager, manager_signature_date, create_date, create_user_id, 
    create_user_name, state
  </sql>

  <resultMap id="MemberInfoVoResultMap" type="com.xxfc.platform.universal.vo.MemberInfoVo">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="sex" jdbcType="BIT" property="sex" />
    <result column="card_number" jdbcType="VARCHAR" property="cardNumber" />
    <result column="birthday" jdbcType="VARCHAR" property="birthday" />
    <result column="id_number" jdbcType="VARCHAR" property="idNumber" />
    <result column="certificate_address" jdbcType="VARCHAR" property="certificateAddress" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="wx" jdbcType="VARCHAR" property="wx" />
    <result column="member_type" jdbcType="TINYINT" property="memberType" />
    <result column="telephone" jdbcType="VARCHAR" property="telephone" />
    <result column="mobile_phone" jdbcType="VARCHAR" property="mobilePhone" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="workplace" jdbcType="VARCHAR" property="workplace" />
    <result column="job" jdbcType="VARCHAR" property="job" />
    <result column="inviter" jdbcType="VARCHAR" property="inviter" />
    <result column="profession" jdbcType="VARCHAR" property="profession" />
    <result column="pay_type" jdbcType="TINYINT" property="payType" />
    <result column="member_signature_date" jdbcType="TIMESTAMP" property="memberSignatureDate" />
    <result column="manager" jdbcType="VARCHAR" property="manager" />
    <result column="manager_signature_date" jdbcType="TIMESTAMP" property="managerSignatureDate" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="create_user_id" jdbcType="INTEGER" property="createUserId" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="state" jdbcType="TINYINT" property="state" />
    <collection column="memberId=id" javaType="ArrayList" ofType="com.xxfc.platform.universal.entity.MemberFamilyInfo" property="family" select="selectFamilyInfoByMemberId" />
  </resultMap>
  <select id="selectVoAll" resultMap="MemberInfoVoResultMap">
      select * from member_info
    </select>

  <select id="selectFamilyInfoByMemberId" resultType="com.xxfc.platform.universal.entity.MemberFamilyInfo">
      select * from member_family_info where member_id = #{memberId}
    </select>
  <select id="selectVoByName" resultMap="MemberInfoVoResultMap">
    select * from member_info
    where name = #{name}
  </select>
</mapper>