<?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.keyware.shandan.datasource.mapper.DataSourceMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.keyware.shandan.datasource.entity.DataSourceVo">
        <id column="ID" property="id" />
        <result column="DRIVER_ID" property="driverId" />
        <result column="NAME" property="name" />
        <result column="TYPE" property="type" />
        <result column="DB_TYPE" property="dbType" />
        <result column="DB_VERSION" property="dbVersion" />
        <result column="JDBC_DRIVER_CLASS" property="jdbcDriverClass" />
        <result column="JDBC_URL" property="jdbcUrl" />
        <result column="JDBC_USER_NAME" property="jdbcUserName" />
        <result column="JDBC_PASSWORD" property="jdbcPassword" />
        <result column="JDBC_SCHEMA" property="jdbcSchema" />
        <result column="HOST" property="host" />
        <result column="PORT" property="port" />
        <result column="REMARK" property="remark" />
        <result column="IS_DELETE" property="deleted" />
        <result column="CREATE_TIME" property="createTime" />
        <result column="MODIFY_TIME" property="modifyTime" />
        <result column="CREATE_USER" property="createUser" />
        <result column="MODIFY_USER" property="modifyUser" />
        <association property="driver" column="DRIVER_ID" select="selectDriver"/>
    </resultMap>

    <select id="selectDriver" parameterType="String" resultType="com.keyware.shandan.datasource.entity.DBDriverVo">
        select * from B_DRIVERS where ID = #{ID}
    </select>
</mapper>
