<?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.ruoyi.system.mapper.ContractDTOMapper">

    <select id="getInfo" parameterType="QueryEntity" resultType="com.ruoyi.system.domain.dto.ContractDTO">
        SELECT
            con.id,
            con.cert_type certType,
            con.name,
            con.code,
            con.cert_id certId,
            con.cert_major certMajor,
            con.issue_date issueDate,
            con.valid_term validTerm,
            con.email,
            con.phone,
            con.update_date updateDate,
            con.cert_content certContent,
            temp.url
        FROM contract_table con LEFT JOIN template_table temp ON con.template_id = temp.id
        WHERE con.cert_id = #{certNumber} AND con.name = #{userName}
    </select>
</mapper>
