<?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.OaExpressMapper">

    <resultMap type="com.ruoyi.oa.domain.OaExpress" id="OaExpressResult">
        <result property="expressId" column="express_id"/>
        <result property="expressCode" column="express_code"/>
        <result property="status" column="status"/>
        <result property="supplyName" column="supply_name"/>
        <result property="supplyPhone" column="supply_phone"/>
        <result property="ownerId" column="owner_id"/>
        <result property="ownerPhone" column="owner_phone"/>
        <result property="planDate" column="plan_date"/>
        <result property="expressType" column="express_type"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
        <result property="remark" column="remark"/>
    </resultMap>


    <select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.OaExpressVo">
        select oe.express_id,
               oe.project_id,
               oe.detail_id,
               oe.express_code,
               oe.status,
               oe.supply_name,
               oe.supply_phone,
               oe.owner_id,
               oe.owner_phone,
               oe.plan_date,
               oe.express_type,
               oe.create_by,
               oe.create_time,
               oe.update_by,
               oe.update_time,
               oe.last_status,
               oe.last_update_time,
               oe.del_flag,
               oe.remark,
               su.nick_name as ownerName,
               sop.project_name,
               ord.report_detail as detailName
        from oa_express oe
                 left join sys_user su on su.user_id = oe.owner_id
                 left join sys_oa_project sop on sop.project_id = oe.project_id
                 left join oa_report_detail ord on ord.detail_id = oe.detail_id
            ${ew.customSqlSegment}
    </select>
    <select id="selectVoByIdPlus" resultType="com.ruoyi.oa.domain.vo.OaExpressVo">
        select oe.express_id,
               oe.project_id,
               oe.detail_id,
               oe.express_code,
               oe.status,
               oe.supply_name,
               oe.supply_phone,
               oe.owner_id,
               oe.owner_phone,
               oe.plan_date,
               oe.express_type,
               oe.create_by,
               oe.create_time,
               oe.update_by,
               oe.update_time,
               oe.last_status,
               oe.last_update_time,
               oe.del_flag,
               oe.remark,
               su.nick_name as ownerName,
               sop.project_name,
               ord.report_detail as detailName
        from oa_express oe
                 left join sys_user su on su.user_id = oe.owner_id
                 left join sys_oa_project sop on sop.project_id = oe.project_id
                 left join oa_report_detail ord on ord.detail_id = oe.detail_id
          where express_id = #{expressId}
    </select>


</mapper>
