“djh”
11 小时以前 22308ccdd532d105598663f90a39285697f723e8
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
<?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.FactorControlMapper">
 
    <select id="selectFactorControlList" resultType="com.gkhy.exam.system.domain.FactorControl">
 
        SELECT
            fc.`id`,
            fc.`company_id`,
            sc.`name` as company_name,
            fd.dept_id,
            sd.`dept_name`,
            fc.`factor_discern_id`,
            fd.`year`,
            fc.`number`,
            fc.`frequency`,
            fc.`fiction_id`,
            su1.`name` as fiction_name,
            fc.`check_id`,
            su2.`name` as check_name,
            fc.`ratify_id`,
            su3.`name` as ratify_name,
            fc.`del_flag`,
            fc.`create_by`,
            fc.`create_time`,
            fc.`update_by`,
            fc.`update_time`
        FROM
            `factor_control` fc
                LEFT JOIN factor_discern fd on fc.factor_discern_id = fd.id
                LEFT JOIN sys_company sc ON fc.company_id = sc.id
                LEFT JOIN sys_user su1 ON fc.fiction_id = su1.id
                LEFT JOIN sys_user su2 ON fc.check_id = su2.id
                LEFT JOIN sys_user su3 ON fc.ratify_id = su3.id
                left join  sys_dept sd on fd.dept_id = sd.dept_id
        WHERE
            fc.del_flag = 1
          <if test="companyId!=null">
              AND fc.company_id = #{companyId}
          </if>
          <if test="year!=null and year!=''">
              and fd.`year` = #{year}
          </if>
        ORDER BY
            fc.create_time DESC
    </select>
    <select id="selectFactorDiscernId" resultType="com.gkhy.exam.system.domain.FactorControl">
        SELECT
        `id`,
        `company_id`,
        `factor_discern_id`,
        `number`,
        `frequency`,
        `fiction_id`,
        `check_id`,
        `ratify_id`,
        `del_flag`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`
        FROM
        `factor_control`
        WHERE
        del_flag = 1
        and factor_discern_id = #{factorDiscernId}
    </select>
</mapper>