ProjectMemberMappingMapper.xml 1.58 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.ProjectMemberMappingMapper">

    <select id="currentProject" parameterType="long" resultType="com.subsidy.vo.labor.CurrentProjectVO">
        SELECT
            t.id,
            t3.company_id,
            t2.company_name,
            t.job_name
        FROM
            project_member_mapping t
            LEFT JOIN project t3 ON t.project_id = t3.id
            LEFT JOIN company_dict t2 ON t3.company_id = t2.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            AND t3.delete_date IS NULL
            and t.member_id = #{memberId}
            and t.status = 1
    </select>

    <select id="historyProjects" parameterType="long" resultType="com.subsidy.vo.labor.HistoryProjectsVO">
        SELECT
            t.id,
            t3.company_name,
            t.job_name,
            t2.start_date,
            t2.salary_date,
            t4.labor_service_name
        FROM
            project_member_mapping t
            LEFT JOIN project t2 ON t.project_id = t2.id
            LEFT JOIN company_dict t3 ON t2.company_id = t3.id
            LEFT JOIN labor_service_dict t4 ON t2.labor_service_id = t4.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            AND t3.delete_date IS NULL
            AND t4.delete_date IS NULL
            AND t.member_id = #{memberId}
        order by t.`status` desc,t.order_no desc
    </select>

</mapper>