<?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.mmc.iuav.user.dao.xzsz.XzDao">

    <insert id="addAuth" parameterType="com.mmc.iuav.user.entity.XzAuthDO" useGeneratedKeys="true" keyProperty="id">
        insert into xz_auth(user_account_id, `name`, id_card_no, mobile, bank_account, subsidiary_name, document_id,
                            custom_params, contract_url, xz_auth_status, create_time)
        values (#{userAccountId}, #{name}, #{idCardNo}, #{mobile}, #{bankAccount}, #{subsidiary_name}, #{document_id},
                #{customParams}, #{contract_url}, #{xzAuthStatus}, NOW())
    </insert>

    <select id="getXzAuthByUserAccountId" resultType="com.mmc.iuav.user.entity.XzAuthDO">
        select id,
               user_account_id,
               `name`,
               id_card_no,
               mobile,
               bank_account,
               subsidiary_name,
               document_id,
               custom_params,
               contract_url,
               create_time,
               xz_auth_status
        from xz_auth
        where user_account_id = #{userAccountId}
          and is_deleted = 0
    </select>
</mapper>
