heheng
2025-11-28 03a3edee9ff27fa9bb4b32dcda08e279c7c094c8
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
<?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.QualityEconomyMapper">
 
    <select id="selectEconomyList" resultType="com.gkhy.exam.system.domain.QualityEconomy">
        SELECT
            qe.`id`,
            qe.`company_id`,
            sc.`name` AS company_name,
            qe.`year`,
            qe.`basic`,
            qe.`synthesize`,
            qe.`damage`,
            qe.`measure`,
            qe.`analysis`,
            qe.`suggest`,
            qe.`duty_id`,
            sd.`dept_name` as duty_name,
            qe.`duty_time`,
            qe.`del_flag`,
            qe.`create_by`,
            qe.`create_time`,
            qe.`update_by`,
            qe.`update_time`
        FROM
            `quality_economy` qe
                LEFT JOIN sys_company sc ON qe.company_id = sc.id
                LEFT JOIN sys_dept sd ON qe.duty_id = sd.dept_id
        WHERE
            qe.del_flag = 0
            <if test="companyId!=null">
                and qe.company_id = #{companyId}
            </if>
            <if test="year!=null">
                and qe.`year` = #{year}
            </if>
        ORDER BY
            qe.create_time DESC
    </select>
    <select id="selectByCompanyId" resultType="com.gkhy.exam.system.domain.QualityEconomy">
        SELECT
            *
        FROM
            `quality_economy`
        WHERE
            del_flag = 0
        <if test="companyId!=null">
            and company_id = #{companyId}
        </if>
        <if test="year!=null and year != '' ">
            and `year` = #{year}
        </if>
        <if test="id!=null">
            and id != #{id}
        </if>
    </select>
</mapper>