<?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.cab.dao.ContentPushMapper" >
  <resultMap id="BaseResultMap" type="com.cab.model.ContentPush" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="content_type_id" property="contentTypeId" jdbcType="VARCHAR" />
    <result column="thumb" property="thumb" jdbcType="VARCHAR" />
    <result column="title" property="title" jdbcType="VARCHAR" />
    <result column="url" property="url" jdbcType="VARCHAR" />
    <result column="push_time" property="pushTime" jdbcType="TIMESTAMP" />
    <association property="contentType" column="content_type_id" javaType="com.cab.model.ContentType" resultMap="com.cab.dao.ContentTypeMapper.BaseJoinMap"/>
  </resultMap>
  <sql id="Base_Column_List" >
    id, content_type_id, thumb, title, url, push_time, sub_title
  </sql>
  <select id="selectByContentTypeId" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    	cp.id, cp.thumb, cp.content_type_id, cp.title, cp.url, cp.push_time, cp.sub_title, ct.id, ct.name, ct.can_into, ct.display_mode
    from cab_content_push cp inner join cab_content_type ct on cp.content_type_id = ct.id 
    where locate(#{contentTypeId,jdbcType=VARCHAR}, content_type_id) = 1
  </select>
</mapper>