Blame view

CompanyMemberMappingMapper.xml 1.18 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
<?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>