<?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.github.wxiaoqi.security.admin.mapper.AppShareholderDetailChangeRecordMapper">
    <resultMap id="appShareholderDetailMap"
               type="com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord">
        <result property="id" column="id"/>
        <result property="companyName" column="company_name"/>
        <result property="userId" column="user_id"/>
        <result property="phone" column="phone"/>
        <result property="companyId" column="company_id"/>
        <result property="name" column="name"/>
        <result property="crtTime" column="crt_time"/>
        <result property="isQuit" column="is_quit"/>
        <result property="relTime" column="rel_time"/>
    </resultMap>

    <select id="selectAppshareholderUserOrPhoneOrUserId"
            resultType="com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord">
        SELECT *from
        app_shareholder_detail_change_record
        WHERE
        1=1
        <if test="userId!=null">
            and user_id=#{userId}
        </if>
        <if test="phone!=null">
            or phone=#{phone}
        </if>
        ORDER BY crt_time DESC
    </select>


</mapper>
