“djh”
2025-12-03 cac939bb4469b181844f0537fc6866fc23da9054
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
<?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.TrainPlanMapper">
 
    <select id="selectTrainPlan" resultType="com.gkhy.exam.system.domain.TrainPlan">
        SELECT
            tp.`id`,
            tp.`company_id`,
            sc.`name` as company_name,
            tp.`train_name`,
            tp.`train_time`,
            tp.`dept_id`,
            sd.dept_name,
            tp.`train_object`,
            tp.`num`,
            tp.`hour`,
            tp.`money`,
            tp.`modality`,
            tp.`status`,
            tp.`del_flag`,
            tp.`create_by`,
            tp.`create_time`,
            tp.`update_by`,
            tp.`update_time`
 
        FROM `train_plan`  tp
                 LEFT JOIN sys_company sc on tp.company_id = sc.id
                 LEFT JOIN sys_dept sd on tp.dept_id = sd.dept_id
        WHERE tp.del_flag = 1
          <if test="companyId!=null">
              and tp.company_id = #{companyId}
          </if>
        ORDER BY tp.create_time ASC
    </select>
    <select id="selectByCompanyId" resultType="com.gkhy.exam.system.domain.TrainPlan">
        SELECT
        `id`,
        `company_id`,
        `train_name`,
        `train_time`,
        `dept_id`,
        `train_object`,
        `num`,
        `hour`,
        `money`,
        `modality`,
        `status`,
        `del_flag`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`
        FROM
        `train_plan`
        WHERE
        del_flag = 1
        AND `status` = 0
        <if test="companyId!=null">
            and company_id = #{companyId}
        </if>
    </select>
</mapper>