Blame view

ProjectMemberMappingMapper.xml 1.65 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<?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
涂亚平 committed
21 22
            order by t.create_date desc
            limit 1
涂亚平 committed
23 24 25 26 27 28 29
    </select>

    <select id="historyProjects" parameterType="long" resultType="com.subsidy.vo.labor.HistoryProjectsVO">
        SELECT
            t.id,
            t3.company_name,
            t.job_name,
涂亚平 committed
30
            t.create_date start_date,
涂亚平 committed
31 32 33 34 35 36 37 38
            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
涂亚平 committed
39 40
            t.delete_date is null
            and t2.delete_date IS NULL
涂亚平 committed
41 42 43 44 45 46 47
            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>