<?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.oa.mapper.SysOaContractMapper">

    <resultMap type="com.ruoyi.oa.domain.vo.SysOaContractVo" id="SysOaContractResult">
        <result property="contractId" column="contract_id"/>
        <result property="contractNum" column="contract_num"/>
        <result property="contractName" column="contract_name"/>
        <result property="firstName" column="first_name"/>
        <result property="firstPerson" column="first_person"/>
        <result property="firstPhone" column="first_phone"/>
        <result property="secondName" column="second_name"/>
        <result property="secondPerson" column="second_person"/>
        <result property="secondPhone" column="second_phone"/>
        <result property="contractPrice" column="contract_price"/>
        <result property="signTime" column="sign_time"/>
        <result property="validity" column="validity"/>
        <result property="contractStatus" column="contract_status"/>
        <result property="accessory" column="accessory"/>
        <result property="remark" column="remark"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
    </resultMap>


    <select id="selectVoOnePlus" resultMap="SysOaContractResult">
        select soc.contract_id,
               soc.project_id,
               soc.contract_num,
               soc.contract_name,
               soc.first_name,
               soc.first_person,
               soc.first_phone,
               soc.second_name,
               soc.second_person,
               soc.second_phone,
               soc.contract_price,
               soc.sign_time,
               soc.validity,
               soc.contract_type,
               soc.contract_status,
               soc.accessory,
               soc.remark,
               soc.create_by,
               soc.create_time,
               soc.update_by,
               soc.update_time,
               so.oss_id,
               file_name,
               original_name,
               file_suffix,
               url,
               service,
               is_public,
               owner_id
        from sys_oa_contract soc
                 left join sys_oss so on FIND_IN_SET(so.oss_id, soc.accessory)
            ${ew.getCustomSqlSegment}
    </select>

    <select id="selectVoListPlus" resultMap="SysOaContractResult">
        select soc.contract_id,
               soc.project_id,
               soc.contract_num,
               soc.contract_name,
               soc.first_name,
               soc.first_person,
               soc.first_phone,
               soc.second_name,
               soc.second_person,
               soc.second_phone,
               soc.contract_price,
               soc.sign_time,
               soc.validity,
               soc.contract_type,
               soc.contract_status,
               soc.accessory,
               soc.remark,
               soc.create_by,
               soc.create_time,
               soc.update_by,
               soc.update_time

        from sys_oa_contract soc
                 left join sys_oss so on FIND_IN_SET(so.oss_id, soc.accessory)
            ${ew.getCustomSqlSegment}
    </select>


</mapper>
