ProjectMemberMappingMapper.xml
1.65 KB
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
37
38
39
40
41
42
43
44
45
46
47
<?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
order by t.create_date desc
limit 1
</select>
<select id="historyProjects" parameterType="long" resultType="com.subsidy.vo.labor.HistoryProjectsVO">
SELECT
t.id,
t3.company_name,
t.job_name,
t.create_date 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>