MktMarketingUrlMapper.xml 3.14 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.yoho.unions.dal.IMktMarketingUrlDAO" >
  <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.MktMarketingUrl" >
    <id column="union_type" property="unionType" jdbcType="BIGINT" />
    <result column="division_code" property="divisionCode" jdbcType="INTEGER" />
    <result column="class_code" property="classCode" jdbcType="INTEGER" />
    <result column="channel_code" property="channelCode" jdbcType="INTEGER" />
    <result column="device_code" property="deviceCode" jdbcType="INTEGER" />
    <result column="dept_id" property="deptId" jdbcType="VARCHAR" />
    <result column="create_id" property="createId" jdbcType="VARCHAR" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="src_url" property="srcUrl" jdbcType="VARCHAR" />
    <result column="dest_url" property="destUrl" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
    <result column="mkt_activity_code" property="mktActivityCode" jdbcType="VARCHAR" />
    <result column="landing_page_url" property="landingPageUrl" jdbcType="VARCHAR" />
    <result column="channel_type" property="channelType" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    union_type, division_code, class_code, channel_code, device_code, dept_id, create_id, 
    name, src_url, dest_url, status, create_time,mkt_activity_code,landing_page_url,channel_type
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from mkt_marketing_url
    where union_type = #{unionType,jdbcType=BIGINT}
  </select>
  <select id="selectByName" resultMap="BaseResultMap" >
    select
    <include refid="Base_Column_List" />
    from mkt_marketing_url
    where name = #{name} limit 1
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from mkt_marketing_url
    where union_type = #{unionType,jdbcType=BIGINT}
  </delete>
  <select id="selectUnionTypes" resultType="long">
    select union_type from mkt_marketing_url where
     1=1
     <if test="unionType!=null">
      and union_type=#{unionType}
     </if>
    <if test="name!=null">
      and name=#{name}
    </if>
    <if test="channelType!=null">
      and channel_type=#{channelType}
    </if>
  </select>
  <select id="selectUnionTypeByNameAndUnionType" resultType="java.lang.Long">
    select union_type from mkt_marketing_url where 1=1
     <if test="unionType!=null">
       and union_type=#{unionType}
     </if>
    <if test="name!=null">
      and name=#{name}
    </if>
    limit 1
  </select>
  <select id="selectByUnionTypes" resultMap="BaseResultMap" parameterType="java.lang.String">
    select
    <include refid="Base_Column_List" />
    from mkt_marketing_url
    where union_type in
    <foreach collection="list" open="(" close=")" item="unionType" separator=",">
      #{unionType}
    </foreach>
  </select>
</mapper>