<?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="cn.qg.qaplatform.mapper.zdata.VccDataMapper">

    <select id="queryVccDataByStatus" resultType="cn.qg.qaplatform.entity.zdata.VccUserEntity">
        select
        `phone_no` as phoneNo,
        `user_id` as userId,
        `uuid`,
        `status`,
        `registered_from` as registeredFrom,
        `next_apply_time` as nextApplyTime,
        `created_at` as createdAt
        from account
         <where>
             status = #{status} and `type` = 'xyqb_mall'
         </where>
         order by id desc
    </select>

    <select id="queryUserVccStatus" resultType="cn.qg.qaplatform.entity.zdata.VccUserEntity">
        select
        `phone_no` as phoneNo,
        `user_id` as userId,
        `uuid`,
        `status`,
        `registered_from` as registeredFrom,
        `next_apply_time` as nextApplyTime,
        `created_at` as createdAt
        from account
        <where>
            `phone_no` = #{phoneNo}
        </where>
    </select>

    <select id="getVccRiskRecord" resultType="java.util.Map">
        SELECT * FROM `risk_record` where `uuid` = #{uuid} order by id desc limit 1
    </select>

</mapper>