<?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.CompanyCertificateMapper">
|
<update id="updateCertificateById">
|
UPDATE company_certificate
|
<set>
|
<if test="companyId != null and companyId != ''" >
|
company_id = #{companyId},
|
</if>
|
<if test="companyName != null and companyName != ''" >
|
company_name = #{companyName},
|
</if>
|
<if test="certificateName != null and certificateName !=''" >
|
certificate_name = #{certificateName},
|
</if>
|
<if test="certificateNum != null and certificateNum != ''" >
|
certificate_num = #{certificateNum},
|
</if>
|
<if test="effectiveTime != null" >
|
effective_time = #{effectiveTime},
|
</if>
|
<if test="fileName != null and fileName != ''" >
|
file_name = #{fileName},
|
</if>
|
<if test="filePath != null and filePath!=''" >
|
file_path = #{filePath},
|
</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="selectCompanyCertificateList" resultType="com.gkhy.exam.system.domain.CompanyCertificate">
|
SELECT
|
cc.`id`,
|
cc.`company_id`,
|
sc.`name` as company_name,
|
cc.`certificate_name`,
|
cc.`certificate_num`,
|
cc.`effective_time`,
|
cc.`file_name`,
|
cc.`file_path`,
|
cc.`del_flag`,
|
cc.`create_by`,
|
cc.`create_time`,
|
cc.`update_by`,
|
cc.`update_time`
|
FROM
|
company_certificate cc
|
left join sys_company sc on cc.company_id = sc.id
|
WHERE
|
cc.del_flag = 1
|
<if test="companyId!=null and companyId!=''">
|
and cc.company_id = #{companyId}
|
</if>
|
ORDER BY
|
cc.create_time DESC
|
</select>
|
</mapper>
|