“djh”
2025-11-26 cf4a5deced71464d424ce5931774f6df0c4c6bb3
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?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.CompanySummaryMapper">
    <update id="updateSummaryById">
        UPDATE company_summary
        <set>
            <if test="companyId != null and companyId != ''" >
                company_id = #{companyId},
            </if>
            <if test="companyName != null and companyName != ''" >
                company_name = #{companyName},
            </if>
            <if test="companySummary != null and companySummary !=''" >
                company_summary = #{companySummary},
            </if>
            <if test="companyType != null " >
                company_type = #{companyType},
            </if>
            <if test="industry != null and industry != ''" >
                industry = #{industry},
            </if>
            <if test="legalPersonCode != null and legalPersonCode != ''" >
                legal_person_code = #{legalPersonCode},
            </if>
            <if test="legalPerson != null and legalPerson != ''" >
                legal_person = #{legalPerson},
            </if>
            <if test="registeredCapital != null and registeredCapital != ''" >
                registered_capital = #{registeredCapital},
            </if>
            <if test="officeAddress != null and officeAddress != ''" >
                office_address = #{officeAddress},
            </if>
            <if test="otherAddress != null and otherAddress != ''" >
                other_address = #{otherAddress},
            </if>
            <if test="filePath!=null and filePath != ''">
                file_path = #{filePath},
            </if>
            <if test="fileName!=null and fileName != ''">
                file_name = #{fileName},
            </if>
            <if test="delFlag != null and delFlag != ''" >
                del_flag = #{delFlag},
            </if>
            <if test="createBy != null" >
                create_by = #{createBy},
            </if>
            <if test="createTime != null" >
                create_time = #{createTime},
            </if>
            <if test="updateBy != null" >
                update_by = #{updateBy},
            </if>
            <if test="updateTime != null" >
                update_time = #{updateTime}
            </if>
        </set>
        where id = #{id}
    </update>
 
    <select id="selectCompanySummaryList" resultType="com.gkhy.exam.system.domain.CompanySummary">
        SELECT
        cs.`id`,
        cs.`company_id`,
        sc.`name` as company_name,
        cs.`company_summary`,
        cs.file_path,
        cs.file_name,
        cs.`del_flag`,
        cs.`create_by`,
        cs.`create_time`,
        cs.`update_by`,
        cs.`update_time`,
        cs.company_type,
        cs.industry,
        cs.legal_person_code,
        cs.legal_person,
        cs.registered_capital,
        cs.office_address,
        cs.other_address
        FROM
        company_summary cs
        left join sys_company sc on cs.company_id = sc.id
        WHERE
        cs.del_flag = 1
        <if test="companyId!=null and companyId!=''">
            and cs.company_id = #{companyId}
        </if>
        ORDER BY
        cs.create_time DESC
    </select>
 
 
 
 
    <resultMap id="CompanyStatisticsMap" type="com.gkhy.exam.system.domain.vo.statistic.CompanyStatisticsVo">
 
        <result property="companyId" column="company_id"/>
        <result property="companyName" column="company_name"/>
        <result property="companyType" column="company_type"/>
        <result property="industry" column="industry"/>
        <result property="legalPersonCode" column="legal_person_code"/>
        <result property="legalPerson" column="legal_person"/>
        <result property="registeredCapital" column="registered_capital"/>
        <result property="officeAddress" column="office_address"/>
        <result property="otherAddress" column="other_address"/>
<!--        <result property="totalEmployee" column="total_employee"/>-->
<!--        <result property="professionalEmployee" column="professional_employee"/>-->
        <collection property="companyCertificateVOList" javaType="java.util.List" resultMap="CompanyCertificateVO"/>
    </resultMap>
    <resultMap id="CompanyCertificateVO" type="com.gkhy.exam.system.domain.vo.statistic.CompanyCertificateVO">
        <result property="certificateName" column="certificate_name"/>
        <result property="certificateNum" column="certificate_num"/>
        <result property="effectiveTime" column="effective_time"/>
        <result property="getTime" column="get_time"/>
    </resultMap>
 
    <select id="selectCompanyStatistics" resultMap="CompanyStatisticsMap" parameterType="int">
        SELECT cs.`company_id`,
               sc.`name` as company_name,
               cs.company_type,
               cs.industry,
               cs.legal_person_code,
               cs.legal_person,
               cs.registered_capital,
               cs.office_address,
               cs.other_address,
               cc.certificate_name,
               cc.certificate_num,
               cc.effective_time,
               cc.get_time
        FROM company_summary cs
                 inner join sys_company sc on cs.company_id = sc.id and sc.del_flag = 0
                 left join company_certificate cc on cs.company_id = cc.company_id and cc.del_flag = 1
        WHERE cs.del_flag = 1
          and cs.company_id = #{companyId}
    </select>
 
 
 
</mapper>