DriverSchedulingExpandSmartMapper.xml 3.45 KB
<?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.mapper.DriverSchedulingExpandSmartMapper">

    <resultMap id="BaseResultMap" type="com.ruoyi.domain.DriverSchedulingExpandSmart">
            <id property="id" column="id" jdbcType="VARCHAR"/>
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="expandId" column="expand_id" jdbcType="VARCHAR"/>
            <result property="masterJobCode" column="master_job_code" jdbcType="VARCHAR"/>
            <result property="slaveJobCode" column="slave_job_code" jdbcType="VARCHAR"/>
            <result property="startDate" column="start_date" jdbcType="DATE"/>
            <result property="endDate" column="end_date" jdbcType="DATE"/>
            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <result property="remark" column="remark" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="SmartExpandVo" type="com.ruoyi.pojo.vo.SmartExpandVo">
        <id property="id" column="id" jdbcType="VARCHAR"/>
        <result property="slaveJobCode" column="slave_job_code" jdbcType="VARCHAR"/>
        <result property="type" column="type" jdbcType="TINYINT"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <collection property="activities" ofType="com.ruoyi.pojo.vo.SmartExpandVo$Activity">
            <result column="name" property="name" jdbcType="VARCHAR"/>
            <result column="smart_id" property="uuId" jdbcType="VARCHAR"/>
            <result column="master_job_code" property="masterJobCode" jdbcType="VARCHAR"/>
            <result column="start_date" property="startDate" jdbcType="DATE"/>
            <result column="end_date" property="endDate" jdbcType="DATE"/>
        </collection>
    </resultMap>

    <sql id="Base_Column_List">
        id,expand_id,`name`,master_job_code,
        slave_job_code,start_date,end_date,
        create_by,update_by,create_time,
        update_time,remark
    </sql>
    <select id="querySmartExpand" resultMap="SmartExpandVo" resultType="com.ruoyi.pojo.vo.SmartExpandVo">
        SELECT
            expand.id,
            expand.slave_job_code,
            expand.type,
            expand.remark,
            smart.id smart_id,
            smart.start_date,
            smart.end_date,
            smart.master_job_code,
            smart.`name`
        FROM
            driver_scheduling_expand expand,
            driver_scheduling_expand_smart smart
        WHERE
            expand.id = smart.expand_id
            AND expand.id = #{id}
    </select>
    <select id="querySmartExpandAll" resultMap="SmartExpandVo" resultType="com.ruoyi.pojo.vo.SmartExpandVo">
        SELECT
            expand.id,
            expand.slave_job_code,
            expand.type,
            expand.remark,
            smart.id smart_id,
            smart.start_date,
            smart.end_date,
            smart.master_job_code,
            smart.`name`
        FROM
            driver_scheduling_expand expand,
            driver_scheduling_expand_smart smart
        WHERE
            expand.id = smart.expand_id
    </select>
</mapper>