<?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.qmth.sop.business.mapper.TBUserArchivesSupplierMapper">
    <!--<select id="findUsers" resultType="com.qmth.sop.business.entity.SysUser">
        SELECT u.* from t_b_user_archives_supplier us
        left join t_b_user_archives ua on ua.id=us.user_archives_id
        left join sys_user u on u.mobile_number=ua.mobile_number
        where us.supplier_id=#{supplierId}
    </select>-->
    <select id="findUsersBySupplierId" resultType="com.qmth.sop.business.entity.SysUser">
        SELECT u.* from t_b_user_archives_supplier us
        left join t_b_user_archives ua on ua.id=us.user_archives_id
        left join sys_user u on u.mobile_number=ua.mobile_number
        where us.supplier_id=#{supplierId}
    </select>
    <select id="countAuthentication" resultType="java.lang.Integer">
        SELECT
        count( DISTINCT us.user_archives_id )
        FROM
        t_b_user_archives_supplier us
        WHERE
        us.authentication_valid_time > UNIX_TIMESTAMP()*1000
    </select>

</mapper>
