<?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.energy.manage.service.mappers.autoanalysisconfigrelations.AutoAnalysisConfigRelationsMapper">
  <resultMap id="BaseResultMap" type="com.energy.manage.common.po.autoanalysisconfigrelations.AutoAnalysisConfigRelationsPo">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="config_unique_id" jdbcType="VARCHAR" property="configUniqueId" />
    <result column="batch_code" jdbcType="VARCHAR" property="batchCode" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="start_time" jdbcType="DATE" property="startTime" />
    <result column="end_time" jdbcType="DATE" property="endTime" />
  </resultMap>
  <sql id="Base_Column_List">
    config_unique_id, batch_code,start_time,end_time,create_time
  </sql>

  <select id="selectByConfigUniqueId" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from auto_analysis_config_relations
    where config_unique_id = #{configUniqueId,jdbcType=VARCHAR}
    order by create_time desc
    limit 1
  </select>


</mapper>
