<?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.ai.da.mapper.primary.TrialOrderMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ai.da.mapper.primary.entity.TrialOrder">
        <id column="id" property="id"/>
        <result column="surname" property="surname"/>
        <result column="given_name" property="givenName"/>
        <result column="user_name" property="userName"/>
        <result column="email" property="email"/>
        <result column="country" property="country"/>
        <result column="occupation" property="occupation"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>

    <select id="countOfficialUser" resultType="java.util.Map">
        select count(distinct a.user_email) as count
        from t_account a
                 inner join trial_order b
                            ON a.user_email = b.email
    </select>

</mapper>
