<?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>
|