<?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.hotent.portal.persistence.dao.ShorturlManageDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.portal.model.ShorturlManage">
        <id column="ID_" property="id" />
        <result column="URL_" property="url" />
        <result column="SHORT_URL_" property="shortUrl" />
        <result column="create_by_" property="createBy" />
        <result column="create_time_" property="createTime" />
        <result column="lose_time_" property="loseTime" />
        <result column="create_org_id_" property="createOrgId" />
        <result column="update_by_" property="updateBy" />
        <result column="update_time_" property="updateTime" />
        <result column="ENABLED_" property="enabled" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID_, URL_, SHORT_URL_, create_by_, create_time_, lose_time_, create_org_id_, update_by_, update_time_, ENABLED_
    </sql>

	<select id="getByShortUrl"   parameterType="java.lang.String" resultMap="BaseResultMap">
		SELECT 
		<include refid="Base_Column_List" />
		FROM portal_shorturl_manage 
		WHERE 
		SHORT_URL_=#{shortUrl}  ORDER BY CREATE_TIME_ DESC
	</select>
</mapper>
