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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| <?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.gkhy.exam.system.mapper.UseSealApplyMapper">
|
| <select id="selectUseApplyList" resultType="com.gkhy.exam.system.domain.UseSealApply">
| SELECT
| usa.`id`,
| usa.`company_id`,
| sc.`name` as company_name,
| usa.`apply_user_id`,
| su.`name` as apply_user_name,
| usa.`apply_dept_id`,
| sd.`dept_name` as apply_dept_name,
| usa.`apply_time`,
| usa.`seal_id`,
| st.`seal_name`,
| usa.`amount`,
| usa.`use_seal_time`,
| usa.`use_seal_cause`,
| usa.`is_red`,
| usa.`del_flag`,
| usa.`create_by`,
| usa.`create_time`,
| usa.`update_by`,
| usa.`update_time`,
| usa.`status`,
| usa.`next_check`
| FROM
| `use_seal_apply` usa
| LEFT JOIN sys_user su on usa.apply_user_id = su.id
| LEFT JOIN sys_dept sd on usa.apply_dept_id = sd.dept_id
| LEFT JOIN sys_company sc on usa.company_id = sc.id
| LEFT JOIN seal_type st on usa.seal_id= st.id
| WHERE usa.del_flag =0
| <if test="companyId!=null">
| and usa.company_id = #{companyId}
| </if>
| <if test="applyUserId!=null">
| and usa.apply_user_id = #{applyUserId}
| </if>
| <if test="nextCheck!=null">
| and usa.next_check = #{nextCheck} and usa.status = 1
| </if>
| ORDER BY usa.create_time DESC
| </select>
|
| <select id="selectUseApplyByUserId" resultType="com.gkhy.exam.system.domain.UseSealApply">
| SELECT
| usa.`id`,
| usa.`company_id`,
| usa.`apply_user_id`,
| su.`name` as apply_user_name,
| usa.`apply_dept_id`,
| sd.`dept_name` as apply_dept_name,
| usa.`apply_time`,
| usa.`seal_id`,
| st.`seal_name`,
| usa.`amount`,
| usa.`use_seal_time`,
| usa.`use_seal_cause`,
| usa.`is_red`,
| usa.`del_flag`,
| usa.`status`,
| usa.`next_check`
| FROM
| `use_seal_apply` usa
| LEFT JOIN sys_user su on usa.apply_user_id = su.id
| LEFT JOIN sys_dept sd on usa.apply_dept_id = sd.dept_id
| LEFT JOIN seal_type st on usa.seal_id= st.id
| WHERE usa.del_flag =0 and usa.status = 1 and usa.next_check = #{userId}
| </select>
| </mapper>
|
|