CompanyMemberMappingMapper.xml 1.18 KB
<?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.subsidy.mapper.CompanyMemberMappingMapper">



    <select id="memberCompanys" parameterType="long" resultType="com.subsidy.vo.member.MemberCompanyVO">
        SELECT
            t.company_id,
            t2.company_name,
            t.create_date
        FROM
            company_member_mapping t
            LEFT JOIN company_dict t2 ON t.company_id = t2.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            AND t.member_id =#{memberId}
            order by t.create_date desc,t.id desc
    </select>

    <select id="companyAuthMembersCount" parameterType="long" resultType="integer">
        SELECT
            count(
            DISTINCT ( t2.id ))
        FROM
            company_member_mapping t
            LEFT JOIN member t2 ON t.member_id = t2.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            AND t.company_id = #{companyId}
            AND t.member_status = 1
            AND t2.first_login IS NOT NULL
    </select>
</mapper>